Braket

2020/08/13 - Braket - 6 new api methods

Changes  Amazon Braket general availability with Device and Quantum Task operations.

SearchQuantumTasks (new) Link ¶

Searches for tasks that match the specified filter values.

See also: AWS API Documentation

Request Syntax

client.search_quantum_tasks(
    filters=[
        {
            'name': 'string',
            'operator': 'BETWEEN'|'EQUAL'|'GT'|'GTE'|'LT'|'LTE',
            'values': [
                'string',
            ]
        },
    ],
    maxResults=123,
    nextToken='string'
)
type filters

list

param filters

[REQUIRED]

Array of SearchQuantumTasksFilter objects.

  • (dict) --

    A filter to use to search for tasks.

    • name (string) -- [REQUIRED]

      The name of the device used for the task.

    • operator (string) -- [REQUIRED]

      An operator to use in the filter.

    • values (list) -- [REQUIRED]

      The values to use for the filter.

      • (string) --

type maxResults

integer

param maxResults

Maximum number of results to return in the response.

type nextToken

string

param nextToken

A token used for pagination of results returned in the response. Use the token returned from the previous request continue results where the previous request ended.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'quantumTasks': [
        {
            'createdAt': datetime(2015, 1, 1),
            'deviceArn': 'string',
            'endedAt': datetime(2015, 1, 1),
            'outputS3Bucket': 'string',
            'outputS3Directory': 'string',
            'quantumTaskArn': 'string',
            'shots': 123,
            'status': 'CANCELLED'|'CANCELLING'|'COMPLETED'|'CREATED'|'FAILED'|'QUEUED'|'RUNNING'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      A token used for pagination of results, or null if there are no additional results. Use the token value in a subsequent request to continue results where the previous request ended.

    • quantumTasks (list) --

      An array of QuantumTaskSummary objects for tasks that match the specified filters.

      • (dict) --

        Includes information about a quantum task.

        • createdAt (datetime) --

          The time at which the task was created.

        • deviceArn (string) --

          The ARN of the device the task ran on.

        • endedAt (datetime) --

          The time at which the task finished.

        • outputS3Bucket (string) --

          The S3 bucket where the task result file is stored..

        • outputS3Directory (string) --

          The folder in the S3 bucket where the task result file is stored.

        • quantumTaskArn (string) --

          The ARN of the task.

        • shots (integer) --

          The shots used for the task.

        • status (string) --

          The status of the task.

SearchDevices (new) Link ¶

Searches for devices using the specified filters.

See also: AWS API Documentation

Request Syntax

client.search_devices(
    filters=[
        {
            'name': 'string',
            'values': [
                'string',
            ]
        },
    ],
    maxResults=123,
    nextToken='string'
)
type filters

list

param filters

[REQUIRED]

The filter values to use to search for a device.

  • (dict) --

    The filter to use for searching devices.

    • name (string) -- [REQUIRED]

      The name to use to filter results.

    • values (list) -- [REQUIRED]

      The values to use to filter results.

      • (string) --

type maxResults

integer

param maxResults

The maximum number of results to return in the response.

type nextToken

string

param nextToken

A token used for pagination of results returned in the response. Use the token returned from the previous request continue results where the previous request ended.

rtype

dict

returns

Response Syntax

{
    'devices': [
        {
            'deviceArn': 'string',
            'deviceName': 'string',
            'deviceStatus': 'QPU'|'SIMULATOR',
            'deviceType': 'OFFLINE'|'ONLINE',
            'providerName': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • devices (list) --

      An array of DeviceSummary objects for devices that match the specified filter values.

      • (dict) --

        Includes information about the device.

        • deviceArn (string) --

          The ARN of the device.

        • deviceName (string) --

          The name of the device.

        • deviceStatus (string) --

          The status of the device.

        • deviceType (string) --

          The type of the device.

        • providerName (string) --

          The provider of the device.

    • nextToken (string) --

      A token used for pagination of results, or null if there are no additional results. Use the token value in a subsequent request to continue results where the previous request ended.

CreateQuantumTask (new) Link ¶

Creates a quantum task.

See also: AWS API Documentation

Request Syntax

client.create_quantum_task(
    action='string',
    clientToken='string',
    deviceArn='string',
    deviceParameters='string',
    outputS3Bucket='string',
    outputS3KeyPrefix='string',
    shots=123
)
type action

string

param action

[REQUIRED]

The action associated with the task.

type clientToken

string

param clientToken

[REQUIRED]

The client token associated with the request.

This field is autopopulated if not provided.

type deviceArn

string

param deviceArn

[REQUIRED]

The ARN of the device to run the task on.

type deviceParameters

string

param deviceParameters

The parameters for the device to run the task on.

type outputS3Bucket

string

param outputS3Bucket

[REQUIRED]

The S3 bucket to store task result files in.

type outputS3KeyPrefix

string

param outputS3KeyPrefix

[REQUIRED]

The key prefix for the location in the S3 bucket to store task results in.

type shots

integer

param shots

[REQUIRED]

The number of shots to use for the task.

rtype

dict

returns

Response Syntax

{
    'quantumTaskArn': 'string'
}

Response Structure

  • (dict) --

    • quantumTaskArn (string) --

      The ARN of the task created by the request.

CancelQuantumTask (new) Link ¶

Cancels the specified task.

See also: AWS API Documentation

Request Syntax

client.cancel_quantum_task(
    clientToken='string',
    quantumTaskArn='string'
)
type clientToken

string

param clientToken

[REQUIRED]

The client token associated with the request.

This field is autopopulated if not provided.

type quantumTaskArn

string

param quantumTaskArn

[REQUIRED]

The ARN of the task to cancel.

rtype

dict

returns

Response Syntax

{
    'cancellationStatus': 'CANCELLED'|'CANCELLING',
    'quantumTaskArn': 'string'
}

Response Structure

  • (dict) --

    • cancellationStatus (string) --

      The status of the cancellation request.

    • quantumTaskArn (string) --

      The ARN of the task.

GetQuantumTask (new) Link ¶

Retrieves the specified quantum task.

See also: AWS API Documentation

Request Syntax

client.get_quantum_task(
    quantumTaskArn='string'
)
type quantumTaskArn

string

param quantumTaskArn

[REQUIRED]

the ARN of the task to retrieve.

rtype

dict

returns

Response Syntax

{
    'createdAt': datetime(2015, 1, 1),
    'deviceArn': 'string',
    'deviceParameters': 'string',
    'endedAt': datetime(2015, 1, 1),
    'failureReason': 'string',
    'outputS3Bucket': 'string',
    'outputS3Directory': 'string',
    'quantumTaskArn': 'string',
    'shots': 123,
    'status': 'CANCELLED'|'CANCELLING'|'COMPLETED'|'CREATED'|'FAILED'|'QUEUED'|'RUNNING'
}

Response Structure

  • (dict) --

    • createdAt (datetime) --

      The time at which the task was created.

    • deviceArn (string) --

      The ARN of the device the task was run on.

    • deviceParameters (string) --

      The parameters for the device on which the task ran.

    • endedAt (datetime) --

      The time at which the task ended.

    • failureReason (string) --

      The reason that a task failed.

    • outputS3Bucket (string) --

      The S3 bucket where task results are stored.

    • outputS3Directory (string) --

      The folder in the S3 bucket where task results are stored.

    • quantumTaskArn (string) --

      The ARN of the task.

    • shots (integer) --

      The number of shots used in the task.

    • status (string) --

      The status of the task.

GetDevice (new) Link ¶

Retrieves the devices available in Amazon Braket.

See also: AWS API Documentation

Request Syntax

client.get_device(
    deviceArn='string'
)
type deviceArn

string

param deviceArn

[REQUIRED]

The ARN of the device to retrieve.

rtype

dict

returns

Response Syntax

{
    'deviceArn': 'string',
    'deviceCapabilities': 'string',
    'deviceName': 'string',
    'deviceStatus': 'QPU'|'SIMULATOR',
    'deviceType': 'OFFLINE'|'ONLINE',
    'providerName': 'string'
}

Response Structure

  • (dict) --

    • deviceArn (string) --

      The ARN of the device.

    • deviceCapabilities (string) --

      Details about the capabilities of the device.

    • deviceName (string) --

      The name of the device.

    • deviceStatus (string) --

      The status of the device.

    • deviceType (string) --

      The type of the device.

    • providerName (string) --

      The name of the partner company for the device.