Gates

The gates are used to represent various gate operations on qubits. Gates should implement the following functions:

label
qubit_count
n_angles
angles
chars
ir_typ
ir_str
targets_and_controls
  • label is used to generate the gate's representation in OpenQASM3.
  • chars is used when pretty-printing the gate as part of a Circuit.
  • n_angles is the number of angles present in the gate and angles is an accessor method for those angles – gates without angles should return an empty tuple ().
  • ir_typ is a mapping to the gate's sibling in the IR submodule.
  • ir_str is the gate's full OpenQASM3 representation.
  • targets_and_controls should accept the gate and a QubitSet of qubits to apply it to, and generate from this the list of control qubits and target qubits.

New gates with angle parameters should be subtypes of AngledGate{N}, where N is the number of angle parameters. They should have one member, angle::NTuple{N, Union{Float64, FreeParameter}}.

Braket.GateType
Gate <: QuantumOperator

Abstract type representing a quantum gate.

Braket.AngledGateType
AngledGate{NA} <: Gate

Parametric type representing a quantum gate with NA angle parameters.

Braket.HType
H <: Gate
H() -> H

H gate.

Braket.IType
I <: Gate
I() -> I

I gate.

Braket.XType
X <: Gate
X() -> X

X gate.

Braket.YType
Y <: Gate
Y() -> Y

Y gate.

Braket.ZType
Z <: Gate
Z() -> Z

Z gate.

Braket.PhaseShiftType
PhaseShift <: AngledGate{1}
PhaseShift(angles) -> PhaseShift

PhaseShift gate.

Braket.RxType
Rx <: AngledGate{1}
Rx(angles) -> Rx

Rx gate.

Braket.RyType
Ry <: AngledGate{1}
Ry(angles) -> Ry

Ry gate.

Braket.RzType
Rz <: AngledGate{1}
Rz(angles) -> Rz

Rz gate.

Braket.VType
V <: Gate
V() -> V

V gate.

Braket.ViType
Vi <: Gate
Vi() -> Vi

Vi gate.

Braket.TType
T <: Gate
T() -> T

T gate.

Braket.TiType
Ti <: Gate
Ti() -> Ti

Ti gate.

Braket.SType
S <: Gate
S() -> S

S gate.

Braket.SiType
Si <: Gate
Si() -> Si

Si gate.

Braket.CNotType
CNot <: Gate
CNot() -> CNot

CNot gate.

Braket.CVType
CV <: Gate
CV() -> CV

CV gate.

Braket.CYType
CY <: Gate
CY() -> CY

CY gate.

Braket.CZType
CZ <: Gate
CZ() -> CZ

CZ gate.

Braket.XXType
XX <: AngledGate{1}
XX(angles) -> XX

XX gate.

Braket.XYType
XY <: AngledGate{1}
XY(angles) -> XY

XY gate.

Braket.YYType
YY <: AngledGate{1}
YY(angles) -> YY

YY gate.

Braket.ZZType
ZZ <: AngledGate{1}
ZZ(angles) -> ZZ

ZZ gate.

Braket.ECRType
ECR <: Gate
ECR() -> ECR

ECR gate.

Braket.CPhaseShiftType
CPhaseShift <: AngledGate{1}
CPhaseShift(angles) -> CPhaseShift

CPhaseShift gate.

Braket.CPhaseShift00Type
CPhaseShift00 <: AngledGate{1}
CPhaseShift00(angles) -> CPhaseShift00

CPhaseShift00 gate.

Braket.CPhaseShift01Type
CPhaseShift01 <: AngledGate{1}
CPhaseShift01(angles) -> CPhaseShift01

CPhaseShift01 gate.

Braket.CPhaseShift10Type
CPhaseShift10 <: AngledGate{1}
CPhaseShift10(angles) -> CPhaseShift10

CPhaseShift10 gate.

Braket.SwapType
Swap <: Gate
Swap() -> Swap

Swap gate.

Braket.PSwapType
PSwap <: AngledGate{1}
PSwap(angles) -> PSwap

PSwap gate.

Braket.ISwapType
ISwap <: Gate
ISwap() -> ISwap

ISwap gate.

Braket.CSwapType
CSwap <: Gate
CSwap() -> CSwap

CSwap gate.

Braket.CCNotType
CCNot <: Gate
CCNot() -> CCNot

CCNot gate.

Braket.UnitaryType
Unitary <: Gate
Unitary(matrix::Matrix{ComplexF64}) -> Unitary

Arbitrary unitary gate.