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

CRZGate.ctrl_state

Return the control state of the gate as a decimal integer.

CRZGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

CRZGate.definition

Return definition in terms of other basic gates.

CRZGate.label

Return gate label

CRZGate.num_ctrl_qubits

Get number of control qubits.

CRZGate.params

return instruction params.

Methods

CRZGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

CRZGate.assemble()

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.

CRZGate.inverse()

Return inverse CRZ gate (i.e.

CRZGate.is_parameterized()

Return True .IFF.

CRZGate.mirror()

DEPRECATED: use instruction.reverse_ops().

CRZGate.power(exponent)

Creates a unitary gate as gate^exponent.

CRZGate.qasm()

Return a default OpenQASM string for the instruction.

CRZGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

CRZGate.reverse_ops()

For a composite instruction, reverse the order of sub-instructions.

CRZGate.to_matrix()

Return a numpy.array for the CRZ gate.