# Amazon Braket (SDK) Qrack Simulator
This is an Amazon Braket SDK back end for the open-source [unitaryfund/qrack](https://github.com/unitaryfund/qrack) simulator. ([PyQrack](https://github.com/unitaryfund/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](https://github.com/amazon-braket/amazon-braket-sdk-python) 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](https://github.com/amazon-braket/amazon-braket-sdk-python), necessary to use the local simulator.
For manual installation of the SDK, follow the instructions in the [README](https://github.com/amazon-braket/amazon-braket-sdk-python/blob/main/README.md) for setup.
**Checking the version of the Qrack simulator**
You can check your currently installed version of `amazon-braket-qrack-simulator` with `pip show`:
```bash
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](https://github.com/amazon-braket/amazon-braket-sdk-python), with the `backend` parameter as `"qrack"`.
**Executing a circuit using the default simulator**
```python
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](https://github.com/amazon-braket/amazon-braket-sdk-python) default simulator input and output interfaces. Detailed documentation for the default simulator, including the API reference, can be found on [Read the Docs](https://amazon-braket-default-simulator-python.readthedocs.io/en/latest/).
**To generate the API Reference HTML in your local environment**
First, install tox:
```bash
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:
```bash
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:
```bash
pip install pytest
```
With pytest installed, use this command in the `amazon-braket-qrack-simulator-python` directory:
```bash
pytest .
```
## License
This project is licensed under the Apache-2.0 License.
Raw data
{
"_id": null,
"home_page": "https://github.com/amazon-braket/amazon-braket-qrack-simulator-python",
"name": "amazon-braket-qrack-cuda-simulator",
"maintainer": "",
"docs_url": null,
"requires_python": ">= 3.9",
"maintainer_email": "",
"keywords": "Qrack Amazon AWS Quantum",
"author": "Unitary Fund, Amazon Web Services",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/83/38/cd32618816c21e84159d82fcb77f21de41167bbd086e7e7c7e7639b830fb/amazon-braket-qrack-cuda-simulator-0.3.1.tar.gz",
"platform": null,
"description": "# Amazon Braket (SDK) Qrack Simulator\n\nThis is an Amazon Braket SDK back end for the open-source [unitaryfund/qrack](https://github.com/unitaryfund/qrack) simulator. ([PyQrack](https://github.com/unitaryfund/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](https://github.com/amazon-braket/amazon-braket-sdk-python) before you submit them to the Amazon Braket service for execution.\n\n## Setting up Amazon Braket Qrack Simulator Python\nInstalling this package will install the [Amazon Braket SDK](https://github.com/amazon-braket/amazon-braket-sdk-python), necessary to use the local simulator.\nFor manual installation of the SDK, follow the instructions in the [README](https://github.com/amazon-braket/amazon-braket-sdk-python/blob/main/README.md) for setup.\n\n**Checking the version of the Qrack simulator**\n\nYou can check your currently installed version of `amazon-braket-qrack-simulator` with `pip show`:\n\n```bash\npip show amazon-braket-qrack-simulator\n```\n\nor alternatively from within Python:\n\n```\n>>> from braket import qrack_simulator\n>>> qrack_simulator.__version__\n```\n\n## Usage\nThe quantum simulator implementation `BraketQrackSimulator` plugs into the `LocalSimulator` interface in \n[Amazon Braket SDK](https://github.com/amazon-braket/amazon-braket-sdk-python), with the `backend` parameter as `\"qrack\"`.\n\n**Executing a circuit using the default simulator**\n```python\nfrom braket.circuits import Circuit\nfrom braket.devices import LocalSimulator\n\ndevice = LocalSimulator(backend=\"qrack\")\n\nbell = Circuit().h(0).cnot(0, 1)\nprint(device.run(bell, shots=100).result().measurement_counts)\n```\n\n## Documentation\n\n`BraketQrackSimulator` follows a subset of the [Amazon Braket SDK](https://github.com/amazon-braket/amazon-braket-sdk-python) default simulator input and output interfaces. Detailed documentation for the default simulator, including the API reference, can be found on [Read the Docs](https://amazon-braket-default-simulator-python.readthedocs.io/en/latest/).\n\n**To generate the API Reference HTML in your local environment**\n\nFirst, install tox:\n\n```bash\npip install tox\n```\n\nTo 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:\n\n```bash\ntox -e docs\n```\n\nTo view the generated documentation, open the following file in a browser:\n`../amazon-braket-qrack-simulator-python/build/documentation/html/index.html`\n\n## Testing\n\nIf you want to contribute to the project, be sure to run unit tests and get a successful result \nbefore you submit a pull request. To run the unit tests, first install `pytest`, if necessary:\n\n```bash\npip install pytest\n```\n\nWith pytest installed, use this command in the `amazon-braket-qrack-simulator-python` directory:\n\n```bash\npytest .\n```\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "An open source quantum circuit simulator to be run locally with the Amazon Braket SDK",
"version": "0.3.1",
"project_urls": {
"Homepage": "https://github.com/amazon-braket/amazon-braket-qrack-simulator-python"
},
"split_keywords": [
"qrack",
"amazon",
"aws",
"quantum"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "677173c29d6813ce429052289b9cf86f70a11d85ad2f2d5674011302385de30c",
"md5": "f1bc83d9257f5bde86a86f02276de895",
"sha256": "d739d695d937b03a58332710f841a44a8fe1cab4c5f3d66e10806e9f09e3c85b"
},
"downloads": -1,
"filename": "amazon_braket_qrack_cuda_simulator-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f1bc83d9257f5bde86a86f02276de895",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">= 3.9",
"size": 12361,
"upload_time": "2024-02-27T13:25:15",
"upload_time_iso_8601": "2024-02-27T13:25:15.136281Z",
"url": "https://files.pythonhosted.org/packages/67/71/73c29d6813ce429052289b9cf86f70a11d85ad2f2d5674011302385de30c/amazon_braket_qrack_cuda_simulator-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8338cd32618816c21e84159d82fcb77f21de41167bbd086e7e7c7e7639b830fb",
"md5": "53a6a8131f497746ea271325e9334400",
"sha256": "8db181782f97f1d7bd3809fd72a8d62c939bc15e53d4280268af8ccd6341b76b"
},
"downloads": -1,
"filename": "amazon-braket-qrack-cuda-simulator-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "53a6a8131f497746ea271325e9334400",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">= 3.9",
"size": 11386,
"upload_time": "2024-02-27T13:25:16",
"upload_time_iso_8601": "2024-02-27T13:25:16.662096Z",
"url": "https://files.pythonhosted.org/packages/83/38/cd32618816c21e84159d82fcb77f21de41167bbd086e7e7c7e7639b830fb/amazon-braket-qrack-cuda-simulator-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-27 13:25:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "amazon-braket",
"github_project": "amazon-braket-qrack-simulator-python",
"github_not_found": true,
"lcname": "amazon-braket-qrack-cuda-simulator"
}