# 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. 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. Return inverted Z gate (itself). Return True .IFF. DEPRECATED: use instruction.reverse_ops(). ZGate.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 Z gate.