cirq.IdentityGate

class cirq.IdentityGate(num_qubits: Optional[int] = None, qid_shape: Optional[Tuple[int, …]] = None)[source]

A Gate that perform no operation on qubits.

The unitary matrix of this gate is a diagonal matrix with all 1s on the
diagonal and all 0s off the diagonal in any basis.

cirq.I is the single qubit identity gate.

__init__(num_qubits: Optional[int] = None, qid_shape: Optional[Tuple[int, …]] = None) → None[source]
Parameters
  • num_qubits

  • qid_shape – Specifies the dimension of each qid the measurement applies to. The default is 2 for every qubit.

Raises

ValueError – If the length of qid_shape doesn’t equal num_qubits.