Work with Amazon Braket - Amazon Braket

Work with Amazon Braket

This section shows you how to design quantum circuits and annealing problems, submit these problems as tasks to devices, and monitor the tasks with the Amazon Braket SDK.

The main ways to interact with resources on Amazon Braket are by means of:

  • the Amazon Braket Console — The Amazon Braket console provides device information and status to help you create, manage, and monitor your resources and tasks.

  • the Amazon Braket SDK — You can submit and run quantum tasks through the Amazon Braket Python SDK as well as through the console. The SDK is easily accessible through preconfigured Amazon Braket notebooks.

  • the Amazon Braket API — The Amazon Braket API is accessible through the Amazon Braket Python SDK and notebooks. You can make calls directly to the API if you’re building applications that work with quantum computing programmatically.

The examples throughout this section demonstrate how you can work with the Amazon Braket API directly, using the Amazon Braket Python SDK along with the AWS Python SDK for Braket (Boto3).

More about the Amazon Braket Python SDK

To work with the Amazon Braket Python SDK, first you must install the AWS Python SDK for Braket (Boto3) so that you can communicate with the AWS API. You can think of the Amazon Braket Python SDK as a convenient wrapper around Boto3, for quantum customers.

  • Boto3 contains interfaces you’ll need to tap into the AWS API. (Note that Boto3 is a large Python SDK that talks to the AWS API. Most AWS services support a Boto3 interface.)

  • The Amazon Braket Python SDK contains software modules for circuits, gates, devices, result types, and other parts of a quantum task. Each time you create a program, you’ll import the modules you need for that task.

  • The Amazon Braket Python SDK is easily accessible through notebooks, which are pre-loaded with all of the modules and dependencies you need for running quantum tasks.

  • You can import modules from the Amazon Braket Python SDK into any Python script, if you do not wish to work with notebooks.

After you’ve installed Boto3, an overview of steps for creating a task through the Amazon Braket Python SDK is something like this:

  • (Optionally) Open your notebook

  • Import the SDK modules you need for your circuits

  • Specify a QPU or simulator

  • Instantiate the circuit

  • Run the circuit

  • Collect the results

The examples in this section show details of each step.

Many more examples are available in the Amazon Braket Examples repository on GitHub.