October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Run Your First Quantum Circuit on AWS Braket with the SDK

Build and run a two-qubit Bell-state circuit with Amazon Braket’s Python SDK. Start locally, then see what hosted simulators and QPUs require.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can build and run a Bell-state quantum circuit on your own computer with Amazon Braket’s Python SDK—no quantum computer or S3 bucket required. Start with Braket’s local simulator; when you are ready to try an AWS-hosted simulator or QPU, switch the device and provide an S3 output location.

Choose where to run your first circuit

Amazon Braket offers three useful starting points: a simulator running in your Python environment, an AWS-hosted simulator, or a quantum processing unit (QPU) hosted by AWS or a third-party provider. For a first run, use the local simulator. It avoids submitting a cloud task and keeps the initial setup simpler.

As an Amazon Associate I earn from qualifying purchases.

Option Where it runs What you need Important distinction
LocalSimulator Your local Python environment or Braket notebook Braket SDK; no S3 output location Capacity depends on your computer. AWS says its local state-vector simulator can handle up to 25 qubits depending on available hardware.
SV1 AWS-hosted on-demand simulator AWS credentials and permissions, plus an S3 output location AWS documents support for circuits up to 34 qubits; check current device details.
QPU A hosted quantum processor AWS credentials and permissions, S3 output location, and applicable third-party terms Availability, supported operations, and access vary by device.

The Braket notebook environment comes with the SDK installed. For local development, install the Amazon Braket SDK and Boto3 in your Python environment. Cloud execution additionally requires AWS credentials and a user or role with permission to use Braket. Third-party QPU access may require accepting data-transfer terms; AWS says this agreement is not required for local and on-demand simulators. See the Amazon Braket getting-started guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build a Bell-state circuit

A Bell-state circuit uses two qubits. A Hadamard gate, H, puts qubit 0 into a superposition. A controlled-NOT gate, CNOT, uses qubit 0 to control a flip on qubit 1, entangling the pair. When measured, the ideal circuit produces either 00 or 11, each with probability one-half.

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

bell = Circuit().h(0).cnot(0, 1)
print(bell)

This is the circuit used in AWS’s first-circuit guide. Printing it lets you inspect the operations before execution.

Run it locally and read the counts

Run 1,000 measurement shots locally and inspect the resulting counts:

local_sim = LocalSimulator()
result = local_sim.run(bell, shots=1000).result()
counts = result.measurement_counts
print(counts)

AWS’s documentation illustrates output as Counter({'11': 503, '00': 497}). Those numbers are an example, not a guaranteed result. Each shot samples the circuit’s measurement distribution, so repeated runs fluctuate; for this ideal Bell circuit, counts should be concentrated on 00 and 11 and roughly balanced. The 1,000-shot example and illustrative counts come from AWS’s current, undated Developer Guide.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The local simulator executes in your Python or notebook environment. This call does not need an S3 location, and it does not submit a paid hosted Braket task. Local simulation is useful for small prototypes, but the maximum circuit size depends on your machine; AWS gives an estimate of up to 25 qubits for its local state-vector simulator, subject to available hardware. See AWS’s first-circuit guide.

Optional: run the circuit on AWS SV1

To move from a local run to an AWS-hosted simulation, construct an AwsDevice for SV1 and pass an S3 bucket and prefix to run(). Substitute your bucket name and a prefix you want to use for the result data:

from braket.aws import AwsDevice

sv1 = AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1")
result = sv1.run(bell, s3_location=("your-bucket-name", "braket-results"), shots=100).result()
print(result.measurement_counts)

The ARN and 100-shot value follow AWS’s example; device identifiers and documentation may change, so verify the current ARN before running. Hosted task results are stored in S3. If you do not supply a bucket, AWS documents a default bucket naming pattern, but specifying your own destination makes result handling explicit. S3 storage is a separate AWS service and may incur charges. AWS documents SV1 support up to 34 qubits in its first-circuit guide.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Optional: submit to a QPU

A QPU run follows the hosted-task pattern: choose an available QPU device ARN, keep the S3 output location, and submit the circuit. Do not assume every QPU is available in every region or at every time, or that it supports every circuit operation. Before submission, check the device listing for its status, region, availability, and supported operations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Third-party QPU access requires accepting the relevant AWS account terms about data transfer. QPU tasks and shots can incur charges; check current device pricing and your account’s Free Tier eligibility before launching. AWS explains the hosted-device workflow in its first-circuit guide and account terms in its getting-started documentation.

Check cost and preserve results

Local simulation is the low-friction way to learn the SDK without submitting a hosted quantum task. Cloud simulators and QPUs use AWS resources and can incur charges; S3 storage can also be billed separately. Pricing and Free Tier terms change, so consult the Amazon Braket pricing page before using hosted devices. The current pricing page describes one hour per month of on-demand simulator time for the first 12 months under the Free Tier; eligibility and terms apply and may change.

AWS says Braket task IDs and associated metadata are removed after 90 days. Save any results, task records, or metadata you need beyond that period in your own storage. This retention period is stated in AWS’s current, undated Developer Guide.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.