CRZGate¶
- class CRZGate(theta, label=None, ctrl_state=None)[source]¶
Controlled-RZ gate.
This is a diagonal but non-symmetric gate that induces a phase on the state of the target qubit, depending on the control state.
Circuit symbol:
q_0: ────■──── ┌───┴───┐ q_1: ┤ Rz(λ) ├ └───────┘
Matrix representation:
\[\begin{split}CRZ(\lambda)\ q_0, q_1 = I \otimes |0\rangle\langle 0| + RZ(\lambda) \otimes |1\rangle\langle 1| = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & e^{-i\frac{\lambda}{2}} & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{i\frac{\lambda}{2}} \end{pmatrix}\end{split}\]Note
In Qiskit’s convention, higher qubit indices are more significant (little endian convention). In many textbooks, controlled gates are presented with the assumption of more significant qubits as control, which in our case would be q_1. Thus a textbook matrix for this gate will be:
┌───────┐ q_0: ┤ Rz(λ) ├ └───┬───┘ q_1: ────■────
\[\begin{split}CRZ(\lambda)\ q_1, q_0 = |0\rangle\langle 0| \otimes I + |1\rangle\langle 1| \otimes RZ(\lambda) = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & e^{-i\frac{\lambda}{2}} & 0 \\ 0 & 0 & 0 & e^{i\frac{\lambda}{2}} \end{pmatrix}\end{split}\]See also
CU1Gate
: Due to the global phase difference in the matrix definitions of U1 and RZ, CU1 and CRZ are different gates with a relative phase difference.Create new CRZ gate.
Attributes
Return the control state of the gate as a decimal integer.
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
Return definition in terms of other basic gates.
Return gate label
return instruction params.
Methods
CRZGate.add_decomposition
(decomposition)Add a decomposition of the instruction to the SessionEquivalenceLibrary.
Assemble a QasmQobjInstruction
CRZGate.broadcast_arguments
(qargs, cargs)Validation and handling of the arguments and its relationship.
CRZGate.c_if
(classical, val)Add classical condition on register classical and value val.
CRZGate.control
([num_ctrl_qubits, label, …])Return controlled version of gate.
CRZGate.copy
([name])Copy of the instruction.
Return inverse RZ gate (i.e.
Return True .IFF.
For a composite instruction, reverse the order of sub-gates.
CRZGate.power
(exponent)Creates a unitary gate as gate^exponent.
Return a default OpenQASM string for the instruction.
Creates an instruction with gate repeated n amount of times.
Return a Numpy.array for the gate unitary matrix.