CZGate

class CZGate(label=None, ctrl_state=None)[source]

Controlled-Z gate.

This is a Clifford and symmetric gate.

Circuit symbol:

q_0: ─■─
      │
q_1: ─■─

Matrix representation:

\[\begin{split}CZ\ q_1, q_0 = |0\rangle\langle 0| \otimes I + |1\rangle\langle 1| \otimes Z = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{pmatrix}\end{split}\]

In the computational basis, this gate flips the phase of the target qubit if the control qubit is in the \(|1\rangle\) state.

Create new CZ gate.

Attributes

CZGate.ctrl_state

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

CZGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

CZGate.definition

Return definition in terms of other basic gates.

CZGate.label

Return gate label

CZGate.params

return instruction params.

Methods

CZGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

CZGate.assemble()

Assemble a QasmQobjInstruction

CZGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

CZGate.c_if(classical, val)

Add classical condition on register classical and value val.

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

Return controlled version of gate.

CZGate.copy([name])

Copy of the instruction.

CZGate.inverse()

Return inverted CZ gate (itself).

CZGate.is_parameterized()

Return True .IFF.

CZGate.mirror()

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

CZGate.power(exponent)

Creates a unitary gate as gate^exponent.

CZGate.qasm()

Return a default OpenQASM string for the instruction.

CZGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

CZGate.to_matrix()

Return a Numpy.array for the gate unitary matrix.