Skip to main content

Amazon Braket Default Simulator

Latest Version Supported Python Versions Build status codecov Documentation Status

The Amazon Braket Default Simulator is a Python open source library that provides an implementation of a quantum simulator that you can run locally. You can use the simulator to test quantum tasks that you construct for the Amazon Braket SDK before you submit them to the Amazon Braket service for execution.

Setting up Amazon Braket Default Simulator Python

You must have the Amazon Braket SDK installed to use the local simulator. Follow the instructions in the README for setup.

Checking the version of the default simulator

You can check your currently installed version of amazon-braket-default-simulator with pip show:

pip show amazon-braket-default-simulator

or alternatively from within Python:

>>> from braket import default_simulator
>>> default_simulator.__version__

Usage

The quantum simulator implementations StateVectorSimulator and DensityMatrixSimulator plug into the LocalSimulator interface in Amazon Braket SDK, with the backend parameters as "braket_sv" and "braket_dm", respectively. Alternatively, to use StateVectorSimulator, you can instantiate LocalSimulator with no arguments or with backend="default":

Executing a circuit using the default simulator

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

device = LocalSimulator()

bell = Circuit().h(0).cnot(0, 1)
print(device.run(bell, shots=100).result().measurement_counts)

Documentation

Detailed documentation, including the API reference, can be found on Read the Docs

To generate the API Reference HTML in your local environment

First, install tox:

pip install tox

To generate the HTML, first change directories (cd) to position the cursor in the amazon-braket-default-simulator-python directory. Then, run the following command to generate the HTML documentation files:

tox -e docs

To view the generated documentation, open the following file in a browser: ../amazon-braket-default-simulator-python/build/documentation/html/index.html

Testing

If you want to contribute to the project, be sure to run unit tests and get a successful result before you submit a pull request. To run the unit tests, first install the test dependencies using the following command:

pip install -e "amazon-braket-default-simulator-python[test]"

To run the unit tests:

tox -e unit-tests

You can also pass in various pytest arguments to run selected tests:

tox -e unit-tests -- your-arguments

For more information, please see pytest usage.

To run linters and doc generators and unit tests:

tox

To run the performance tests:

tox -e performance-tests

These tests will compare the performance of a series of simulator executions for your changes against the latest commit on the main branch. Note: The execution times for the performance tests are affected by the other processes running on the system. In order to get stable results, stop other applications when running these tests.

License

This project is licensed under the Apache-2.0 License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amazon_braket_default_simulator-1.39.9.tar.gz (204.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file amazon_braket_default_simulator-1.39.9.tar.gz.

File metadata

File hashes

Hashes for amazon_braket_default_simulator-1.39.9.tar.gz
Algorithm Hash digest
SHA256 38e1c3a61dcb11736c7ec9f04ea1ae4f5fafb08b6bcd4c3629d4984b6d7be129
MD5 8738b52b4f4bef9de9ee0a73ffc1292b
BLAKE2b-256 14b8ddd91e89636e5d34eea1b15689fdddc3bd1f02137f20b3655ee180f3a989

See more details on using hashes here.

Provenance

The following attestation bundles were made for amazon_braket_default_simulator-1.39.9.tar.gz:

Publisher: publish-to-pypi.yml on amazon-braket/amazon-braket-default-simulator-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file amazon_braket_default_simulator-1.39.9-py3-none-any.whl.

File metadata

File hashes

Hashes for amazon_braket_default_simulator-1.39.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c57b18e74e3636967d59ec562ab4ce5df60e794cca8dc45cb8645960f801c4f3
MD5 1a662f6b7349a4486e4e63bddefd40bf
BLAKE2b-256 57e78e365ab79967d281a2066c0e1b6da68dc578f951f25a8d5e304557b9ac68

See more details on using hashes here.

Provenance

The following attestation bundles were made for amazon_braket_default_simulator-1.39.9-py3-none-any.whl:

Publisher: publish-to-pypi.yml on amazon-braket/amazon-braket-default-simulator-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.40.1.post0

2 files

1.40.1

2 files

1.40.0

2 files

This release

1.39.9 This release

2 files

1.39.8

2 files

1.39.7

2 files

1.39.6

2 files

1.39.5

2 files

1.39.4

2 files

1.39.3

2 files

1.39.2

2 files

1.39.1

2 files

1.39.0

2 files

1.38.1

2 files

1.38.0

2 files

1.37.3

2 files

1.37.2

2 files

1.37.1

2 files

1.37.0

2 files

1.36.1

2 files

1.36.0

2 files

1.35.0

2 files

1.34.1

2 files

1.34.0

2 files

1.33.0

2 files

1.32.2

2 files

1.32.1

2 files

1.32.0

2 files

1.31.8

2 files

1.31.7

2 files

1.31.6

2 files

1.31.4

2 files

1.31.3

2 files

1.31.2

2 files

1.31.0

2 files

1.30.1

2 files

1.30.0

2 files

1.29.0

2 files

1.28.0

2 files

1.27.0

2 files

1.26.7

2 files

1.26.6

2 files

1.26.5

2 files

1.26.4

2 files

1.26.3

2 files

1.26.2

2 files

1.26.1

2 files

1.26.0

2 files

1.25.0

2 files

1.24.1

2 files

1.24.0

2 files

1.23.4

2 files

1.23.3

2 files

1.23.2

2 files

1.23.1

2 files

1.23.0

2 files

1.22.0

2 files

1.21.6

2 files

1.21.5

2 files

1.21.4

2 files

1.21.3

2 files

1.21.2

2 files

1.21.1

2 files

1.21.0

2 files

1.20.6

2 files

1.20.5

2 files

1.20.4

2 files

1.20.3

2 files

1.20.1

2 files

1.20.0.post0

2 files

1.20.0

2 files

1.19.1

2 files

1.19.0.post0

2 files

1.19.0

2 files

1.18.3

2 files

1.18.2

2 files

1.18.1

2 files

1.18.0

2 files

1.17.0

2 files

1.16.0

2 files

1.15.0

2 files

1.14.0.post0

2 files

1.14.0

2 files

1.13.3

2 files

1.13.2

2 files

1.13.1

2 files

1.13.0

2 files

1.12.3

2 files

1.12.2

2 files

1.12.1

2 files

1.12.0

2 files

1.11.5.post0

2 files

1.11.5

2 files

1.11.4

2 files

1.11.3

2 files

1.11.2

2 files

1.11.1

2 files

1.11.0

2 files

1.10.2

2 files

1.10.1.post0

2 files

1.10.1

2 files

1.10.0

2 files

1.9.1

2 files

1.9.0

2 files

1.8.1

2 files

1.8.0

2 files

1.7.2.post0

2 files

1.7.2

2 files

1.7.1

2 files

1.7.0

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1.post2

2 files

1.1.1.post1

2 files

1.1.1.post0

2 files

1.1.1

2 files

1.1.0.post2

2 files

1.1.0.post1

2 files

1.1.0.post0

2 files

1.1.0

2 files

1.0.1.post0

2 files

1.0.1

2 files

1.0.0.post2

2 files

1.0.0.post1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page