Tutorials
qcr:2606.92486.1

Getting Started with Amazon Braket

This is the hello-world tutorial for Amazon Braket, the recommended starting point for anyone new to building quantum programs on AWS. It walks through preparing a maximally entangled Bell state between two qubits and running the resulting circuit on Braket's local state-vector simulator. Along the way it introduces the core Braket SDK workflow end to end: importing the SDK, constructing a Circuit object by appending gates (a Hadamard to create superposition followed by a CNOT to entangle the two qubits), choosing a device (here the bundled local simulator, which runs on your own machine with no AWS account required), submitting the circuit as a task with a chosen number of shots, and retrieving the measurement results and their probability distribution. Because the two qubits are entangled, the measured outcomes concentrate on the correlated bitstrings 00 and 11, the signature of a Bell state. The tutorial deliberately stays minimal so newcomers can see how circuits, devices, tasks, and results fit together before moving on to cloud simulators, real QPU hardware, and full algorithms. It is the ideal first stop in the Amazon Braket examples collection.
Qubit
Circuit-based
Uploaded 1 day ago
24
Views
GitHub582
Citing this entry? Use this QCR ID
Uploaded by
QL
QCR Librarian

Overview

amazon-braket/amazon-braket-examples
582261
In [ ]:
# --- Setup cell added by QCR (not part of the original tutorial) ---
# Source: amazon-braket/amazon-braket-examples @ 0c0818f315479aab9deebed7e7ed7533ac581923, Apache License 2.0.
# Installs the example's dependencies. If a later cell still reports a missing
# package, restart the runtime/kernel and run again from the top.
%pip install -q amazon-braket-sdk==1.117.3 matplotlib

Getting started with Amazon Braket

In this hello-world tutorial we prepare a maximally entangled Bell state between two qubits. We then run our circuit on a local simulator and obtain the results.

In [1]:
# general imports
import matplotlib.pyplot as plt

%matplotlib inline

# AWS imports: Import Braket SDK modules
from braket.circuits import Circuit
from braket.devices import LocalSimulator

Build a circuit

Let's build a Bell state with two qubits. By calling Circuit() we create an empty circuit, and we can just add gates to the circuit.

In [2]:
# build a Bell state with two qubits. Here 'cnot(control=0, target=1)' can be simplified as 'cnot(0,1)'
bell = Circuit().h(0).cnot(control=0, target=1)

Submit the circuit to the local simulator and obtain the results

Here we submit our circuit to the local simulator and obtain the results.

In [3]:
# set up device
device = LocalSimulator()

# run circuit
result = device.run(bell, shots=1000).result()
# get measurement shots
counts = result.measurement_counts
# print counts
print(counts)
Counter({'11': 506, '00': 494})
In [4]:
# plot using Counter
plt.bar(counts.keys(), counts.values())
plt.xlabel("bitstrings")
plt.ylabel("counts");

Join the Discussion

Comments (0)

No comments yet. Be the first to share your thoughts!

Indexed by QCR Librarian

This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.

Versions

v1 Latest
Jun 17, 2026
qcr:2606.92486.1

Cite all versions? Use the base QCR ID to always reference the latest version of this entry.

Tools used

Amazon Braket SDK

Keywords

getting-started
braket
bell-state
simulation
entanglement

You may also like5