Skip to content

Execution on Amazon Braket Cloud

The Classiq executor supports execution on Amazon Braket's cloud simulators and hardware.

Tip

Backends may sometimes be unavailable. Check the availability windows with Amazon Braket.

Usage

Execution on Amazon Braket requires an AWS account, and a role that Classiq can assume for execution.

from classiq.execution import AwsBackendPreferences

preferences = AwsBackendPreferences(
    backend_name="Name of requested simulator or hardware",
    aws_role_arn="ARN of the CrossAccountRoleForBraket role",
    s3_bucket_name="S3 bucket name to save the results",
    s3_folder="The folder path within the S3 bucket, where the results will be saved",
    job_timeout="Timeout for execution (Optional)",
)

Opening info tab

Initial Account Setup

Before first use, the Classiq platform needs your permission to connect to your AWS account. This is done by creating a cross-account role.

Classiq provides with the attached CloudFormation AssumeRole.cf.yaml file. It only has the permissions needed for Braket.

To create the cross-account role that only Classiq can use, deploy the CloudFormation file to your account:

  1. Download the AssumeRole.cf.yaml file.
  2. Install AWS CLI.
  3. Contact Classiq support to obtain these parameters:
  4. CORRECT_TRUSTED_ACCOUNT
  5. CORRECT_EXTERNAL_ID_VALUE
  6. Execute this command:
    aws cloudformation create-stack --stack-name ClassiqBraketRole --template-body file://AssumeRole.cf.yaml --capabilities CAPABILITY_NAMED_IAM --parameters ParameterKey=TrustedAccount,ParameterValue=${CORRECT_TRUSTED_ACCOUNT} ParameterKey=ExternalId,ParameterValue=${CORRECT_EXTERNAL_ID_VALUE}
    

Warning

The required parameters may differ between users. Contacting Classiq support is required!

To learn more about IAM roles, refer to the AWS documentation.

Required Credentials

When executing via the Classiq platform using AWS Cloud, there are several required credentials:

  1. aws_role_arn
  2. Make sure the initial setup step is completed.
  3. Go to the AWS Identity and Access Management (IAM) service.
  4. Under Roles, search for the CrossAccountRoleForBraket role.
  5. Copy this role's ARN and use it as the aws_role_arn.
  6. s3_bucket_name
  7. Create a new bucket. Its name must start with amazon-braket-.
  8. Use the bucket name as the s3_bucket_name. This is the bucket that saves the execution results.
  9. s3_folder
  10. Enter the path to the folder in the S3 bucket. This is the path in the bucket where the execution results are saved.

For further support, contact Classiq support.

Supported Backends

The Classiq executor supports any available gate-based Amazon Braket simulator and quantum hardware.

Included hardware:

  • "IonQ device"
  • "Lucy"
  • "Aspen-11"
  • "Aspen-M-1"

Included simulators:

  • "SV1"
  • "TN1"
  • "dm1"