Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/pyquil-approx-eq-4.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
natestemen authored Apr 1, 2024
2 parents f8c75ab + 246f2e6 commit 3b0a1a5
Show file tree
Hide file tree
Showing 177 changed files with 4,761 additions and 1,860 deletions.
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

10 changes: 7 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ updates:
# Ignore minor and patch releases in other dev requirements.
- dependency-name: "*pytest*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "flake8"
- dependency-name: "ruff"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "black"
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "mypy"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "*sphinx*"
Expand All @@ -38,6 +36,12 @@ updates:
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "jupytext"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "matplotlib"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "seaborn"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "pandas"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
# Allow up to 10 open pull requests for pip dependencies
open-pull-requests-limit: 10
labels:
Expand Down
8 changes: 3 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
<!--
If the validation checks fail
1. Run `make check-types` (from the root directory of the repository) and fix any mypy (https://mypy.readthedocs.io/en/stable/) errors.
2. Run `make check-style` and fix any flake8 (http://flake8.pycqa.org) errors.
3. Run `make format` to format your code with the black (https://black.readthedocs.io/en/stable/index.html) autoformatter.
2. Run `make format` to fix any linting/formatting errors. There may be some issues that require manual intervention for you to fix.
For more information, check the Mitiq style guidelines (https://mitiq.readthedocs.io/en/stable/contributing.html#style-guidelines).
-->
Expand All @@ -25,8 +22,9 @@ For more information, check the Mitiq style guidelines (https://mitiq.readthedoc
- [ ] I license this contribution under the terms of the GNU GPL, version 3 and grant Unitary Fund the right to provide additional permissions as described in section 7 of the GNU GPL, version 3.

Before opening the PR, please ensure you have completed the following where appropriate.

- [ ] I added unit tests for new code.
- [ ] I used [type hints](https://www.python.org/dev/peps/pep-0484/) in function signatures.
- [ ] I used [Google-style](https://google.github.io/styleguide/pyguide.html#383-functions-and-methods) docstrings for functions.
- [ ] I [updated the documentation](../blob/master/docs/CONTRIBUTING_DOCS.md) where relevant.
- [ ] Added myself / the copyright holder to the AUTHORS file
- [ ] Added myself / the copyright holder to the AUTHORS file
13 changes: 5 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Check out mitiq
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python dependencies
Expand All @@ -31,10 +31,7 @@ jobs:
- name: Check types with mypy
run: make check-types

- name: Lint with flake8
run: make check-style

- name: Check code style with Black
- name: Check code style/formatting
run: make check-format

docs:
Expand All @@ -43,7 +40,7 @@ jobs:
- name: Check out mitiq
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand Down Expand Up @@ -72,7 +69,7 @@ jobs:
- name: Check out mitiq
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Mitiq
Expand All @@ -99,7 +96,7 @@ jobs:
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
ref: ${{ github.ref }}
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Check out mitiq
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python dependencies
Expand All @@ -38,7 +38,7 @@ jobs:
# - name: Check out mitiq
# uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v4
# uses: actions/setup-python@v5
# with:
# python-version: 3.8
# - name: Install Mitiq
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
5 changes: 4 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Nathaniel T. Stemen
Nathan Shammah
Will J. Zeng
Min Li
Jordan Sullivan

L-P-B
Paul Chung
Expand Down Expand Up @@ -54,4 +55,6 @@ Mohammad Zuhair Khan
Brian Goldsmith
Farzad Kianvash
Yash Prabhat
Vladimir Kozhukalov
Vladimir Kozhukalov
Francesc Sabater
Emiliano Godinez
188 changes: 187 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,191 @@
# Changelog

## Version 0.35.0 (under development)

## Version 0.34.0
Announcing support for [Qibo](https://qibo.science/), a newly integrated frontend in Mitiq! 📣
Qibo is an "end-to-end open source platform for quantum simulation, self-hosted quantum hardware control, calibration and characterization".

```py
from qibo import Circuit
from mitiq.conversions import convert_to_mitiq

circuit = Circuit(2)
circuit.add(gates.H(0))
circuit.add(gates.H(1))

print(circuit)

def executor(circuit):
return circuit.execute()


mitigated = mitiq.zne.execute_with_zne(convert_to_mitiq(circuit), executor)
```

Thank you to new contributor Francesc Sabater for excellent work integrating Qibo and Mitiq!
Thanks also to new contibutor Sam Burdick for fixing our readme.

This release also includes a refactoring of part of the Mitiq shadows module, `mitiq.shadows.classical_postprocessing`, for speed of execution and code readability.

### 📓 Documentation
We've continued to enhance our (legendary!) documentation with:
1. Addition of a security policy document
2. Faster execution of the learning-based PEC tutorial in CI

### Commits
- Add support for qibo circuits (#2102) [@francescsabater]
- Reduce doc build time for learning representations (#2165) [@Misty-W]
- Create SECURITY.md (#2162) [@nathanshammah]
- Fix typo in README.md (#2173) [@smburdick]
- Refactor classical postprocessing in shadows module (#2152) [@natestemen]
- Fix broken link in `combine_rem_zne.md` (#2156) [@Misty-W]

#### 📦 Dependency updates
- Bump openfermion from 1.6.0 to 1.6.1 (#2182) [@dependabot]
- Update amazon-braket-sdk requirement from ~=1.68.3 to ~=1.69.0 (#2177) [@dependabot]
- Bump pyscf from 2.4.0 to 2.5.0 (#2176) [@dependabot]
- Update amazon-braket-sdk requirement from ~=1.66.0 to ~=1.68.3 (#2175) [@dependabot]
- Update qiskit-aer requirement from ~=0.13.1 to ~=0.13.2 (#2157) [@dependabot]
- Bump pytest from 7.1.3 to 8.0.0 (#2167) [@dependabot]
- Update amazon-braket-sdk requirement from ~=1.65.1 to ~=1.66.0 (#2155) [@dependabot]
- Update pennylane-qiskit requirement from ~=0.33.1 to ~=0.34.0 (#2154) [@dependabot]
- Update pennylane requirement from ~=0.33.1 to ~=0.34.0 (#2153) [@dependabot]
- Update qiskit-ibm-provider requirement from ~=0.7.3 to ~=0.8.0 (#2151) [@dependabot]

## Version 0.33.0

Minor update from 0.32.0 to fix a bug 🐛 in the `mitiq.shadows` module where an incorrect index was being used.

### All changes

- Changed to use the split for b_list_shadow (#2137) [@bdg221]

## Version 0.32.0

> Happy holidays, and happy (almost) new year!! ❄️☃️🎄🎊
> This will be our last release of the year, and we'd like to thank everyone who has contributed to Mitiq over the past 12 months.
> We've accomplished so much in the way of error mitigation this year, and we couldn't have done it without the support and time given by the volunteers.
> **Thank you!**
The **calibrator logs have been revamped** for to support result discovery and analysis.
The `Calibrator.run` method now support two options: `flat` and `cartesian` to display the experiment results in either a linear fashion, or grid-like.
Results here have been truncated for brevity.

```py
>>> calibrator.run(log="flat")
┌──────────────────────────┬────────────────────────────────────┬────────────────────────────┐
│ benchmark │ strategy │ performance │
├──────────────────────────┼────────────────────────────────────┼────────────────────────────┤
│ Type: ghz │ Technique: ZNE │ ✔ │
│ Num qubits: 2 │ Factory: Linear │ Noisy error: 0.04
│ Circuit depth: 2 │ Scale factors: 1.0, 2.0, 3.0 │ Mitigated error: 0.02
│ Two qubit gate count: 1 │ Scale method: fold_gates_at_random │ Improvement factor: 2.0
├──────────────────────────┼────────────────────────────────────┼────────────────────────────┤
│ Type: ghz │ Technique: ZNE │ ✘ │
│ Num qubits: 2 │ Factory: Linear │ Noisy error: 0.04
│ Circuit depth: 2 │ Scale factors: 1.0, 3.0, 5.0 │ Mitigated error: 0.0658
│ Two qubit gate count: 1 │ Scale method: fold_global │ Improvement factor: 0.6076
├──────────────────────────┼────────────────────────────────────┼────────────────────────────┤
│ Type: ghz │ Technique: ZNE │ ✘ │
│ Num qubits: 2 │ Factory: Richardson │ Noisy error: 0.98
│ Circuit depth: 33 │ Scale factors: 1.0, 3.0, 5.0 │ Mitigated error: 1.03
│ Two qubit gate count: 14 │ Scale method: fold_global │ Improvement factor: 0.9515
└──────────────────────────┴────────────────────────────────────┴────────────────────────────┘
```

```py
>>> calibrator.run(log="cartesian")
┌────────────────────────────────────┬────────────────────────────┬────────────────────────────┐
│ strategy\benchmark │ Type: ghz │ Type: mirror │
│ │ Num qubits: 2 │ Num qubits: 2
│ │ Circuit depth: 2 │ Circuit depth: 33
│ │ Two qubit gate count: 1 │ Two qubit gate count: 14
├────────────────────────────────────┼────────────────────────────┼────────────────────────────┤
│ Technique: ZNE │ ✘ │ ✘ │
│ Factory: Richardson │ Noisy error: 0.03 │ Noisy error: 1.0
│ Scale factors: 1.0, 2.0, 3.0 │ Mitigated error: 0.09 │ Mitigated error: 1.03
│ Scale method: fold_global │ Improvement factor: 0.3333 │ Improvement factor: 0.9709
├────────────────────────────────────┼────────────────────────────┼────────────────────────────┤
│ Technique: ZNE │ ✘ │ ✔ │
│ Factory: Richardson │ Noisy error: 0.03 │ Noisy error: 1.0
│ Scale factors: 1.0, 3.0, 5.0 │ Mitigated error: 0.0563 │ Mitigated error: 0.97
│ Scale method: fold_global │ Improvement factor: 0.5333 │ Improvement factor: 1.0309
├────────────────────────────────────┼────────────────────────────┼────────────────────────────┤
│ Technique: ZNE │ ✘ │ ✔ │
│ Factory: Linear │ Noisy error: 0.03 │ Noisy error: 1.0
│ Scale factors: 1.0, 3.0, 5.0 │ Mitigated error: 0.0417 │ Mitigated error: 0.9975
│ Scale method: fold_global │ Improvement factor: 0.72 │ Improvement factor: 1.0025
└────────────────────────────────────┴────────────────────────────┴────────────────────────────┘
```

**New benchmarking circuits:** `mitiq.benchmarks` now contains a function `generate_random_clifford_t_circuit` which does what it says on the tin.
Special shoutout to new UF team member Farrokh Labib (@farlab) for this contribution.

```py
from mitiq.benchmarks import generate_random_clifford_t_circuit

clifft = generate_random_clifford_t_circuit(
num_qubits=2,
num_oneq_cliffords=5,
num_twoq_cliffords=5,
num_t_gates=5
)
print(clifft)
# 0: ───────────@───S───T───@───H───T───X───T───T───@───@───────
# │ │ │ │ │
# 1: ───S───T───@───────────X───────────@───S───────@───X───S───
```

The `Executor.run` method now supports a single circuit instance in addition to a list for ease of use when working with a single circuit.

```diff
- executor.run([circuit])
+ executor.run(circuit)
```

**Faster Tests!** Working on Mitiq has never been easier to develop with a faster (by 36%) test suite.

### 📓 Documentation

This release contains quite a few documentation improvements, including

1. New workflow images to elucidate the workflow for for using the `mitiq.shadows` module (available [here](https://mitiq.readthedocs.io/en/stable/guide/shadows.html))
2. A reorganized API-doc which should be easier to navigate
3. General clean up of the CDR user guide pages

### Commits

- Clarify CDR training docs regarding the use of a markov chain monte carlo (#2130) [@natestemen]
- Update workflow images in documentation (#2034) [@purva-thakre]
- 2115 pauli twirling callibration of expectation estimation shadow needs continue (#2116) [@bdg221]
- Add randomized clifford+T benchmarking circuits. (#2118) [@farlab]
- Frontend/Backend docs clean up (#2124) [@natestemen]
- Speed up tests using mocks (#2126) [@natestemen]
- resolve flaky mirror QV circuit test (#2127) [@natestemen + @misty-w]
- Simplify expectation_estimation_shadow code (#2113) [@bdg221]
- Refactor calibration logs (#2074) [@kozhukalov]
- Organize API-doc (#2104) [@purva-thakre]
- add support for single circuit on exeuctor run method (#2099) [@emilianog-byte]

#### 📦 Dependency updates

- Update qiskit-ibm-provider requirement from ~=0.7.2 to ~=0.7.3 (#2122) [@dependabot]
- Update cirq requirement from <1.3.0,>=1.0.0 to >=1.0.0,<1.4.0 (#2107) [@dependabot]
- Update pennylane requirement from ~=0.32.0 to ~=0.33.1 (#2091) [@dependabot]
- Update pennylane-qiskit requirement from ~=0.32.0 to ~=0.33.0 (#2081) [@dependabot]
- Bump stim/stimcirq from 1.12.0 to 1.12.1 (#2106) [@dependabot]
- Update amazon-braket-sdk requirement from ~=1.59.2 to ~=1.64.1 (#2089 + #2094 + #2114 + #2123) [@dependabot]
- Update scipy requirement from <=1.11.3,>=1.5.0 to >=1.5.0,<=1.11.4 (#2095) [@dependabot]

#### 🧑‍💻 Dev Dependency updates

- Bump myst-nb from 0.17.1 to 1.0.0 (#2090) [@dependabot]
- Bump pandas from 2.1.2 to 2.1.3 (#2093) [@dependabot]
- Bump matplotlib from 3.8.0 to 3.8.1 (#2084) [@dependabot]
- Bump isort from 5.12.0 to 5.13.2 (#2120 + #2125) [@dependabot]
- Bump actions/setup-python from 4 to 5 (#2112) [@dependabot]

## Version 0.31.0

Released November 2, 2023
Expand Down Expand Up @@ -1115,7 +1301,7 @@ Another important change is the integration with Amazon Braket, such that Mitiq

In the context of probabilistic error cancellation, the sub-module `mitiq.pec.representations` has been significantly improved. Now one can easily compute the optimal quasi-probabiliy representation of an ideal gate as a linear combination of `NoisyOperation` objects.

Thanks to all contributors (@L-P-B, @Aaron-Robertson, @francespoblete, @LaurentAjdnik, @maxtremblay, @andre-a-alves, @paniash, @purva-thakre) and in particular to the participants of [unitaryHACK](https://unitaryfund.github.io/unitaryhack/)!
Thanks to all contributors (@L-P-B, @Aaron-Robertson, @francespoblete, @LaurentAjdnik, @maxtremblay, @andre-a-alves, @paniash, @purva-thakre) and in particular to the participants of [unitaryHACK](https://2021.unitaryhack.dev/)!

### All Changes

Expand Down
Loading

0 comments on commit 3b0a1a5

Please sign in to comment.