bloqade.device.AbstractRemoteDevice
← Module overview
class
method
sourcemethod
source
classAbstractRemoteDevice¶source
bloqade.device.AbstractRemoteDevice
Bases: AbstractDevice[RemoteTaskType]
Abstract base class for remote devices.
class AbstractRemoteDevicemethodrun¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
kernel | ir.Method[Params, RetType] | required | The kernel method to run. |
args | tuple[Any, ...] | () | Positional arguments to pass to the kernel method. |
kwargs | dict[str, Any] | None | None | Keyword arguments to pass to the kernel method. |
shots | int | 1 | The number of times to run the kernel method. |
timeout | float | None | None | Timeout in seconds for the asynchronous execution. If None, wait indefinitely. |
Returns
list[RetType]The result of the kernel method, if any.
methodrun_async¶source
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
| Name | Type | Default | Description |
|---|---|---|---|
kernel | ir.Method[Params, RetType] | required | The kernel method to run. |
args | tuple[Any, ...] | () | Positional arguments to pass to the kernel method. |
kwargs | dict[str, Any] | None | None | Keyword arguments to pass to the kernel method. |
shots | int | 1 | The number of times to run the kernel method. |
Returns
BatchFuture[RetType]Future[list[RetType]]: The Future for all executions of the kernel method.