PhaseGate

class PhaseGate(theta, label=None)[source]

Single-qubit rotation about the Z axis.

This is a diagonal gate. It can be implemented virtually in hardware via framechanges (i.e. at zero error and duration).

Circuit symbol:

     ┌──────┐
q_0: ┤ P(λ) ├
     └──────┘

Matrix Representation:

\[\begin{split}P(\lambda) = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\lambda} \end{pmatrix}\end{split}\]

Examples:

\[P(\lambda = \pi) = Z\]
\[P(\lambda = \pi/2) = S\]
\[P(\lambda = \pi/4) = T\]

See also

RZGate: This gate is equivalent to RZ up to a phase factor.

\[P(\lambda) = e^{i{\lambda}/2} RZ(\lambda)\]

Reference for virtual Z gate implementation: 1612.00858

Create new Phase gate.

Attributes

PhaseGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

PhaseGate.definition

Return definition in terms of other basic gates.

PhaseGate.label

Return gate label

PhaseGate.params

return instruction params.

Methods

PhaseGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

PhaseGate.assemble()

Assemble a QasmQobjInstruction

PhaseGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

PhaseGate.c_if(classical, val)

Add classical condition on register classical and value val.

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

Return a (mutli-)controlled-Phase gate.

PhaseGate.copy([name])

Copy of the instruction.

PhaseGate.inverse()

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

PhaseGate.is_parameterized()

Return True .IFF.

PhaseGate.mirror()

DEPRECATED: use instruction.reverse_ops().

PhaseGate.power(exponent)

Creates a unitary gate as gate^exponent.

PhaseGate.qasm()

Return a default OpenQASM string for the instruction.

PhaseGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

PhaseGate.reverse_ops()

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

PhaseGate.to_matrix()

Return a numpy.array for the Phase gate.