mimiqcircuits.operations.gates.standard.id

Identity (ID) gate.

Classes

GateID()

Single qubit Identity gate.

class GateID[source]

Bases: Gate

Single qubit Identity gate.

Matrix Representation

\[\begin{split}\operatorname{ID} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\end{split}\]

Examples

>>> from mimiqcircuits import *
>>> GateID()
ID
>>> GateID().matrix()
[1.0, 0]
[0, 1.0]

>>> c = Circuit().push(GateID(), 0)
>>> c
1-qubit circuit with 1 instruction:
└── ID @ q[0]

>>> GateID().power(2), GateID().inverse()
(ID, ID)
>>> GateID().decompose()
1-qubit circuit with 1 instruction:
└── U(0, 0, 0, 0.0) @ q[0]
inverse()[source]

Return the inverse of the gate.

Gates with a known inverse return it directly (for example GateS().inverse() is GateSDG()); otherwise the gate is wrapped in Inverse.

isidentity()[source]

Whether the operation is known to act as the identity.

Returns:

True only when the operation is known to be the identity. False does not prove the opposite.

Return type:

bool