Skip to content

bloqade.analog.task.batch.RemoteBatch

← Module overview

classRemoteBatchsource

bloqade.analog.task.batch.RemoteBatch

Bases: Serializable, Filter

Signature
class RemoteBatch(source: Builder, tasks: Union[OrderedDict[int, QuEraTask], OrderedDict[int, BraketTask]], name: Optional[str] = None)

Parameters

NameTypeDefaultDescription
sourceBuilderrequired
tasksUnion[OrderedDict[int, QuEraTask], OrderedDict[int, BraketTask]]required
nameOptional[str]None

Attributes

NameTypeDefaultDescription
sourceBuilderrequired
tasksUnion[OrderedDict[int, QuEraTask], OrderedDict[int, BraketTask]]required
nameOptional[str]None

propertytotal_nshotssource

bloqade.analog.task.batch.RemoteBatch.total_nshots

total_nshots

Total number of shots of all tasks in the RemoteBatch

source

methodcancelsource

bloqade.analog.task.batch.RemoteBatch.cancel

def cancel() -> RemoteBatch

Cancel all the tasks in the Batch.

Returns

RemoteBatch

Return

self

source

methodfetchsource

bloqade.analog.task.batch.RemoteBatch.fetch

def fetch() -> RemoteBatch

Fetch the tasks in the Batch.

Returns

RemoteBatch

Note

Fetching will update the status of tasks, and only pull the results for those tasks that have completed.

Return

self

source

methodretrievesource

bloqade.analog.task.batch.RemoteBatch.retrieve

def retrieve() -> RemoteBatch

Retrieve missing task results.

Returns

RemoteBatch

Note

Retrieve will update the status of tasks, and only pull the results for those tasks that have completed.

Return

self

source

methodpullsource

bloqade.analog.task.batch.RemoteBatch.pull

def pull() -> RemoteBatch

Pull results of the tasks in the Batch.

Returns

RemoteBatch

Note

Pulling will pull the results for the tasks. If a given task(s) has not been completed, wait until it finished.

Return

self

source

methodtasks_metricsource

bloqade.analog.task.batch.RemoteBatch.tasks_metric

def tasks_metric() -> pd.DataFrame

Get current tasks status metric

Returns

pd.DataFrame

Return

dataframe with [“task id”, “status”, “shots”]

source

methodremove_invalid_taskssource

bloqade.analog.task.batch.RemoteBatch.remove_invalid_tasks

def remove_invalid_tasks() -> RemoteBatch

Create a RemoteBatch object that contain tasks from current Batch, with all Unaccepted tasks removed.

Returns

RemoteBatch

Return

RemoteBatch

source

methodresubmitsource

bloqade.analog.task.batch.RemoteBatch.resubmit

def resubmit(shuffle_submit_order: bool = True) -> RemoteBatch

Resubmit all the tasks in the RemoteBatch

Parameters

NameTypeDefaultDescription
shuffle_submit_orderboolTrue

Returns

RemoteBatch

Return

self

source

methodget_taskssource

bloqade.analog.task.batch.RemoteBatch.get_tasks

def get_tasks(*status_codes: str = ()) -> RemoteBatch

Get Tasks with specify status_codes.

Parameters

NameTypeDefaultDescription
*status_codesstr()

Returns

RemoteBatch

Return

RemoteBatch

source

methodremove_taskssource

bloqade.analog.task.batch.RemoteBatch.remove_tasks

Signature
def remove_tasks(*status_codes: Literal['Created', 'Running', 'Completed', 'Failed', 'Cancelled', 'Executing', 'Enqueued', 'Accepted', 'Unaccepted', 'Partial', 'Unsubmitted'] = ()) -> RemoteBatch

Remove Tasks with specify status_codes.

Parameters

NameTypeDefaultDescription
*status_codesLiteral['Created', 'Running', 'Completed', 'Failed', 'Cancelled', 'Executing', 'Enqueued', 'Accepted', 'Unaccepted', 'Partial', 'Unsubmitted']()

Returns

RemoteBatch

Return

RemoteBatch

source

methodget_failed_taskssource

bloqade.analog.task.batch.RemoteBatch.get_failed_tasks

def get_failed_tasks() -> RemoteBatch

Create a RemoteBatch object that contain failed tasks from current Batch.

failed tasks with following status codes:

  1. Failed
  2. Unaccepted

Returns

RemoteBatch

Return

RemoteBatch

source

methodremove_failed_taskssource

bloqade.analog.task.batch.RemoteBatch.remove_failed_tasks

def remove_failed_tasks() -> RemoteBatch

Create a RemoteBatch object that contain tasks from current Batch, with failed tasks removed.

failed tasks with following status codes:

  1. Failed
  2. Unaccepted

Returns

RemoteBatch

Return

RemoteBatch

source

methodget_finished_taskssource

bloqade.analog.task.batch.RemoteBatch.get_finished_tasks

def get_finished_tasks() -> RemoteBatch

Create a RemoteBatch object that contain finished tasks from current Batch.

Tasks consider finished with following status codes:

  1. Failed
  2. Unaccepted
  3. Completed
  4. Partial
  5. Cancelled

Returns

RemoteBatch

Return

RemoteBatch

source

methodget_completed_taskssource

bloqade.analog.task.batch.RemoteBatch.get_completed_tasks

def get_completed_tasks() -> RemoteBatch

Create a RemoteBatch object that contain completed tasks from current Batch.

Tasks consider completed with following status codes:

  1. Completed
  2. Partial

Returns

RemoteBatch

Return

RemoteBatch

source

methodreportsource

bloqade.analog.task.batch.RemoteBatch.report

def report() -> Report

Generate analysis report base on currently completed tasks in the RemoteBatch.

Returns

Report

Return

Report

source