braket.strawberryfields_plugin.braket_job module

class braket.strawberryfields_plugin.braket_job.BraketJob(task: AwsQuantumTask, device: Device)[source]

Bases: object

Wraps an Amazon Braket task to be compatible with the xcc.Job API.

Parameters:

task (AwsQuantumTask) – The underlying Braket task

property task

The underling Braket quantum task.

Type:

AwsQuantumTask

property id: str

The ID of the underlying Braket task.

Type:

str

property status: str

The status of the job.

This is the XCC status corresponding to the underlying Braket task’s status

Type:

str

property target: str

The target device

Type:

str

property overview: Mapping[str, Any]

mapping from field names to values for this job.

Includes the fields “id”, “status”, “target”, “language”, “created_at”, “finished_at”, “running_time”, and “metadata”.

Type:

Mapping[str, Any]

property created_at: datetime

The time at which the job was created.

Type:

datetime

property finished_at: datetime | None

The time at which the job completed.

Returns None if the job is not completed yet.

Type:

Optional[datetime]

property running_time: timedelta | None

The total runtime of the job, from creation to completion.

Returns None if the job is not completed yet.

Type:

Optional[timedelta]

property finished: bool

Whether the task is in a terminal state, namely {COMPLETED, CANCELLED, FAILED}

Type:

bool

property circuit: str

The compiled Blackbird circuit that was run for this job.

Notes

This is only available after the underlying task is completed.

Type:

str

property metadata: Mapping[str, Any]

The Braket metadata associated with the underlying task.

Type:

Mapping[str, Any]

property result: Mapping[str, ndarray | List[ndarray]] | None

The result of the job.

The dict has an “output” key associated with a list of NumPy arrays representing the output of the job. Returns None if the job failed or timed out.

Type:

Optional[Mapping[str, Union[np.ndarray, List[np.ndarray]]]]

cancel() None[source]

Cancel the underlying Braket task.