Skip to content

Commit

Permalink
Merge branch 'main' into yitchen/set-noise-model
Browse files Browse the repository at this point in the history
  • Loading branch information
yitchen-tim committed May 10, 2024
2 parents 6696e02 + ec5edaf commit ea838f1
Show file tree
Hide file tree
Showing 144 changed files with 4,958 additions and 1,617 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
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ updates:
interval: "weekly"
commit-message:
prefix: infra

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
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # release/v1
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # release/v1
with:
password: ${{ secrets.pypi_token }}
4 changes: 3 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ jobs:
run: |
tox -e unit-tests
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ strategy.job-index }} == 0
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
185 changes: 185 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,190 @@
# Changelog

## 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

* measure target qubits are required

## v1.77.2 (2024-04-10)

### Bug Fixes and Other Changes

* remove shifting field from testing

## v1.77.1 (2024-04-10)

### Bug Fixes and Other Changes

* add measure qubit targets in braket_program_context

## v1.77.0 (2024-04-10)

### Features

* rename shifting field to local detuning

## v1.76.3 (2024-04-09)

### Bug Fixes and Other Changes

* Replace pkg_resources with importlib.metadata

### Documentation Changes

* Improve gphase unitary matrix definition in docstring

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

### Bug Fixes and Other Changes

* backwards compatibility for local detuning

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

### Bug Fixes and Other Changes

* Support single-register measurements in `from_ir`
* prevent repeated measurements on a qubit

## v1.76.0 (2024-04-01)

### Features

* add support for OpenQASM measure on a subset of qubits

### Bug Fixes and Other Changes

* restore the dependent test back to pennylane

### Documentation Changes

* fix GPI2 gate matrix representation

## v1.75.0 (2024-03-28)

### Features

* upgrade to pydantic 2.x

### Bug Fixes and Other Changes

* change schemas constraint

## v1.74.1 (2024-03-27)

### Bug Fixes and Other Changes

* temporarily pin the schemas version

## v1.74.0 (2024-03-21)

### Features

* Allow sets of calibrations in batches

### Bug Fixes and Other Changes

* batch tasking passing lists to single tasks

## v1.73.3 (2024-03-18)

### Bug Fixes and Other Changes

* store account id if already accessed

## v1.73.2 (2024-03-13)

### Bug Fixes and Other Changes

* increase tol value for our integ tests

## v1.73.1 (2024-03-11)

### Bug Fixes and Other Changes

* allow for braket endpoint to be set within the jobs

## v1.73.0 (2024-03-07)

### Features

* update circuit drawing

## v1.72.2 (2024-03-04)

### Bug Fixes and Other Changes

* validate FreeParameter name

## v1.72.1 (2024-02-28)

### Bug Fixes and Other Changes

* escape slash in metrics prefix

## v1.72.0 (2024-02-27)

### Features

* FreeParameterExpression division

## v1.71.0 (2024-02-26)

### Features

* update log stream prefix for new jobs

## v1.70.3 (2024-02-21)

### Bug Fixes and Other Changes
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
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,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 +140,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 +206,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 +239,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
9 changes: 4 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"""Sphinx configuration."""

import datetime

import pkg_resources
from importlib.metadata import version

# Sphinx configuration below.
project = "amazon-braket-sdk"
version = pkg_resources.require(project)[0].version
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 @@ -27,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
Loading

0 comments on commit ea838f1

Please sign in to comment.