Base
DynamicMemory
dataclass
DynamicMemory(
pyqrack_options: PyQrackOptions = _default_pyqrack_args(),
)
Bases: MemoryABC
allocate
allocate(n_qubits: int)
Allocate n_qubits
qubits and return their ids.
Source code in .venv/lib/python3.12/site-packages/bloqade/pyqrack/base.py
128 129 130 131 132 133 |
|
MemoryABC
dataclass
MemoryABC(
pyqrack_options: PyQrackOptions = _default_pyqrack_args(),
)
Bases: ABC
allocate
abstractmethod
allocate(n_qubits: int) -> tuple[int, ...]
Allocate n_qubits
qubits and return their ids.
Source code in .venv/lib/python3.12/site-packages/bloqade/pyqrack/base.py
66 67 68 69 |
|
reset
reset()
Reset the memory, releasing all qubits.
Source code in .venv/lib/python3.12/site-packages/bloqade/pyqrack/base.py
71 72 73 74 75 76 77 |
|
MockMemory
dataclass
MockMemory(
pyqrack_options: PyQrackOptions = _default_pyqrack_args(),
)
Bases: MemoryABC
Mock memory for testing purposes.
allocate
allocate(n_qubits: int)
Allocate n_qubits
qubits and return their ids.
Source code in .venv/lib/python3.12/site-packages/bloqade/pyqrack/base.py
86 87 88 89 90 |
|
reset
reset()
Reset the memory, releasing all qubits.
Source code in .venv/lib/python3.12/site-packages/bloqade/pyqrack/base.py
92 93 94 |
|
PyQrackInterpreter
dataclass
PyQrackInterpreter(
*,
memory: MemoryType,
rng_state: Generator = np.random.default_rng(),
loss_m_result: Measurement = Measurement.One
)
Bases: Interpreter
, Generic[MemoryType]
loss_m_result
class-attribute
instance-attribute
loss_m_result: Measurement = field(
default=One, kw_only=True
)
The value of a measurement result when a qubit is lost.
StackMemory
dataclass
StackMemory(
pyqrack_options: PyQrackOptions = _default_pyqrack_args(),
*,
total: int
)
Bases: MemoryABC
allocate
allocate(n_qubits: int)
Allocate n_qubits
qubits and return their ids.
Source code in .venv/lib/python3.12/site-packages/bloqade/pyqrack/base.py
102 103 104 105 106 107 108 109 110 111 112 113 |
|
reset
reset()
Reset the memory, releasing all qubits.
Source code in .venv/lib/python3.12/site-packages/bloqade/pyqrack/base.py
115 116 117 |
|