deltakit.circuit.gates.CX#

class deltakit.circuit.gates.CX(control: UT | T, target: VT | T, *, tag: str | None = None)#

Bases: ControlledGate[Qubit[T] | SweepBit | MeasurementRecord, Qubit[T]]

The Z-controlled X gate. First qubit is the control, second qubit is the target. The first qubit can be replaced by a measurement record. Applies an X gate to the target if the control is in the |1> state.

Notes

Negates the amplitude of the |1,-> state.

Stabilizer Generators:
X_ -> +XX
Z_ -> +Z_
_X -> +_X
_Z -> +ZZ
Unitary Matrix:
\[\begin{split}\begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \end{pmatrix}\end{split}\]

Methods#

CX.from_consecutive

Yield an class instance for each pair in a flattened sequence of data.

CX.stim_targets

Get the stim gate targets which define this operation.

CX.transform_qubits

Transform this gates's qubits according to the id mapping.