ZGate

class ZGate(label=None)[source]

The single-qubit Pauli-Z gate (\(\sigma_z\)).

Matrix Representation:

\[\begin{split}Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\end{split}\]

Circuit symbol:

     ┌───┐
q_0: ┤ Z ├
     └───┘

Equivalent to a \(\pi\) radian rotation about the Z axis.

Note

A global phase difference exists between the definitions of \(RZ(\pi)\) and \(Z\).

\[\begin{split}RZ(\pi) = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} = -Z\end{split}\]

The gate is equivalent to a phase flip.

\[\begin{split}|0\rangle \rightarrow |0\rangle \\ |1\rangle \rightarrow -|1\rangle\end{split}\]

Create new Z gate.

Attributes

ZGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

ZGate.definition

Return definition in terms of other basic gates.

ZGate.label

Return gate label

ZGate.params

return instruction params.

Methods

ZGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

ZGate.assemble()

Assemble a QasmQobjInstruction

ZGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

ZGate.c_if(classical, val)

Add classical condition on register classical and value val.

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

Return a (mutli-)controlled-Z gate.

ZGate.copy([name])

Copy of the instruction.

ZGate.inverse()

Return inverted Z gate (itself).

ZGate.is_parameterized()

Return True .IFF.

ZGate.mirror()

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

ZGate.power(exponent)

Creates a unitary gate as gate^exponent.

ZGate.qasm()

Return a default OpenQASM string for the instruction.

ZGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

ZGate.to_matrix()

Return a numpy.array for the Z gate.