Circuit Intermediate Representation (bqskit.ir
)
The BQSKit Circuit structure is a 2d array of operations. A circuit is indexed first by cycles and second by qudits. The cycle index determines when operations are executed, and the qudit index determines which qudits an operation operates on.
Every component of the IR is also a function from a vector of real numbers to a unitary matrix. This is to facilitate circuit instantiation, a core primitive in quantum synthesis.
Core Classes

A Circuit is a quantum program composed of operation objects. 

Gate Base Class. 

An Operation groups together a gate, its parameters and location. 
Circuit Indexing and Helpers

The CycleInterval class. 

A CircuitIterator iterates through a circuit in a simulation order. 

The CircuitLocation class. 

A cycle and qudit index pair used to index a circuit. 

The CircuitRegion class. 

Stores compressed positions of gates in a circuit as a hashable type. 
Type Aliases
alias of 

alias of 

alias of 

alias of 
Gate Library
BQSKit Gates (bqskit.ir.gates
)
Constant Gates
The 2 qubit B gate. 

The toffoli gate, equal to an X gate with two controls. 

alias of 

The controlledHadamard gate. 

The onequdit clock (Z) gate. 

The twoqutrit CPI gate. 

The ControlledS gate. 

The twoqudit ConditionalSUM gate. 

The ControlledT gate. 

The ControlledNot or ControlledX gate. 

alias of 

The ControlledY gate. 

The ControlledZ gate. 

The onequdit Hadamard gate. 

An Identity (NoOP) Gate. 

The two qubit swap and phase iSWAP gate. 

The IToffoliGate gate, equal to an iX gate with two controls. 

The onequdit P[i] gate. 

A Permutation Gate. 

alias of 

The relative phase c3x gate. 

The relative phase ccx gate. 

The singlequbit S gate. 

The singlequbit S Dagger gate. 

The onequdit shift (X) gate. 

The Square root ControlledX gate. 

The square root two qubit swap and phase iSWAP gate. 

The twoqudit subspace SWAP gate. 

The twoqudit swap gate. 

The Sqrt(X) gate. 

alias of 

The SycamoreGate gate. 

The singlequbit T gate. 

The singlequbit T Dagger gate. 

An arbitrary constant unitary operator. 

The Pauli X gate. 

The Ising XX coupling gate. 

The Pauli Y gate. 

The Ising YY coupling gate. 

The Pauli Z gate. 

The Ising ZZ coupling gate. 
Parameterized Gates
A gate representing a controlled controlled phase rotation. 

The CabibboKobayashiMaskawa single qutrit gate. 

The CabibboKobayashiMaskawa dagger single qutrit gate. 

A gate representing a controlled phase rotation. 

A gate representing an arbitrary qudit controlled phase rotation. 

A gate representing a controlled X rotation. 

A gate representing a controlled Y rotation. 

A gate representing a controlled Z rotation. 

A gate representing an arbitrary controlled rotation. 

Google's FSIM Gate. 

A gate representing an arbitrary rotation. 

A gate representing an Google's PhasedXZGate. 

Rotation by SU3 generator for a single qutrit gate. 

A gate representing an arbitrary rotation around the X axis. 

A gate representing an arbitrary rotation around the XX axis. 

A gate representing an arbitrary rotation around the Y axis. 

A gate representing an arbitrary rotation around the YY axis. 

A gate representing an arbitrary rotation around the Z axis. 

A gate representing an arbitrary rotation around the ZZ axis. 

The U1 single qubit gate. 

The Quantinuum U1q single qubit gate. 

A composed gate which fixes some parameters of another gate. 

A composed gate which fixes some parameters of another gate. 

The U2 single qubit gate. 

The U3 single qubit gate. 

The U8 single qutrit gate. 

A Variable nqudit unitary operator. 
Composed Gates
An arbitrary controlled gate. 

An arbitrary inverted gate. 

An embedding of a gate into a higherdimensional qudit gate. 

A composed gate which fixes some parameters of another gate. 

The TaggedGate Class. 

Gate that can multiplex multiple placements of another gate. 
Special Gates
The CircuitGate class. 

Pseudogate to hold measurement information. 

Pseudogate to reset/initialize the qudit to 0>. 

Pseudogate to force break partitioning algorithms. 
Gate Base Classes
A gate composed of other gates. 

A gate that only acts on qubits. 

A gate that only acts on qutrits. 

A gate that acts on qudits, all with the same level. 

A gate that does not change during circuit instantiation. 

An abstract base class for gates that parameterize any unitary. 