orquestra-braket
What is it?
orquestra-braket is a Zapata library holding modules for integrating Amazon Braket supported devices with Orquestra. This version supports Braket's LocalSimlator() and on-demand simulators.
Installation
Even though it's intended to be used with Orquestra, orquestra-braket can be also used as a Python module.
To install it, make to install orquestra-quantum first. Then you just need to run pip install . from the main directory.
Overview
orquestra-braket is a Python module that exposes Braket's runner and simulators as an orquestra CircuitRunner and WavefunctionSimulator. They can be imported with:
from orquestra.integrations.braket.runner import BraketRunner
from orquestra.integrations.braket.simulator import braket_local_simulator
In addition, it interfaces with the noise models and provides converters that allow switching between braket circuits and those of orquestra.
The module can be used directly in Python or in an Orquestra workflow. For more details, see the Orquestra Core docs.
For more information regarding Orquestra and resources, please refer to the Orquestra documentation.
On Demand Simulator
In order to use Braket's on-demand simulator, a boto.Session must be created using AWS credentials. See Boto Session for information on creating creating a session. It highly recommended that credentials are configured in the local AWS CLI profile. Following is an example of working with BraketOnDemandSimulator using credentials stored in AWS CLI profile:
from orquestra.integrations.braket.runner import aws_runner
from boto3 import Session
# Insert CLI profile name here
boto_session = Session(profile_name=`profile`, region_name='us-east-1')
simulator_name = "SV1"
noise_model = None
simulator = aws_runner(name = simulator_name, noise_model = noise_model, boto_session=boto_session)
Below is an example of finding the names of on-demand simulators:
from boto3 import Session
from braket.aws import AwsSession, AwsDevice
boto_session = Session(profile_name=`profile`, region_name='us-east-1')
aws_session = AwsSession(boto_session)
Simulators = AwsDevice.get_devices(types=['SIMULATOR'], aws_session)
Braket QPUs
This library will allow you to access the QPUs provided by AWS Braket. The process is very similar to the BraketOnDemandSimulator. Here is how we can get started:
from orquestra.integrations.braket.runner import aws_runner
QPU_name = "IonQ Device"
s3 = "https://my-bucket.s3-us-west-2.amazonaws.com"
backend = aws_runner(name = QPU_name, s3_destination_folder = s3, boto_session = boto_session )
If you want to find the list of QPU names provided by Braket, use the following method:
from orquestra.integrations.braket.runner import get_QPU_names
QPU_names = get_QPU_names(boto_session)
After setting up the QPU, you can use the following approach to send a task to a QPU.
QPU_task = backend.run_and_measure(circ, n_samples)
Since the quantum devices are not readily accessible, the results are not returned immediately. We can monitor the status of our task by QPU_task.state(). You can cancel the task by QPU.cancel().
The outcome of the task will be stored in a S3 Bucket. You are required to have access to the bucket to retrive the results. You can find out more accessing S3 bucket here
Development and contribution
You can find the development guidelines in the orquestra-core repository.
Metadata
Release files for orquestra-braket 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| orquestra-braket-0.4.0.tar.gz | 26.8 kB | Without provenance | Details for orquestra-braket-0.4.0.tar.gz |
Release files / orquestra-braket-0.4.0.tar.gz
| Download URL | orquestra-braket-0.4.0.tar.gz |
|---|---|
| Size | 26.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c54d51f546a8185d9484bb49ba25999d943d13dec93169ef376b93b4cd9d10b
|
|
BLAKE2b-256 checksum How to use checksums |
35131632dc4208418d374a718b4c5bd52237afec0baa03d212af45b37d267caa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Security for orquestra-braket 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.