AWS

This section describes functions which are generic over several types which represent various workflows running on AWS - whether jobs, tasks, or something else.

Braket.arnFunction
arn(j::AwsQuantumJob)

Returns the ARN identifying the job j. This ARN can be used to reconstruct the job after the session that launched it has exited.

arn(j::LocalQuantumJob)

Returns the ARN identifying the job j. This ARN can be used to reconstruct the job after the session that launched it has exited.

arn(t::AwsQuantumTask) -> String

Returns the ARN identifying the task t. This ARN can be used to reconstruct the task after the session that launched it has exited.

Braket.metadataFunction
metadata(j::AwsQuantumJob, ::Val{true})
metadata(j::AwsQuantumJob, ::Val{false})
metadata(j::AwsQuantumJob)

Fetch metadata for job j. If the second argument is ::Val{true}, use previously cached metadata, if available, otherwise fetch it from the Braket service. If the second argument is ::Val{false} (default), do not use previously cached metadata, and fetch fresh metadata from the Braket service.

metadata(t::AwsQuantumTask, ::Val{false})
metadata(t::AwsQuantumTask, ::Val{true})

Fetch metadata for task t. If the second argument is ::Val{true}, use previously cached metadata, if available, otherwise fetch it from the Braket service. If the second argument is ::Val{false} (default), do not use previously cached metadata, and fetch fresh metadata from the Braket service.

Braket.stateFunction
state(j::AwsQuantumJob, ::Val{true})
state(j::AwsQuantumJob, ::Val{false})
state(j::AwsQuantumJob)

Fetch the state for job j. Possible states are "CANCELLED", "FAILED", "COMPLETED", "QUEUED", and "RUNNING". If the second argument is ::Val{true}, use previously cached metadata, if available, otherwise fetch it from the Braket service. If the second argument is ::Val{false} (default), do not use previously cached metadata, and fetch fresh metadata from the Braket service.

state(j::LocalQuantumJob, ::Val{true})
state(j::LocalQuantumJob, ::Val{false})
state(j::LocalQuantumJob)

Fetch the state for job j. Local jobs block until they complete, the state is always "COMPLETED".

state(t::AwsQuantumTask, ::Val{false}) -> String
state(t::AwsQuantumTask, ::Val{true}) -> String
state(t::AwsQuantumTask) -> String

Fetch the state for task t. Possible states are "CANCELLED", "FAILED", "COMPLETED", "QUEUED", and "RUNNING". If the second argument is ::Val{true}, use previously cached metadata, if available, otherwise fetch it from the Braket service. If the second argument is ::Val{false} (default), do not use previously cached metadata, and fetch fresh metadata from the Braket service.

Braket.cancelFunction
cancel(j::AwsQuantumJob)

Cancels the job j.

cancel(t::AwsQuantumTask)

Cancels the task t.

Braket.resultFunction
result(j::AwsQuantumJob; kwargs...)

Download, extract, and deserialize the results of job j. Valid kwargs are:

  • poll_timeout_seconds::Int - the maximum number of seconds to wait while polling for results. Default: 864000
  • poll_interval_seconds::Int - how many seconds to wait between download attempts. Default: 5
result(j::LocalQuantumJob; kwargs...)

Copy, extract, and deserialize the results of local job j.

result(t::AwsQuantumTask)

Fetches the result of task t, if available. Blocks until a result is available, in which case the result is returned, or the task enters a terminal state without a result ("FAILED" or "CANCELLED") or exceeds its its polling timeout (set at task creation), in which case nothing is returned.