bloqade.pyqrack.target.PyQrack
← Module overview
class
method
sourcemethod
source
classPyQrack¶source
bloqade.pyqrack.target.PyQrack
PyQrack target runtime for Bloqade.
Signature
class PyQrack(min_qubits: int = 0, dynamic_qubits: bool = False, pyqrack_options: PyQrackOptions = _default_pyqrack_args())Parameters
| Name | Type | Default | Description |
|---|---|---|---|
min_qubits | int | 0 | |
dynamic_qubits | bool | False | |
pyqrack_options | PyQrackOptions | _default_pyqrack_args() |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
min_qubits | int | 0 | Minimum number of qubits required for the PyQrack simulator. Useful when address analysis fails to determine the number of qubits. |
dynamic_qubits | bool | False | Whether to use dynamic qubit allocation. Cannot use with tensor network simulations. |
pyqrack_options | PyQrackOptions | field(default_factory=_default_pyqrack_args) | Options to pass to the QrackSimulator object, node `qubitCount` will be overwritten. |
methodrun¶source
bloqade.pyqrack.target.PyQrack.run
Signature
def run(mt: ir.Method[Params, RetType], *args: Params.args = (), **kwargs: Params.kwargs = {}) -> RetTypeRun the given kernel method on the PyQrack simulator.
Args mt (Method): The kernel method to run.
Returns The result of the kernel method, if any.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
mt | ir.Method[Params, RetType] | required | |
*args | Params.args | () | |
**kwargs | Params.kwargs | {} |
Returns
RetType
methodmulti_run¶source
bloqade.pyqrack.target.PyQrack.multi_run
Signature
def multi_run(mt: ir.Method[Params, RetType], _shots: int, *args: Params.args = (), **kwargs: Params.kwargs = {}) -> List[RetType]Run the given kernel method on the PyQrack _shots times, caching analysis results.
Args mt (Method): The kernel method to run. _shots (int): The number of times to run the kernel method.
Returns List of results of the kernel method, one for each shot.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
mt | ir.Method[Params, RetType] | required | |
_shots | int | required | |
*args | Params.args | () | |
**kwargs | Params.kwargs | {} |
Returns
List[RetType]