question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add an option to highlight a subset of qubits in cirq.Heatmap

See original GitHub issue

Is your feature request related to a use case or problem? Please describe.

Describe the solution you’d like Heatmaps are often useful to visualize error metrics for qubits and couplers on the google devices. When selecting a subset of qubits to run an experiment on; it’s useful to consult heatmaps of error metrics. We should add an option to the cirq.Heatmap and cirq.TwoQubitInteractionHeatmap so that we can pass in a list of qubits and highlight it on the heatmap. For example:

image

This can be done right now by manually specifying a different edge width and color for the selected qubits. For example:

fig, ax = plt.subplots(figsize=(12, 10))
edge_colors = tuple('red' if q in selected_qubits else 'grey' for q in device.qubits)
linestyle = tuple('solid' if q in selected_qubits else 'dashed' for q in device.qubits)
linewidths = tuple(4 if q in selected_qubits else 2 for q in device.qubits)
cirq.Heatmap({q: 0.0 for q in device.qubits}).plot(
    ax=ax,
    collection_options={
        'cmap': 'binary',
        'linewidths': linewidths,
        'edgecolors': edge_colors,
        'linestyles': linestyle,
    },
    plot_colorbar=False,
    annotation_format=None,
)
heatmap._plot_on_axis(ax)
fig.show()

What is the urgency from your perspective for this issue? Is it blocking important work? P1 - I need this no later than the next release (end of quarter)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
tanujkhattarcommented, Jun 20, 2022

@kris524 Yes, the feature is still needed and we would appreciate help!

0reactions
kris524commented, Jun 26, 2022

One last question: Could you suggest a method for PolyCollection or something that could help me get the data in collection_options? This is for testing purposes (I want to compare the expected vs returned contents of linewidths edge_colors linestyle)

Read more comments on GitHub >

github_iconTop Results From Across the Web

cirq.Heatmap - Google Quantum AI
A dictionary of qubits or QubitTuples as keys and corresponding magnitude as float values. It corresponds to the data which should be plotted...
Read more >
Identifying Hardware Changes | Cirq - Google Quantum AI
The rest of this tutorial will describe these hardware changes, demonstrate how to collect error metrics for identifying if changes have ...
Read more >
Module: cirq - Google Quantum AI
Cirq is a framework for creating, editing, and invoking quantum circuits. ... class Heatmap : Distribution of a value in 2D qubit lattice...
Read more >
cirq.Moment - Google Quantum AI
Moment can be indexed by qubit or list of qubits: ... Raises. ValueError, if this moments' qubits are not a subset of qubits...
Read more >
cirq.PauliString - Google Quantum AI
Represents a multi-qubit pauli operator or pauli observable. ... qubit_pauli_map: Optional[Dict[TKey, 'cirq.Pauli']] = None,
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found