Skip to main content

Amazon Braket (SDK) Qrack Simulator

This is an Amazon Braket SDK back end for the open-source unitaryfund/qrack simulator. (PyQrack provides pure Python language bindings from C++ Qrack.) This simulator can be run locally, via either a (vendor-agnostic) OpenCL implementation or a (NVIDIA-specific) CUDA implementation. (CPU-only local simulation is also supported, when compiling and installing Qrack from source.) 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 Qrack Simulator Python

Installing this package will install the Amazon Braket SDK, necessary to use the local simulator. For manual installation of the SDK, follow the instructions in the README for setup.

Checking the version of the Qrack simulator

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

pip show amazon-braket-qrack-simulator

or alternatively from within Python:

>>> from braket import qrack_simulator
>>> qrack_simulator.__version__

Usage

The quantum simulator implementation BraketQrackSimulator plugs into the LocalSimulator interface in Amazon Braket SDK, with the backend parameter as "qrack".

Executing a circuit using the default simulator

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

device = LocalSimulator(backend="qrack")

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

Documentation

BraketQrackSimulator follows a subset of the Amazon Braket SDK default simulator input and output interfaces. Detailed documentation for the default simulator, 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-qrack-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-qrack-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 pytest, if necessary:

pip install pytest

With pytest installed, use this command in the amazon-braket-qrack-simulator-python directory:

pytest .

License

This project is licensed under the Apache-2.0 License.

Metadata

Release files for amazon-braket-qrack-simulator 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amazon-braket-qrack-simulator 0.4.0
File Size Uploaded
amazon_braket_qrack_simulator-0.4.0.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for amazon-braket-qrack-simulator 0.4.0
File Interpreter ABI Platform
amazon_braket_qrack_simulator-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / amazon_braket_qrack_simulator-0.4.0.tar.gz

Download URL amazon_braket_qrack_simulator-0.4.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d232f9f972d34f7f366ffe97564e1d2216b5df4dac6e4507785187d45bf32975
BLAKE2b-256 checksum
How to use checksums
3440b42debd567333008f2902b3fd235910f26fb17e510621628e7de70d40bc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / amazon_braket_qrack_simulator-0.4.0-py3-none-any.whl

Download URL amazon_braket_qrack_simulator-0.4.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
256c259f04de77a2fe599b96f73da4cfc31792312ea8df6da6600f13bf8a34bb
BLAKE2b-256 checksum
How to use checksums
c463198d0e671f3e1dc3e43567b49fe15431cbcec6de07292f76103f10f95cf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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