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.

cirq.X and cirq.X**(-1) render the same in text diagrams

See original GitHub issue

Is 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:open
  • Created 3 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
viathorcommented, Dec 11, 2020

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.

0reactions
vtomolecommented, Jul 24, 2022

@Ishan-Gokhale I’ve assigned it to you.

Read more comments on GitHub >

github_iconTop 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 >

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