Stmts
CRegEq
Bases: Statement
flowchart TD
bloqade.qasm2.dialects.core.stmts.CRegEq[CRegEq]
click bloqade.qasm2.dialects.core.stmts.CRegEq href "" "bloqade.qasm2.dialects.core.stmts.CRegEq"
Check if two classical registers are equal.
lhs
class-attribute
instance-attribute
lhs: SSAValue = argument(Int | CRegType | BitType)
lhs (CReg): The first register.
result
class-attribute
instance-attribute
result: ResultValue = result(Bool)
result (bool): True if the registers are equal, False otherwise.
rhs
class-attribute
instance-attribute
rhs: SSAValue = argument(Int | CRegType | BitType)
rhs (CReg): The second register.
CRegGet
Bases: Statement
flowchart TD
bloqade.qasm2.dialects.core.stmts.CRegGet[CRegGet]
click bloqade.qasm2.dialects.core.stmts.CRegGet href "" "bloqade.qasm2.dialects.core.stmts.CRegGet"
Get a bit from a classical register.
idx
class-attribute
instance-attribute
idx: SSAValue = argument(Int)
idx (Int): The index of the bit in the register.
reg
class-attribute
instance-attribute
reg: SSAValue = argument(CRegType)
reg (CReg): The classical register.
result
class-attribute
instance-attribute
result: ResultValue = result(BitType)
result (Bit): The bit at position idx.
CRegNew
Bases: Statement
flowchart TD
bloqade.qasm2.dialects.core.stmts.CRegNew[CRegNew]
click bloqade.qasm2.dialects.core.stmts.CRegNew href "" "bloqade.qasm2.dialects.core.stmts.CRegNew"
Create a new classical register.
n_bits
class-attribute
instance-attribute
n_bits: SSAValue = argument(Int)
n_bits (Int): The number of bits in the register.
result
class-attribute
instance-attribute
result: ResultValue = result(CRegType)
result (CReg): The new classical register with all bits set to 0.
Measure
Bases: Statement
flowchart TD
bloqade.qasm2.dialects.core.stmts.Measure[Measure]
click bloqade.qasm2.dialects.core.stmts.Measure href "" "bloqade.qasm2.dialects.core.stmts.Measure"
Measure a qubit and store the result in a bit.
carg
class-attribute
instance-attribute
carg: SSAValue = argument(BitType | CRegType)
carg (Bit | CReg): The bit or register to store the result in.
qarg
class-attribute
instance-attribute
qarg: SSAValue = argument(QubitType | QRegType)
qarg (Qubit | QReg): The qubit or quantum register to measure.
QRegGet
Bases: Statement
flowchart TD
bloqade.qasm2.dialects.core.stmts.QRegGet[QRegGet]
click bloqade.qasm2.dialects.core.stmts.QRegGet href "" "bloqade.qasm2.dialects.core.stmts.QRegGet"
Get a qubit from a quantum register.
idx
class-attribute
instance-attribute
idx: SSAValue = argument(Int)
idx (Int): The index of the qubit in the register.
reg
class-attribute
instance-attribute
reg: SSAValue = argument(QRegType)
reg (QReg): The quantum register.
result
class-attribute
instance-attribute
result: ResultValue = result(QubitType)
result (Qubit): The qubit at position idx.
QRegNew
Bases: Statement
flowchart TD
bloqade.qasm2.dialects.core.stmts.QRegNew[QRegNew]
click bloqade.qasm2.dialects.core.stmts.QRegNew href "" "bloqade.qasm2.dialects.core.stmts.QRegNew"
Create a new quantum register.
n_qubits
class-attribute
instance-attribute
n_qubits: SSAValue = argument(Int)
n_qubits: The number of qubits in the register.
result
class-attribute
instance-attribute
result: ResultValue = result(QRegType)
A new quantum register with n_qubits set to |0>.
Reset
Bases: Statement
flowchart TD
bloqade.qasm2.dialects.core.stmts.Reset[Reset]
click bloqade.qasm2.dialects.core.stmts.Reset href "" "bloqade.qasm2.dialects.core.stmts.Reset"
Reset a qubit to the |0> state.
qarg
class-attribute
instance-attribute
qarg: SSAValue = argument(QubitType)
qarg (Qubit): The qubit to reset.