Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/codecov/codecov-ac…
Browse files Browse the repository at this point in the history
…tion-4.2.0
  • Loading branch information
speller26 authored Jun 26, 2024
2 parents ce78cde + 7486805 commit 42f2e15
Show file tree
Hide file tree
Showing 141 changed files with 2,030 additions and 937 deletions.
8 changes: 7 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ parallel = True
branch = True
source =
src
omit =
omit =
**/braket/ir/*
**/braket/device_schema/*
**/braket/schema_common/*
Expand All @@ -23,9 +23,15 @@ exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Skipping import testing
from importlib.metadata import entry_points

# Don't complain if tests don't hit defensive assertion code:
raise NotImplementedError

# Avoid situation where system version causes coverage issues
if sys.version_info.minor == 9:

[html]
directory = build/coverage

Expand Down
3 changes: 1 addition & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ updates:
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
interval: "monthly"
commit-message:
prefix: infra

17 changes: 17 additions & 0 deletions .github/pr-title-checker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"LABEL": {
"name": "title needs formatting",
"color": "EEEEEE"
},
"CHECKS": {
"prefixes": ["fix: ", "feat: ", "test: ", "infra: ", "doc: ", "change: ", "break: ", "breaking: ", "deprecation: ", "feature: ", "depr: ", "documentation: "],
"regexp": "docs\\(v[0-9]\\): ",
"regexpFlags": "i",
"ignoreLabels" : ["dont-check-PRs-with-this-label", "meta"]
},
"MESSAGES": {
"success": "All OK",
"failure": "Failing CI test",
"notice": ""
}
}
2 changes: 1 addition & 1 deletion .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
pip install tox
- name: Run code format checks
run: |
tox -e linters_check
tox -e linters_check -p auto
31 changes: 31 additions & 0 deletions .github/workflows/pr-title-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "PR Title Checker"

on:
push:
branches:
- main
pull_request:
branches:
- main
- feature/**
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled

permissions:
pull-requests: write

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: "Check PR Title"
uses: thehanimo/pr-title-checker@v1.4.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: false
configuration_path: .github/pr-title-checker-config.json #(optional. defaults to .github/pr-title-checker-config.json)
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sphinx:
# Optionally build your docs in additional formats such as PDF
formats:
- pdf

# setting up build.os and the python version
build:
os: ubuntu-22.04
Expand Down
82 changes: 81 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,85 @@
# Changelog

## v1.81.1 (2024-06-17)

### Bug Fixes and Other Changes

* Error when FreeParameters are named QASM types

## v1.81.0 (2024-06-13)

### Features

* Add IQM to get compiled program convenience method

## v1.80.1 (2024-06-10)

### Bug Fixes and Other Changes

* docs: add stack exchange badge to the readme
* Implement `braket.ahs.AnalogHamiltonianSimulation.from_ir()`

## v1.80.0 (2024-05-22)

### Features

* add support for the ARN region
* Add support for SerializableProgram abstraction to Device interface

### Bug Fixes and Other Changes

* job fixture for endpoint support

## v1.79.1 (2024-05-08)

### Bug Fixes and Other Changes

* check the qubit set length against observables

## v1.79.0 (2024-05-06)

### Features

* Direct Reservation context manager

### Documentation Changes

* correct the example in the measure docstring

## v1.78.0 (2024-04-18)

### Features

* add phase RX gate

## v1.77.6 (2024-04-17)

### Bug Fixes and Other Changes

* if rydberg local is not pulled, pass in None

## v1.77.5 (2024-04-16)

### Bug Fixes and Other Changes

* remove optional discretization fields

## v1.77.4 (2024-04-16)

### Bug Fixes and Other Changes

* discretize method now takes None as an arg

### Documentation Changes

* Correct miscellaneous spelling mistakes in docstrings

## v1.77.3.post0 (2024-04-15)

### Documentation Changes

* correct gphase matrix representation

## v1.77.3 (2024-04-11)

### Bug Fixes and Other Changes
Expand Down Expand Up @@ -38,7 +118,7 @@

### Bug Fixes and Other Changes

* backwards compatiblity for local detuning
* backwards compatibility for local detuning

## v1.76.1 (2024-04-08)

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ You can then find the generated HTML files in `build/documentation/html`.
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/amazon-braket/amazon-braket-sdk-python/labels/help%20wanted) issues is a great place to start.
## Building Integrations
The Amazon Braket SDK supports integrations with popular quantum computing frameworks such as [PennyLane](https://github.com/amazon-braket/amazon-braket-pennylane-plugin-python), [Strawberryfields](https://github.com/amazon-braket/amazon-braket-strawberryfields-plugin-python) and [DWave's Ocean library](https://github.com/amazon-braket/amazon-braket-ocean-plugin-python). These serve as a good reference for a new integration you wish to develop.
The Amazon Braket SDK supports integrations with popular quantum computing frameworks such as [PennyLane](https://github.com/amazon-braket/amazon-braket-pennylane-plugin-python), [Strawberryfields](https://github.com/amazon-braket/amazon-braket-strawberryfields-plugin-python) and [DWave's Ocean library](https://github.com/amazon-braket/amazon-braket-ocean-plugin-python). These serve as a good reference for a new integration you wish to develop.

When developing a new integration with the Amazon Braket SDK, please remember to update the [user agent header](https://datatracker.ietf.org/doc/html/rfc7231#section-5.5.3) to include version information for your integration. An example can be found [here](https://github.com/amazon-braket/amazon-braket-pennylane-plugin-python/commit/ccee35604afc2b04d83ee9103eccb2821a4256cb).
When developing a new integration with the Amazon Braket SDK, please remember to update the [user agent header](https://datatracker.ietf.org/doc/html/rfc7231#section-5.5.3) to include version information for your integration. An example can be found [here](https://github.com/amazon-braket/amazon-braket-pennylane-plugin-python/commit/ccee35604afc2b04d83ee9103eccb2821a4256cb).

## Code of Conduct

Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Build status](https://github.com/amazon-braket/amazon-braket-sdk-python/actions/workflows/python-package.yml/badge.svg?branch=main)](https://github.com/amazon-braket/amazon-braket-sdk-python/actions/workflows/python-package.yml)
[![codecov](https://codecov.io/gh/amazon-braket/amazon-braket-sdk-python/branch/main/graph/badge.svg?token=1lsqkZL3Ll)](https://codecov.io/gh/amazon-braket/amazon-braket-sdk-python)
[![Documentation Status](https://img.shields.io/readthedocs/amazon-braket-sdk-python.svg?logo=read-the-docs)](https://amazon-braket-sdk-python.readthedocs.io/en/latest/?badge=latest)
[![Stack Overflow](https://img.shields.io/badge/StackExchange-Ask%20questions-blue?logo=stackexchange)](https://quantumcomputing.stackexchange.com/questions/tagged/amazon-braket)

The Amazon Braket Python SDK is an open source library that provides a framework that you can use to interact with quantum computing hardware devices through Amazon Braket.

Expand Down Expand Up @@ -93,7 +94,8 @@ Many quantum algorithms need to run multiple independent circuits, and submittin
```python
circuits = [bell for _ in range(5)]
batch = device.run_batch(circuits, shots=100)
print(batch.results()[0].measurement_counts) # The result of the first quantum task in the batch
# The result of the first quantum task in the batch
print(batch.results()[0].measurement_counts)
```

### Running a hybrid job
Expand Down Expand Up @@ -139,14 +141,14 @@ from braket.aws import AwsDevice
device = AwsDevice("arn:aws:braket:::device/qpu/rigetti/Aspen-8")

bell = Circuit().h(0).cnot(0, 1)
task = device.run(bell)
task = device.run(bell)
print(task.result().measurement_counts)
```

When you execute your task, Amazon Braket polls for a result. By default, Braket polls for 5 days; however, it is possible to change this by modifying the `poll_timeout_seconds` parameter in `AwsDevice.run`, as in the example below. Keep in mind that if your polling timeout is too short, results may not be returned within the polling time, such as when a QPU is unavailable, and a local timeout error is returned. You can always restart the polling by using `task.result()`.

```python
task = device.run(bell, poll_timeout_seconds=86400) # 1 day
task = device.run(bell, poll_timeout_seconds=86400) # 1 day
print(task.result().measurement_counts)
```

Expand Down Expand Up @@ -205,6 +207,12 @@ To run linters and doc generators and unit tests:
tox
```

or if your machine can handle multithreaded workloads, run them in parallel with:

```bash
tox -p auto
```

### Integration Tests

First, configure a profile to use your account to interact with AWS. To learn more, see [Configure AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html).
Expand Down Expand Up @@ -232,15 +240,15 @@ tox -e integ-tests -- your-arguments

### Issues and Bug Reports

If you encounter bugs or face issues while using the SDK, please let us know by posting
the issue on our [Github issue tracker](https://github.com/amazon-braket/amazon-braket-sdk-python/issues/).
If you encounter bugs or face issues while using the SDK, please let us know by posting
the issue on our [Github issue tracker](https://github.com/amazon-braket/amazon-braket-sdk-python/issues/).
For other issues or general questions, please ask on the [Quantum Computing Stack Exchange](https://quantumcomputing.stackexchange.com/questions/ask?Tags=amazon-braket).

### Feedback and Feature Requests

If you have feedback or features that you would like to see on Amazon Braket, we would love to hear from you!
[Github issues](https://github.com/amazon-braket/amazon-braket-sdk-python/issues/) is our preferred mechanism for collecting feedback and feature requests, allowing other users
to engage in the conversation, and +1 issues to help drive priority.
If you have feedback or features that you would like to see on Amazon Braket, we would love to hear from you!
[Github issues](https://github.com/amazon-braket/amazon-braket-sdk-python/issues/) is our preferred mechanism for collecting feedback and feature requests, allowing other users
to engage in the conversation, and +1 issues to help drive priority.

### Code contributors

Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
project = "amazon-braket-sdk"
version = version(project)
release = version
copyright = "{}, Amazon.com".format(datetime.datetime.now().year)
copyright = f"{datetime.datetime.now().year}, Amazon.com"

extensions = [
"sphinxcontrib.apidoc",
Expand All @@ -26,7 +26,7 @@
default_role = "py:obj"

html_theme = "sphinx_rtd_theme"
htmlhelp_basename = "{}doc".format(project)
htmlhelp_basename = f"{project}doc"

language = "en"

Expand Down
42 changes: 21 additions & 21 deletions doc/examples-adv-circuits-algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@
Advanced circuits and algorithms
################################

Learn more about working with advanced circuits and algoritms.
Learn more about working with advanced circuits and algorithms.

.. toctree::
:maxdepth: 2

**********************************************************************************************************************************************************
`Grover's search algorithm <https://github.com/amazon-braket/amazon-braket-examples/blob/main/examples/advanced_circuits_algorithms/Grover/Grover.ipynb>`_
**********************************************************************************************************************************************************

This tutorial provides a step-by-step walkthrough of Grover's quantum algorithm.
You learn how to build the corresponding quantum circuit with simple modular building
blocks using the Amazon Braket SDK. You will learn how to build custom
gates that are not part of the basic gate set provided by the SDK. A custom gate can used
This tutorial provides a step-by-step walkthrough of Grover's quantum algorithm.
You learn how to build the corresponding quantum circuit with simple modular building
blocks using the Amazon Braket SDK. You will learn how to build custom
gates that are not part of the basic gate set provided by the SDK. A custom gate can used
as a core quantum gate by registering it as a subroutine.

******************************************************************************************************************************************************************************************************************
`Quantum amplitude amplification <https://github.com/amazon-braket/amazon-braket-examples/blob/main/examples/advanced_circuits_algorithms/Quantum_Amplitude_Amplification/Quantum_Amplitude_Amplification.ipynb>`_
******************************************************************************************************************************************************************************************************************

This tutorial provides a detailed discussion and implementation of the Quantum Amplitude Amplification (QAA)
algorithm using the Amazon Braket SDK. QAA is a routine in quantum computing which generalizes the idea behind
Grover's famous search algorithm, with applications across many quantum algorithms. QAA uses an iterative
approach to systematically increase the probability of finding one or multiple
target states in a given search space. In a quantum computer, QAA can be used to obtain a
This tutorial provides a detailed discussion and implementation of the Quantum Amplitude Amplification (QAA)
algorithm using the Amazon Braket SDK. QAA is a routine in quantum computing which generalizes the idea behind
Grover's famous search algorithm, with applications across many quantum algorithms. QAA uses an iterative
approach to systematically increase the probability of finding one or multiple
target states in a given search space. In a quantum computer, QAA can be used to obtain a
quadratic speedup over several classical algorithms.


************************************************************************************************************************************************************************************************
`Quantum Fourier transform <https://github.com/amazon-braket/amazon-braket-examples/blob/main/examples/advanced_circuits_algorithms/Quantum_Fourier_Transform/Quantum_Fourier_Transform.ipynb>`_
************************************************************************************************************************************************************************************************

This tutorial provides a detailed implementation of the Quantum Fourier Transform (QFT) and
its inverse using Amazon Braket's SDK. The QFT is an important subroutine to many quantum algorithms,
most famously Shor's algorithm for factoring and the quantum phase estimation (QPE) algorithm
for estimating the eigenvalues of a unitary operator.
This tutorial provides a detailed implementation of the Quantum Fourier Transform (QFT) and
its inverse using Amazon Braket's SDK. The QFT is an important subroutine to many quantum algorithms,
most famously Shor's algorithm for factoring and the quantum phase estimation (QPE) algorithm
for estimating the eigenvalues of a unitary operator.

*********************************************************************************************************************************************************************************************
`Quantum phase estimation <https://github.com/amazon-braket/amazon-braket-examples/blob/main/examples/advanced_circuits_algorithms/Quantum_Phase_Estimation/Quantum_Phase_Estimation.ipynb>`_
*********************************************************************************************************************************************************************************************

This tutorial provides a detailed implementation of the Quantum Phase Estimation (QPE)
algorithm using the Amazon Braket SDK. The QPE algorithm is designed to estimate the
eigenvalues of a unitary operator. Eigenvalue problems can be found across many
disciplines and application areas, including principal component analysis (PCA)
as used in machine learning and the solution of differential equations in mathematics, physics,
engineering and chemistry.
This tutorial provides a detailed implementation of the Quantum Phase Estimation (QPE)
algorithm using the Amazon Braket SDK. The QPE algorithm is designed to estimate the
eigenvalues of a unitary operator. Eigenvalue problems can be found across many
disciplines and application areas, including principal component analysis (PCA)
as used in machine learning and the solution of differential equations in mathematics, physics,
engineering and chemistry.
Loading

0 comments on commit 42f2e15

Please sign in to comment.