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}\]

See also

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.

Create new CPhase gate.

Attributes

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.

Methods

CPhaseGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

CPhaseGate.assemble()

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.

CPhaseGate.inverse()

Return inverted CPhase gate (\(CPhase(\lambda){\dagger} = CPhase(-\lambda)\))

CPhaseGate.is_parameterized()

Return True .IFF.

CPhaseGate.mirror()

DEPRECATED: use instruction.reverse_ops().

CPhaseGate.power(exponent)

Creates a unitary gate as gate^exponent.

CPhaseGate.qasm()

Return a default OpenQASM string for the instruction.

CPhaseGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

CPhaseGate.reverse_ops()

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

CPhaseGate.to_matrix()

Return a numpy.array for the CPhase gate.