https://github.com/agnostiqhq/covalent-braket-plugin

Executor plugin interfacing Covalent with Amazon Braket Hybrid Jobs

https://github.com/agnostiqhq/covalent-braket-plugin

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.2%) to scientific vocabulary

Keywords

aws braket docker parallelization pipelines python python3 quantum-computing quantum-machine-learning workflow

Keywords from Contributors

covalent quantum workflow-management workflow-automation orchestration machinelearning-python hpc-applications data-pipeline etl cloud-computing
Last synced: 5 months ago · JSON representation

Repository

Executor plugin interfacing Covalent with Amazon Braket Hybrid Jobs

Basic Info
  • Host: GitHub
  • Owner: AgnostiqHQ
  • License: apache-2.0
  • Language: Python
  • Default Branch: develop
  • Homepage: https://covalent.xyz
  • Size: 414 KB
Statistics
  • Stars: 8
  • Watchers: 9
  • Forks: 1
  • Open Issues: 7
  • Releases: 26
Topics
aws braket docker parallelization pipelines python python3 quantum-computing quantum-machine-learning workflow
Created almost 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

 

[![covalent](https://img.shields.io/badge/covalent-0.177.0-purple)](https://github.com/AgnostiqHQ/covalent) [![python](https://img.shields.io/pypi/pyversions/covalent-braket-plugin)](https://github.com/AgnostiqHQ/covalent-braket-plugin) [![tests](https://github.com/AgnostiqHQ/covalent-braket-plugin/actions/workflows/tests.yml/badge.svg)](https://github.com/AgnostiqHQ/covalent-braket-plugin/actions/workflows/tests.yml) [![codecov](https://codecov.io/gh/AgnostiqHQ/covalent-braket-plugin/branch/main/graph/badge.svg?token=QNTR18SR5H)](https://codecov.io/gh/AgnostiqHQ/covalent-braket-plugin) [![apache](https://img.shields.io/badge/License-Apache_License_2.0-blue)](https://www.apache.org/licenses/LICENSE-2.0)

Covalent Braket Hybrid Jobs Plugin

Covalent is a Pythonic workflow tool used to execute tasks on advanced computing hardware. This executor plugin interfaces Covalent with AWS Braket Hybrid Jobs

Installing

To use this plugin with Covalent, install it with pip: pip install covalent-braket-plugin

Usage Example

The following workflow prepares a uniform superposition of the single-qubit standard basis states and measures it.

```python import covalent as ct from covalentbraketplugin.braket import BraketExecutor import os

AWS resources to pass to the executor

credentialsfile = "~/.aws/credentials" profile = "default" s3bucketname = "brakets3bucket" ecrimageuri = "111223344.dkr.ecr.us-east-1.amazonaws.com/amazon-braket-ecr-repo:latest" iamrole_name = "covalent-braket-iam-role"

ex = BraketExecutor( profile=profile, credentials=credentialsfile, s3bucketname=s3bucketname, ecrimageuri=ecrimageuri, braketjobexecutionrolename=iamrolename, quantumdevice="arn:aws:braket:::device/quantum-simulator/amazon/sv1", classicaldevice="ml.m5.large", storage=30, timelimit=300, )

@ct.electron(executor=ex) def simplequantumtask(num_qubits: int): import pennylane as qml

# These are passed to the Hybrid Jobs container at runtime
device_arn = os.environ["AMZN_BRAKET_DEVICE_ARN"]
s3_bucket = os.environ["AMZN_BRAKET_OUT_S3_BUCKET"]
s3_task_dir = os.environ["AMZN_BRAKET_TASK_RESULTS_S3_URI"].split(s3_bucket)[1]

device = qml.device(
    "braket.aws.qubit",
    device_arn=device_arn,
    s3_destination_folder=(s3_bucket, s3_task_dir),
    wires=num_qubits,
)

@qml.qnode(device=device)
def simple_circuit():
    qml.Hadamard(wires=[0])
    return qml.expval(qml.PauliZ(wires=[0]))

res = simple_circuit().numpy()
return res

@ct.lattice def simplequantumworkflow(numqubits: int): return simplequantumtask(numqubits=num_qubits)

dispatchid = ct.dispatch(simplequantumworkflow)(1) resultobject = ct.getresult(dispatchid, wait=True)

We expect 0 as the result

print("Result:", result_object.result) ```

To run such workflows, users must have AWS credentials allowing access to Braket, ECR, S3, and some other services. These permissions must be defined in an IAM Role (called "covalent-braket-iam-role" in this example). The AWS documentation has more information about managing Braket access.

Overview of Configuration

See the RTD for how to configure this executor.

Required Cloud Resources

In order to run your workflows with covalent there are a few notable resources that need to be provisioned first. Particularly an S3 bucket must be created, an IAM role with the AmazonBraketFullAccess policy, and a private ECR repo with an uploaded image for the tasks to use.

For more information regarding which cloud resources need to be provisioned visit our read the docs RTD guide for this plugin.

Release Notes

Release notes are available in the Changelog.

Citation

Please use the following citation in any publications:

W. J. Cunningham, S. K. Radha, F. Hasan, J. Kanem, S. W. Neagle, and S. Sanand. Covalent. Zenodo, 2022. https://doi.org/10.5281/zenodo.5903364

License

Covalent is licensed under the Apache 2.0 License. See the LICENSE file or contact the support team for more details.

Owner

  • Name: Agnostiq
  • Login: AgnostiqHQ
  • Kind: organization
  • Email: contact@agnostiq.ai
  • Location: Toronto

Developing Software for Advanced Computing

GitHub Events

Total
  • Watch event: 1
  • Push event: 4
Last Year
  • Watch event: 1
  • Push event: 4

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 102
  • Total Committers: 11
  • Avg Commits per committer: 9.273
  • Development Distribution Score (DDS): 0.578
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
CovalentOpsBot c****t 43
Alejandro Esquivel ae@a****d 22
Faiyaz Hasan f****z@a****i 10
Will Cunningham w****l@a****i 9
Venkat Bala 1****a 6
Scott Wyman Neagle s****t@a****i 4
Casey Jao c****y@a****i 3
WingCode s****4@g****m 2
jkanem j****m@g****m 1
Scott Wyman Neagle w****a@p****m 1
Sankalp Sanand s****p@a****i 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 20
  • Total pull requests: 57
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 3 days
  • Total issue authors: 6
  • Total pull request authors: 11
  • Average comments per issue: 0.6
  • Average comments per pull request: 0.84
  • Merged pull requests: 50
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • AlejandroEsquivel (9)
  • cjao (4)
  • scottwn (3)
  • kessler-frost (2)
  • wjcunningham7 (1)
  • jkanem (1)
Pull Request Authors
  • AlejandroEsquivel (23)
  • FyzHsn (9)
  • venkatBala (7)
  • scottwn (5)
  • cjao (3)
  • wjcunningham7 (3)
  • kessler-frost (2)
  • dependabot[bot] (2)
  • jkanem (1)
  • pre-commit-ci[bot] (1)
  • WingCode (1)
Top Labels
Issue Labels
Team West (2) Epic (1) testing / integration tests (1) testing / unit tests (1) testing / validation (1) docs (1) bug :bug: (1)
Pull Request Labels
dependencies (2) improvements / style (1) unitaryhack-accepted (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 49 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 29
  • Total maintainers: 1
pypi.org: covalent-braket-plugin

Covalent Braket Plugin

  • Versions: 29
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 49 Last month
Rankings
Dependent packages count: 6.6%
Average: 23.3%
Stargazers count: 25.5%
Forks count: 30.5%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • amazon-braket-pennylane-plugin ==1.6.9
  • boto3 ==1.24.35
  • covalent ==0.177.0
  • docker ==5.0.3
tests/requirements.txt pypi
  • pytest ==6.2.5 test
  • pytest-mock ==3.6.1 test
.github/workflows/changelog.yml actions
  • EndBug/add-and-commit v9 composite
  • actions/checkout v3 composite
.github/workflows/changelog_reminder.yml actions
  • actions/checkout master composite
  • peterjgrainger/action-changelog-reminder v1.3.0 composite
.github/workflows/docker.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v4 composite
  • aws-actions/configure-aws-credentials v1 composite
  • docker/build-push-action v2 composite
  • docker/setup-buildx-action v2 composite
  • docker/setup-qemu-action v2 composite
.github/workflows/license.yml actions
  • actions/checkout v3 composite
  • pilosus/action-pip-license-checker main composite
.github/workflows/release.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • ncipollo/release-action v1 composite
.github/workflows/tests.yml actions
  • actions-ecosystem/action-get-latest-tag v1 composite
  • actions/checkout v3 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v3 composite
.github/workflows/version.yml actions
  • actions/checkout v1 composite
  • tj-actions/changed-files v18.4 composite
Dockerfile docker
  • ${COVALENT_BASE_IMAGE} latest build
pyproject.toml pypi
setup.py pypi