# CPhaseGate¶

class CPhaseGate(theta, label=None, ctrl_state=None)[source]

Controlled-Phase gate.

This is a diagonal and symmetric gate that induces a phase on the state of the target qubit, depending on the control state.

Circuit symbol:

q_0: ─■──
│λ
q_1: ─■──


Matrix representation:

$\begin{split}CPhase = |0\rangle\langle 0| \otimes I + |1\rangle\langle 1| \otimes P = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{i\lambda} \end{pmatrix}\end{split}$

CRZGate: Due to the global phase difference in the matrix definitions of Phase and RZ, CPhase and CRZ are different gates with a relative phase difference.
 CPhaseGate.ctrl_state Return the control state of the gate as a decimal integer. CPhaseGate.decompositions Get the decompositions of the instruction from the SessionEquivalenceLibrary. CPhaseGate.definition Return definition in terms of other basic gates. CPhaseGate.label Return gate label CPhaseGate.num_ctrl_qubits Get number of control qubits. CPhaseGate.params return instruction params.
 CPhaseGate.add_decomposition(decomposition) Add a decomposition of the instruction to the SessionEquivalenceLibrary. Assemble a QasmQobjInstruction CPhaseGate.broadcast_arguments(qargs, cargs) Validation and handling of the arguments and its relationship. CPhaseGate.c_if(classical, val) Add classical condition on register classical and value val. CPhaseGate.control([num_ctrl_qubits, label, …]) Controlled version of this gate. CPhaseGate.copy([name]) Copy of the instruction. Return inverted CPhase gate ($$CPhase(\lambda){\dagger} = CPhase(-\lambda)$$) Return True .IFF. DEPRECATED: use instruction.reverse_ops(). CPhaseGate.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. For a composite instruction, reverse the order of sub-instructions. Return a numpy.array for the CPhase gate.