DSLValidationError. Like single-qubit gates, multi-qubit gates route automatically to the exact or broad IR path depending on which decorator wraps the calling function. Parametric two-qubit gates (cry, crz) are only available in @parametric and @adaptive programs.
Gate overview
cx
|1⟩. cx is self-inverse.
Allowed in: exact programs, compute blocks.
Wire
required
The control qubit wire.
Wire
required
The target qubit wire. Must be distinct from
control.cz
|1⟩. Equivalent to applying Z then CX, or H · CX · H on the target. cz is self-inverse and symmetric: cz(a, b) == cz(b, a).
Allowed in: exact programs, phase blocks.
Wire
required
The control qubit wire.
Wire
required
The target qubit wire. Must be distinct from
control.swap
swap is self-inverse.
Allowed in: exact programs, compute blocks.
Wire
required
The first qubit wire.
Wire
required
The second qubit wire. Must be distinct from
a.cry
ry(theta) to the target when the control is |1⟩. Parametric — not in the exact gate set.
Allowed in: @parametric and @adaptive programs only.
float
required
Rotation angle in radians.
Wire
required
The control qubit wire.
Wire
required
The target qubit wire. Must be distinct from
control.crz
rz(theta) to the target when the control is |1⟩. Parametric — not in the exact gate set.
Allowed in: @parametric and @adaptive programs only.
float
required
Rotation angle in radians.
Wire
required
The control qubit wire.
Wire
required
The target qubit wire. Must be distinct from
control.ccx
c0 and c1 are |1⟩. ccx is self-inverse and is the canonical three-qubit gate for reversible classical computation.
Allowed in: exact programs, compute blocks.
Wire
required
The first control qubit wire.
Wire
required
The second control qubit wire.
Wire
required
The target qubit wire. Must be distinct from
c0 and c1.ccz
|1⟩. ccz is self-inverse and a diagonal gate.
Allowed in: exact programs, phase blocks.
Wire
required
The first control qubit wire.
Wire
required
The second control qubit wire.
Wire
required
The target qubit wire. Must be distinct from both controls.
mcx
|1⟩. Requires at least one control wire. mcx generalises cx (one control) and ccx (two controls) to any number of controls.
Allowed in: exact programs, compute blocks.
Sequence[Wire]
required
A sequence of one or more control qubit wires. All wires must be distinct from each other and from
target.Wire
required
The target qubit wire.
mcz
|1⟩. Requires at least one control wire. mcz is a diagonal gate.
Allowed in: exact programs, phase blocks.
Sequence[Wire]
required
A sequence of one or more control qubit wires. All wires must be distinct from each other and from
target.Wire
required
The target qubit wire.