Identity gate
See original GitHub issueIdentity is a unitary. We probably want an explicit representation for it in cirq.
Rationale:
- Many expressions evaluate to the identity exactly (e.g. composition of H with H) or up to global phase (e.g. composition of X, Y and Z). Code that detects and optimizes such expressions may need to return identity explicitly.
- Identity is a convenient initializer for reduce-like operations on gates.
- It’s directly useful in expressions for quantum channels (see e.g. #1037).
- It’s one of the basis elements in the Pauli basis of the space of hermitian operators. Having explicit representation for it simplifies code for #491.
- There are currently multiple hacky ways of specifying the identity (e.g.
cirq.Y**0
). If an explicit, elegant way (e.g.cirq.I
orcirq.Identity
) is provided, the users are more likely to eschew the hacky expressions.
Some things to consider in implementation:
- It should be removed by all decompositions.
- It should compare equal to expressions such as
cirq.Z**0
orcirq.Rx(rads=0)
. - Do we need a gate for changing global phase? If so, that gate should probably be implemented simply as a phase factor for identity.
- Circuits such as
0: ───X^0───
1: ───Y─────
should display as
0: ─────────
1: ───Y─────
or
1: ───Y───
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Single Qubit Gates - Qiskit
First comes the I-gate (aka 'Id-gate' or 'Identity gate'). This is simply a gate that does nothing. Its matrix is the identity matrix:....
Read more >Quantum logic gate - Wikipedia
In quantum computing and specifically the quantum circuit model of computation, a quantum ... The identity gate is the identity matrix, usually written...
Read more >All the quantum gate identities fit for print - Chris Ferrie - Medium
All the quantum gate identities fit for print. Welcome to Introduction to Quantum Computing. I am your guide, Associate Professor Chris Ferrie, a...
Read more >How to Implement a noisy identity gate on qiskit?
I can successfully implement the U gate (single qubit) on qiskit, but when I am trying for the identity operation it is not...
Read more >Operations glossary - IBM Quantum
Quantum operations include quantum gates, such as the Hadamard gate, ... The identity gate (sometimes called the Id or the I gate) is...
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
I think displaying it as empty isn’t quite correct? Putting identity gates into a Moment is sort of saying "do nothing here and block anything else from happening here). If you don’t show it then you will end up having odd things where you don’t see that the identity gate is in a particular location.
Already done