amazon-braket-default-simulator


Nameamazon-braket-default-simulator JSON
Version 1.23.0 PyPI version JSON
download
home_pagehttps://github.com/amazon-braket/amazon-braket-default-simulator-python
SummaryAn open source quantum circuit simulator to be run locally with the Amazon Braket SDK
upload_time2024-04-22 16:18:56
maintainerNone
docs_urlNone
authorAmazon Web Services
requires_python>=3.9
licenseApache License 2.0
keywords amazon aws quantum
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Amazon Braket Default Simulator

[![Latest Version](https://img.shields.io/pypi/v/amazon-braket-default-simulator.svg)](https://pypi.python.org/pypi/amazon-braket-default-simulator)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/amazon-braket-default-simulator.svg)](https://pypi.python.org/pypi/amazon-braket-default-simulator)
[![Build status](https://github.com/amazon-braket/amazon-braket-default-simulator-python/actions/workflows/python-package.yml/badge.svg)](https://github.com/amazon-braket/amazon-braket-default-simulator-python/actions/workflows/python-package.yml)
[![codecov](https://codecov.io/gh/amazon-braket/amazon-braket-default-simulator-python/branch/main/graph/badge.svg?token=FZEG1AQU3S)](https://codecov.io/gh/amazon-braket/amazon-braket-default-simulator-python)
[![Documentation Status](https://img.shields.io/readthedocs/amazon-braket-default-simulator-python.svg?logo=read-the-docs)](https://amazon-braket-default-simulator-python.readthedocs.io/en/latest/?badge=latest)

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](https://github.com/amazon-braket/amazon-braket-sdk-python)
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](https://github.com/amazon-braket/amazon-braket-sdk-python) installed to use the local simulator.
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 default simulator**

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

```bash
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](https://github.com/amazon-braket/amazon-braket-sdk-python), 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**
```python
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](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-default-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-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:

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

To run the unit tests:

```bash
tox -e unit-tests
```

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

```bash
tox -e unit-tests -- your-arguments
```

For more information, please see [pytest usage](https://docs.pytest.org/en/stable/usage.html).

To run linters and doc generators and unit tests:

```bash
tox
```

To run the performance tests:

```bash
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.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/amazon-braket/amazon-braket-default-simulator-python",
    "name": "amazon-braket-default-simulator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "Amazon AWS Quantum",
    "author": "Amazon Web Services",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/ce/9b/a0f0aab04033660c41a86d01d9aaddaa1577f230819dec3c44b9542aa8c9/amazon_braket_default_simulator-1.23.0.tar.gz",
    "platform": null,
    "description": "# Amazon Braket Default Simulator\n\n[![Latest Version](https://img.shields.io/pypi/v/amazon-braket-default-simulator.svg)](https://pypi.python.org/pypi/amazon-braket-default-simulator)\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/amazon-braket-default-simulator.svg)](https://pypi.python.org/pypi/amazon-braket-default-simulator)\n[![Build status](https://github.com/amazon-braket/amazon-braket-default-simulator-python/actions/workflows/python-package.yml/badge.svg)](https://github.com/amazon-braket/amazon-braket-default-simulator-python/actions/workflows/python-package.yml)\n[![codecov](https://codecov.io/gh/amazon-braket/amazon-braket-default-simulator-python/branch/main/graph/badge.svg?token=FZEG1AQU3S)](https://codecov.io/gh/amazon-braket/amazon-braket-default-simulator-python)\n[![Documentation Status](https://img.shields.io/readthedocs/amazon-braket-default-simulator-python.svg?logo=read-the-docs)](https://amazon-braket-default-simulator-python.readthedocs.io/en/latest/?badge=latest)\n\nThe Amazon Braket Default Simulator is a Python open source library that provides an implementation of a quantum simulator \nthat you can run locally. 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)\nbefore you submit them to the Amazon Braket service for execution.\n\n## Setting up Amazon Braket Default Simulator Python\nYou must have the [Amazon Braket SDK](https://github.com/amazon-braket/amazon-braket-sdk-python) installed to use the local simulator.\nFollow 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 default simulator**\n\nYou can check your currently installed version of `amazon-braket-default-simulator` with `pip show`:\n\n```bash\npip show amazon-braket-default-simulator\n```\n\nor alternatively from within Python:\n\n```\n>>> from braket import default_simulator\n>>> default_simulator.__version__\n```\n\n## Usage\nThe quantum simulator implementations `StateVectorSimulator` and `DensityMatrixSimulator` plug into the `LocalSimulator` interface in \n[Amazon Braket SDK](https://github.com/amazon-braket/amazon-braket-sdk-python), with the `backend` parameters as `\"braket_sv\"` and `\"braket_dm\"`, respectively.\nAlternatively, to use `StateVectorSimulator`, you can instantiate `LocalSimulator` with no arguments or with `backend=\"default\"`: \n\n**Executing a circuit using the default simulator**\n```python\nfrom braket.circuits import Circuit\nfrom braket.devices import LocalSimulator\n\ndevice = LocalSimulator()\n\nbell = Circuit().h(0).cnot(0, 1)\nprint(device.run(bell, shots=100).result().measurement_counts)\n```\n\n## Documentation\n\nDetailed documentation, 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-default-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-default-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 the test dependencies using the following command:\n\n```bash\npip install -e \"amazon-braket-default-simulator-python[test]\"\n```\n\nTo run the unit tests:\n\n```bash\ntox -e unit-tests\n```\n\nYou can also pass in various pytest arguments to run selected tests:\n\n```bash\ntox -e unit-tests -- your-arguments\n```\n\nFor more information, please see [pytest usage](https://docs.pytest.org/en/stable/usage.html).\n\nTo run linters and doc generators and unit tests:\n\n```bash\ntox\n```\n\nTo run the performance tests:\n\n```bash\ntox -e performance-tests\n```\n\nThese tests will compare the performance of a series of simulator executions for your changes against the latest commit on the main branch.\n*Note*: The execution times for the performance tests are affected by the other processes running on the system.\nIn order to get stable results, stop other applications when running these tests.\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": "1.23.0",
    "project_urls": {
        "Homepage": "https://github.com/amazon-braket/amazon-braket-default-simulator-python"
    },
    "split_keywords": [
        "amazon",
        "aws",
        "quantum"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7cdd8fef68b3dc4029e4744b5c6c5409dbd8e05041d46b8707250a274128bb41",
                "md5": "a66c340c68ffa2e38810881fe56db296",
                "sha256": "6be75a83fdd93eadf0a2323b9ee69b2e5f5efc3120bd0440ff923a7eef0b0522"
            },
            "downloads": -1,
            "filename": "amazon_braket_default_simulator-1.23.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a66c340c68ffa2e38810881fe56db296",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 222264,
            "upload_time": "2024-04-22T16:18:54",
            "upload_time_iso_8601": "2024-04-22T16:18:54.156946Z",
            "url": "https://files.pythonhosted.org/packages/7c/dd/8fef68b3dc4029e4744b5c6c5409dbd8e05041d46b8707250a274128bb41/amazon_braket_default_simulator-1.23.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ce9ba0f0aab04033660c41a86d01d9aaddaa1577f230819dec3c44b9542aa8c9",
                "md5": "bf113e72749bb91a3c91bbc7bfc0a513",
                "sha256": "3b6775c57994326d2e2d5120f4d7f9132c15b8c45355c1dcfb389481cea57ff8"
            },
            "downloads": -1,
            "filename": "amazon_braket_default_simulator-1.23.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bf113e72749bb91a3c91bbc7bfc0a513",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 182012,
            "upload_time": "2024-04-22T16:18:56",
            "upload_time_iso_8601": "2024-04-22T16:18:56.475073Z",
            "url": "https://files.pythonhosted.org/packages/ce/9b/a0f0aab04033660c41a86d01d9aaddaa1577f230819dec3c44b9542aa8c9/amazon_braket_default_simulator-1.23.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 16:18:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "amazon-braket",
    "github_project": "amazon-braket-default-simulator-python",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "amazon-braket-default-simulator"
}
        
Elapsed time: 0.24260s