How to authenticate with Amazon Braket Credentials

Authenticating to use Amazon Braket IonQ backends

Amazon Web Services (AWS) has a platform for accessing different quantum devices: Amazon Braket. This guide explains how to use your Amazon Braket access with Fire Opal to access IonQ devices.

In this guide, you will learn how to:

  1. Allow Fire Opal to use AWS Braket on your behalf.
  2. Access IonQ backends available in Amazon Braket through Fire Opal.

1. Set up Amazon Braket and create a cross-account IAM role

Fire Opal supports IonQ backends on Amazon Braket. To access these devices, you will need to set up an AWS account with access to Braket, if you don’t have one already. You can follow the steps in this set up guide if you are an AWS administrator. Contact your AWS administrator if you have a managed account.

After setting up your AWS account to access Braket, you will need to create a cross-account IAM role to allow Fire Opal to use Braket on your behalf. You can visit the IAM create role page and go through the following steps:

  • Select AWS Account for Trusted entity type.
  • Select Another AWS account and type 522814692014.
  • Select Require external ID and type in your Q-CTRL organization ID, accessible at Q-CTRL Accounts.
  • Click Next.
  • Check the AmazonBraketFullAccess policy for Add permissions.
  • Click Next.
  • Enter a role name for Role details and keep note of it as you will use it later.
  • Click Create role.

2. Configure Fire Opal and access IonQ backends

To use Fire Opal within your local development environment or the Braket console you can authenticate using an API key.

# % pip install fire-opal qiskit
import fireopal as fo

api_key = "YOUR_QCTRL_API_KEY"
fo.authenticate_qctrl_account(api_key=api_key)

If you are a member of multiple organizations, you must specify your organization_slug, which is the unique name used to identify the organization with access to Fire Opal. Otherwise, you can skip this step. You can check organization details by visiting Q-CTRL Accounts.

fo.config.configure_organization("org_slug")

You can use the function make_credentials_for_braket to generate the credentials dictionary needed to execute jobs.

arn = "your_role_arn"
credentials = fo.credentials.make_credentials_for_braket(arn=arn)

No additional configuration or adjustments are required, just focus on your use case while Fire Opal handles the rest.

from fireopal import print_package_versions

print_package_versions()
| Package               | Version |
| --------------------- | ------- |
| Python                | 3.10.14 |
| networkx              | 2.8.8   |
| numpy                 | 1.26.4  |
| sympy                 | 1.12    |
| fire-opal             | 8.3.0   |
| qctrl-workflow-client | 5.3.1   |

Was this useful?

cta background

New to Fire Opal?

Get access to everything you need to automate and optimize quantum hardware performance at scale.