Skip to content

bloqade.device.AbstractRemoteDevice

← Module overview

classAbstractRemoteDevicesource

bloqade.device.AbstractRemoteDevice

Bases: AbstractDevice[RemoteTaskType]

Abstract base class for remote devices.

class AbstractRemoteDevice

methodrunsource

bloqade.device.AbstractRemoteDevice.run

Signature
def run(kernel: ir.Method[Params, RetType], args: tuple[Any, ...] = (), kwargs: dict[str, Any] | None = None, *, shots: int = 1, timeout: float | None = None) -> list[RetType]

Runs the kernel and returns the result.

Parameters

NameTypeDefaultDescription
kernelir.Method[Params, RetType]requiredThe kernel method to run.
argstuple[Any, ...]()Positional arguments to pass to the kernel method.
kwargsdict[str, Any] | NoneNoneKeyword arguments to pass to the kernel method.
shotsint1The number of times to run the kernel method.
timeoutfloat | NoneNoneTimeout in seconds for the asynchronous execution. If None, wait indefinitely.

Returns

list[RetType]The result of the kernel method, if any.

source

methodrun_asyncsource

bloqade.device.AbstractRemoteDevice.run_async

Signature
def run_async(kernel: ir.Method[Params, RetType], args: tuple[Any, ...] = (), kwargs: dict[str, Any] | None = None, *, shots: int = 1) -> BatchFuture[RetType]

Runs the kernel asynchronously and returns a Future object.

Parameters

NameTypeDefaultDescription
kernelir.Method[Params, RetType]requiredThe kernel method to run.
argstuple[Any, ...]()Positional arguments to pass to the kernel method.
kwargsdict[str, Any] | NoneNoneKeyword arguments to pass to the kernel method.
shotsint1The number of times to run the kernel method.

Returns

BatchFuture[RetType]Future[list[RetType]]: The Future for all executions of the kernel method.

source