python v1.82

Amazon-braket-sdk

Unified SDK for quantum computing on Amazon Braket

Quick install

pip install amazon-braket-sdk

Background and History

The Amazon Braket SDK is the open-source Python client library for Amazon Braket, AWS’s fully managed quantum computing service. Amazon Braket was announced at AWS re:Invent in December 2019 and reached general availability in August 2020. AWS developed the service as a hardware-agnostic cloud platform, providing unified access to quantum processors from multiple vendors rather than building its own quantum hardware. The SDK was open-sourced from the beginning, with its repository hosted under the amazon-braket GitHub organization.

The SDK’s design reflects AWS’s approach to cloud services: it handles authentication, job submission, result storage (via S3), and asynchronous task management through familiar AWS patterns. The Circuit class supports fluent method chaining for gate construction, and FreeParameter objects enable parameterized circuits for variational algorithms. The SDK wraps both gate-model circuit execution and analog Hamiltonian simulation, which is used for QuEra’s neutral atom processor.

At launch, Amazon Braket provided access to Rigetti’s superconducting processors, IonQ’s trapped-ion systems, and D-Wave’s quantum annealers. AWS subsequently added Oxford Quantum Circuits (OQC), IQM’s superconducting hardware, and QuEra’s Aquila neutral atom processor. Managed simulators (SV1 for statevector, DM1 for density matrix, TN1 for tensor networks) run on AWS infrastructure, while the local simulator package allows development without cloud costs or credentials. The Hybrid Jobs feature, introduced in 2021, provides managed classical compute instances co-located with quantum hardware for running iterative optimization loops.

As of 2025, the Amazon Braket SDK is actively maintained with regular releases. It has a moderate open-source community, with adoption concentrated among organizations already operating within the AWS ecosystem. The SDK integrates with PennyLane (via the pennylane-braket plugin) and pytket (via pytket-braket), making it accessible from multiple programming paradigms.

The Amazon Braket SDK provides a single Circuit class for composing gate-based quantum circuits that can run on any Braket-supported backend. Gates are added with fluent chaining (circuit.h(0).cnot(0, 1).measure_all()), and parametric circuits are supported through FreeParameter objects, enabling variational algorithms without recompiling the full circuit for each parameter set. The SDK also supports pulse-level control for advanced users who need direct access to hardware waveforms.

Braket offers several managed simulators: SV1 (statevector, up to 34 qubits, fully managed on AWS), DM1 (density matrix with noise, up to 17 qubits), and TN1 (tensor network, up to 50 qubits for low-entanglement circuits). For local development, LocalSimulator runs the same simulation methods on your machine without cloud costs. Hardware access covers superconducting processors from Rigetti, trapped-ion systems from IonQ, superconducting systems from OQC, and neutral-atom processors from QuEra, all accessed through the same AwsDevice interface.

Hybrid Jobs is Braket’s managed execution environment for classical-quantum loops such as VQE and QAOA. It runs your Python training script on an AWS instance co-located with the quantum backend, reducing round-trip latency and handling checkpointing, metrics logging, and job monitoring automatically. Cost tracking is built into the SDK: each task returns a cost estimate, and per-shot and per-task pricing is surfaced directly. This makes Braket a practical choice for teams that already operate in AWS and need reproducible, auditable quantum experiments.

Key Imports

from braket.circuits import Circuit, FreeParameter, Gate, Observable
from braket.devices import LocalSimulator
from braket.aws import AwsDevice, AwsQuantumTask
from braket.circuits.noise_model import NoiseModel
from braket.circuits.noises import BitFlip, Depolarizing

Core Classes

Circuit is the primary object for building gate-model quantum programs. Gates are added via fluent method chaining, and the circuit handles qubit allocation, gate scheduling, and result type registration automatically.

LocalSimulator runs circuits on your local machine without AWS credentials or cloud costs. It supports statevector ("default"), density matrix ("braket_dm"), and other simulation backends. Ideal for development and testing.

AwsDevice represents a remote quantum device or managed simulator on Amazon Braket. You select a device by its ARN (Amazon Resource Name) and submit circuits to it. The same interface works for IonQ, Rigetti, OQC, QuEra, and the managed simulators SV1, DM1, and TN1.

AwsQuantumTask is the handle for a submitted quantum job. Tasks execute asynchronously; you can poll for completion or call .result() to block until results are available. Results include measurement counts, statevectors (for simulators), and metadata like shot count and execution duration.

FreeParameter enables parameterized circuits for variational algorithms. You define symbolic parameters in the circuit, then bind concrete values at execution time without rebuilding the circuit object.

Observable defines Hermitian operators for computing expectation values as result types, supporting Pauli operators and their tensor products.

Common Patterns

Bell state on LocalSimulator

A minimal example that creates a Bell state, runs it on the local simulator, and prints measurement counts.

from braket.circuits import Circuit
from braket.devices import LocalSimulator

# Build a Bell circuit
circuit = Circuit().h(0).cnot(0, 1)

# Run on local simulator
device = LocalSimulator()
result = device.run(circuit, shots=1000).result()

# Print measurement counts
counts = result.measurement_counts
print(counts)  # e.g. Counter({'00': 503, '11': 497})

Parameterized circuit (VQE-style)

Parameterized circuits let you define a circuit template once and sweep over parameter values, which is essential for variational algorithms like VQE and QAOA.

from braket.circuits import Circuit, FreeParameter
from braket.devices import LocalSimulator
import numpy as np

# Define free parameters
theta = FreeParameter("theta")
phi = FreeParameter("phi")

# Build a parameterized ansatz
circuit = Circuit()
circuit.rx(0, theta)
circuit.ry(1, phi)
circuit.cnot(0, 1)

# Bind specific values and run
device = LocalSimulator()

for t_val, p_val in [(0.5, 1.2), (1.0, 0.3), (np.pi, np.pi / 2)]:
    bound_circuit = circuit.make_bound_circuit({"theta": t_val, "phi": p_val})
    result = device.run(bound_circuit, shots=1000).result()
    print(f"theta={t_val:.2f}, phi={p_val:.2f} -> {result.measurement_counts}")

Cloud execution on IonQ or Rigetti

Running on real hardware uses the same circuit object. You specify the device by its ARN and submit with device.run(). The call returns an AwsQuantumTask that resolves when the hardware finishes execution.

from braket.circuits import Circuit
from braket.aws import AwsDevice

# Build circuit
circuit = Circuit().h(0).cnot(0, 1)

# Select a hardware device (IonQ Aria example)
device = AwsDevice("arn:aws:braket:us-east-1::device/qpu/ionq/Aria-1")

# Submit and wait for results
task = device.run(circuit, shots=1000)
result = task.result()

print(result.measurement_counts)

Note: cloud execution requires valid AWS credentials, an active Amazon Braket subscription, and incurs per-task and per-shot costs. Check the Amazon Braket pricing page before submitting jobs.

Noise model simulation

The density matrix simulator (DM1 locally, or the managed DM1 on AWS) supports noise models. You can attach noise channels to specific gates or apply them globally.

from braket.circuits import Circuit
from braket.circuits.noise_model import NoiseModel, GateCriteria
from braket.circuits.noises import BitFlip, Depolarizing
from braket.devices import LocalSimulator

# Define a noise model
noise_model = NoiseModel()
noise_model.add_noise(Depolarizing(probability=0.01), GateCriteria(Gate.H))
noise_model.add_noise(BitFlip(probability=0.05), GateCriteria(Gate.CX))

# Build circuit
circuit = Circuit().h(0).cnot(0, 1)

# Run on the local density matrix simulator with noise
device = LocalSimulator("braket_dm")
result = device.run(circuit, shots=1000).result()

print(result.measurement_counts)

To apply the noise model globally, pass it when constructing the local simulator or attach it to the circuit before submission.

Analog Hamiltonian Simulation (QuEra Aquila)

Amazon Braket supports analog Hamiltonian simulation for QuEra’s neutral atom hardware. Instead of gates, you define atom positions and time-dependent driving fields that control the Rydberg Hamiltonian.

from braket.ahs import AnalogHamiltonianSimulation, AtomArrangement, DrivingField
from braket.timings import TimeSeries
from braket.devices import LocalSimulator

# Define atom positions (2D array in micrometers)
register = AtomArrangement()
register.add([0.0, 0.0])
register.add([0.0, 6.0e-6])
register.add([6.0e-6, 0.0])

# Define a driving field with time-dependent Rabi frequency and detuning
omega = TimeSeries()
omega.put(0.0, 0.0)
omega.put(1e-6, 2.5e6)
omega.put(3e-6, 2.5e6)
omega.put(4e-6, 0.0)

delta = TimeSeries()
delta.put(0.0, -5e6)
delta.put(4e-6, 5e6)

drive = DrivingField(amplitude=omega, phase=TimeSeries.constant(0.0, 4e-6), detuning=delta)

# Build and run the AHS program
ahs_program = AnalogHamiltonianSimulation(register=register, hamiltonian=drive)

device = LocalSimulator("braket_ahs")
result = device.run(ahs_program, shots=100).result()
print(result.measurements)

Amazon Braket vs Other Cloud Platforms

Amazon Braket, IBM Quantum, Azure Quantum, and Google Cloud Quantum AI each take a different approach to cloud quantum computing. IBM Quantum provides direct access to its own superconducting processors and is tightly integrated with Qiskit; it offers the largest fleet of publicly accessible quantum hardware and a mature job queue system. Azure Quantum follows a multi-vendor model similar to Braket, providing access to IonQ, Quantinuum, and others through a unified interface, with deep integration into the Azure ecosystem and support for Q# alongside Python SDKs. Google Cloud Quantum AI focuses on Cirq and its own superconducting processors, with strong ties to TensorFlow Quantum for quantum machine learning workflows.

Braket is the natural choice for teams already invested in AWS infrastructure. Its strengths include seamless integration with S3, IAM, and CloudWatch; the Hybrid Jobs feature for managed classical-quantum optimization loops; and access to a broad set of hardware vendors (IonQ, Rigetti, OQC, QuEra) from a single SDK. If your primary goal is comparing performance across different hardware architectures, or you need managed execution environments for iterative variational algorithms, Braket provides a clean workflow for that. Teams not tied to a specific cloud provider should evaluate based on which hardware backends matter most for their use case and which SDK ecosystem they prefer to work in.

Learning Resources