Index
BitType
module-attribute
BitType = PyClass(Bit)
Kirin type for a classical bit.
CRegType
module-attribute
CRegType = PyClass(CReg)
Kirin type for a classical register.
QRegType
module-attribute
QRegType = PyClass(QReg)
Kirin type for a quantum register.
QubitType
module-attribute
QubitType = PyClass(Qubit)
Kirin type for a qubit.
CRegEq
Bases: Statement
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
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
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
Measure a qubit and store the result in a bit.
carg
class-attribute
instance-attribute
carg: SSAValue = argument(BitType)
carg (Bit): The bit to store the result in.
qarg
class-attribute
instance-attribute
qarg: SSAValue = argument(QubitType)
qarg (Qubit): The qubit to measure.
QRegGet
Bases: Statement
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
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
Reset a qubit to the |0> state.
qarg
class-attribute
instance-attribute
qarg: SSAValue = argument(QubitType)
qarg (Qubit): The qubit to reset.