Define the environment for your algorithm script - Amazon Braket

Learn the foundations of quantum computing with AWS! Enroll in the Amazon Braket Digital Learning Plan and earn your own Digital badge after completing a series of learning courses and a digital assessment.

Define the environment for your algorithm script

Amazon Braket supports three environments defined by containers for your algorithm script:

  • A base container (the default, if no image_uri is specified)

  • A container with Tensorflow and PennyLane

  • A container with PyTorch and PennyLane

The following table provides details about the containers and the libraries they include.

Amazon Braket containers
Type PennyLane with TensorFlow PennyLane with PyTorch Pennylane

Base

292282985366.dkr.ecr.us-east-1.amazonaws.com/amazon-braket-tensorflow-jobs:latest

292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-pytorch-jobs:latest

292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-base-jobs:latest

Inherited Libraries

  • awscli

  • numpy

  • pandas

  • scipy

  • awscli

  • numpy

  • pandas

  • scipy

Additional Libraries

  • amazon-braket-default-simulator

  • amazon-braket-pennylane-plugin

  • amazon-braket-schemas

  • amazon-braket-sdk

  • ipykernel

  • keras

  • matplotlib

  • networkx

  • openbabel

  • PennyLane

  • protobuf

  • psi4

  • rsa

  • PennyLane-Lightning-gpu

  • cuQuantum

  • amazon-braket-default-simulator

  • amazon-braket-pennylane-plugin

  • amazon-braket-schemas

  • amazon-braket-sdk

  • ipykernel

  • keras

  • matplotlib

  • networkx

  • openbabel

  • PennyLane

  • protobuf

  • psi4

  • rsa

  • PennyLane-Lightning-gpu

  • cuQuantum

  • amazon-braket-default-simulator

  • amazon-braket-pennylane-plugin

  • amazon-braket-schemas

  • amazon-braket-sdk

  • awscli

  • boto3

  • ipykernel

  • matplotlib

  • networkx

  • numpy

  • openbabel

  • pandas

  • PennyLane

  • protobuf

  • psi4

  • rsa

  • scipy

You can view and access the open source container definitions at aws/amazon-braket-containers. Choose the container that best matches your use case. The container must be in the AWS Region from which you invoke your hybrid job. You specify the container image when you create a hybrid job by adding one of the following three arguments to your create(…​) call in the hybrid job script. You can install additional dependencies into the container you choose at runtime (at the cost of startup or runtime) because the Amazon Braket containers have internet connectivity. The following example is for the us-west-2 Region.

  • Base image image_uri="292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-base-jobs:1.0-cpu-py39-ubuntu22.04"

  • Tensorflow image image_uri="292282985366.dkr.ecr.us-east-1.amazonaws.com/amazon-braket-tensorflow-jobs:2.11.0-gpu-py39-cu112-ubuntu20.04"

  • PyTorch image image_uri="292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-pytorch-jobs:1.13.1-gpu-py39-cu117-ubuntu20.04"

The image-uris can also be retrieved using the retrieve_image() function in the Amazon Braket SDK. The following example shows how to retrieve them from the us-west-2 AWS Region.

from braket.jobs.image_uris import retrieve_image, Framework image_uri_base = retrieve_image(Framework.BASE, "us-west-2") image_uri_tf = retrieve_image(Framework.PL_TENSORFLOW, "us-west-2") image_uri_pytorch = retrieve_image(Framework.PL_PYTORCH, "us-west-2")