![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
amazon-braket-default-simulator
Advanced tools
An open source quantum circuit simulator to be run locally with the Amazon Braket SDK
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.
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__
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)
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
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.
This project is licensed under the Apache-2.0 License.
FAQs
An open source quantum circuit simulator to be run locally with the Amazon Braket SDK
We found that amazon-braket-default-simulator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.