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.
The control qubit wire.
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.
The control qubit wire.
The target qubit wire. Must be distinct from
control.swap
swap is self-inverse.
Allowed in: exact programs, compute blocks.
The first qubit wire.
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.
Rotation angle in radians.
The control qubit wire.
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.
Rotation angle in radians.
The control qubit wire.
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.
The first control qubit wire.
The second control qubit wire.
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.
The first control qubit wire.
The second control qubit wire.
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.
A sequence of one or more control qubit wires. All wires must be distinct from each other and from
target.The target qubit wire.
mcz
|1⟩. Requires at least one control wire. mcz is a diagonal gate.
Allowed in: exact programs, phase blocks.
A sequence of one or more control qubit wires. All wires must be distinct from each other and from
target.The target qubit wire.