cirq.X and cirq.X**(-1) render the same in text diagrams
See original GitHub issueIs your feature request related to a use case or problem? Please describe.
import cirq
a = cirq.LineQubit(1)
cirq.Circuit(cirq.X.on(a), cirq.X.on(a)**(-1))
> 1: ───X───X───
Now, this is sensible because X and -X have the same unitary up to a global phase. However, X and -X are implemented differently when you run them on hardware, and we use this fact sometimes when doing experiments on hardware.
Describe the solution you’d like I think it’d make sense to render the exponent when it’s -1, like
> 1: ───X───X^-1───
What is the urgency from your perspective for this issue? Is it blocking important work?
P3 - I’m not really blocked by it, it is an idea I’d like to discuss / suggestion based on principle
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
cirq.Circuit - Google Quantum AI
A mutable list of groups of operations to apply to some qubits.
Read more >How to use the cirq.circuits function in cirq | Snyk
How to use the cirq.circuits function in cirq. To help you get started, we've selected a few cirq examples, based on popular ways...
Read more >In Cirq, how do you display circuit diagrams that are "prettier ...
I'm duplicating this question to increase it's visibility. The standard way to print circuits in Cirq is by calling print(circuit) : which ...
Read more >Cirq Documentation
Cirq Documentation, Release 0.4.0 ... X(q) for q in qubits if (q.row + q.col) % 2 == 1) ... prints the text diagram...
Read more >Quantum Convolutional Neural Network - TensorFlow
def one_qubit_unitary(bit, symbols): """Make a Cirq circuit enacting a rotation of the bloch sphere about the X, Y and Z axis, that ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Regarding rendering, in the unicode mode we could render X inverse as X† which is merely two characters long instead of five in X**-1.
@Ishan-Gokhale I’ve assigned it to you.