CU1Gate

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

Controlled-U1 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}CU1 = |0\rangle\langle 0| \otimes I + |1\rangle\langle 1| \otimes U1 = \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 U1 and RZ, CU1 and CRZ are different gates with a relative phase difference.

Create new CU1 gate.

Attributes

CU1Gate.ctrl_state

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

CU1Gate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

CU1Gate.definition

Return definition in terms of other basic gates.

CU1Gate.label

Return gate label

CU1Gate.num_ctrl_qubits

Get number of control qubits.

CU1Gate.params

return instruction params.

Methods

CU1Gate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

CU1Gate.assemble()

Assemble a QasmQobjInstruction

CU1Gate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

CU1Gate.c_if(classical, val)

Add classical condition on register classical and value val.

CU1Gate.control([num_ctrl_qubits, label, …])

Controlled version of this gate.

CU1Gate.copy([name])

Copy of the instruction.

CU1Gate.inverse()

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

CU1Gate.is_parameterized()

Return True .IFF.

CU1Gate.mirror()

DEPRECATED: use instruction.reverse_ops().

CU1Gate.power(exponent)

Creates a unitary gate as gate^exponent.

CU1Gate.qasm()

Return a default OpenQASM string for the instruction.

CU1Gate.repeat(n)

Creates an instruction with gate repeated n amount of times.

CU1Gate.reverse_ops()

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

CU1Gate.to_matrix()

Return a numpy.array for the CU1 gate.