Skip to content

bloqade.pyqrack.target.PyQrack

← Module overview

classPyQracksource

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

NameTypeDefaultDescription
min_qubitsint0
dynamic_qubitsboolFalse
pyqrack_optionsPyQrackOptions_default_pyqrack_args()

Attributes

NameTypeDefaultDescription
min_qubitsint0Minimum number of qubits required for the PyQrack simulator. Useful when address analysis fails to determine the number of qubits.
dynamic_qubitsboolFalseWhether to use dynamic qubit allocation. Cannot use with tensor network simulations.
pyqrack_optionsPyQrackOptionsfield(default_factory=_default_pyqrack_args)Options to pass to the QrackSimulator object, node `qubitCount` will be overwritten.

methodrunsource

bloqade.pyqrack.target.PyQrack.run

Signature
def run(mt: ir.Method[Params, RetType], *args: Params.args = (), **kwargs: Params.kwargs = {}) -> RetType

Run 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

NameTypeDefaultDescription
mtir.Method[Params, RetType]required
*argsParams.args()
**kwargsParams.kwargs{}

Returns

RetType

source

methodmulti_runsource

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

NameTypeDefaultDescription
mtir.Method[Params, RetType]required
_shotsintrequired
*argsParams.args()
**kwargsParams.kwargs{}

Returns

List[RetType]

source