unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
344 stars 145 forks source link

Update cirq-core requirement from <1.4.0,>=1.0.0 to >=1.0.0,<1.5.0 #2390

Open dependabot[bot] opened 1 month ago

dependabot[bot] commented 1 month ago

Updates the requirements on cirq-core to permit the latest version.

Release notes

Sourced from cirq-core's releases.

v1.4.0

Cirq v1.4.0 release

Summary

Added support for Python 3.12 and increased minimum Python version to 3.10.

Removal of cirq-ft

The cirq-ft package introduced in 1.2.0 was deleted after its move to the Qualtran repository at https://github.com/quantumlib/Qualtran.git. Please use that repository for fault-tolerant resource estimation needs.

cirq-core

Added cirq.UniformSuperpositionGate for creating uniform superposition from a subset of n-qubit basis states. Added transformer that implements dynamical decoupling for idle moments in a circuit. Added cirq.UNIT_SWEEP as an alias for the cirq.UnitSweep but with a constant-style name. Exposed the Mølmer–Sørensen MSGate at the top level cirq namespace.

cirq-google

Removed functions create_calibration_program and create_batch_program. Added tag class FSimViaModelTag to enable execution of the FSimGate using polynomial model.

A Huge Thank You

Thank you to all our contributors for this release:

Bicheng Ying, Cheng Xing, Dax Fohl, Doug Strain, Eliott Rosenberg, Greg Kahanamoku-Meyer, jbrixon, Josha91, kenya-sk, Lawal Olufowobi, Matthew Harrigan, Matthew Neeley, Miguel Costa, Nour Yosri, Pavol Juhas, Pragya Jain, Prakhar Bhatnagar, Renyi Chen, richrines1, Sam Burdick, Seneca Meeks, Tanuj Khattar, William Courtney, Yury Shefer

What's Changed

ab869790 Flush deprecations before minor release (#6622) a9776d0f Nicer string representation for InverseCompositeGate (#6262) 2cfdf1f4 Add convenience methods to create PhasedXZ gate from ZYZ decomposition (#6569) 1a8caa47 Proper text files end with a newline character (#6614) 778e9e9b Freshen-up cirq dependencies (#6616) e4b6ab2f Fix spurious failure of the check/all script (#6611) ee4d7023 enable simulation of controlled gates in classical simulator (#6589) 528b2d2c Update list of pre-release notebooks (#6609) e11d297b Fix nightly build of the staging cirq website (#6615) f246c2be Add Quantum Engine Support for InternalGate (#6613) aa04196e Create a generalized uniform superposition state gate (#6506)

... (truncated)

Commits
  • ab96766 Fix expected package version in the tests
  • 8aa1725 Removing 1.4.0.dev -> 1.4.0
  • ab86979 Flush deprecations before minor release (#6622)
  • a9776d0 Nicer string representation for InverseCompositeGate (#6262)
  • 2cfdf1f Add convenience methods to create PhasedXZ gate from ZYZ decomposition (#6569)
  • 1a8caa4 Proper text files end with a newline character (#6614)
  • 778e9e9 Freshen-up cirq dependencies (#6616)
  • e4b6ab2 Fix spurious failure of the check/all script (#6611)
  • ee4d702 enable simulation of controlled gates in classical simulator (#6589)
  • 528b2d2 Update list of pre-release notebooks (#6609)
  • Additional commits viewable in compare view


You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.30%. Comparing base (5880803) to head (6c016fb). Report is 11 commits behind head on main.

:exclamation: Current head 6c016fb differs from pull request most recent head ad9249d

Please upload reports for the commit ad9249d to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2390 +/- ## ========================================== - Coverage 98.32% 98.30% -0.03% ========================================== Files 87 87 Lines 4059 4003 -56 ========================================== - Hits 3991 3935 -56 Misses 68 68 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cosenal commented 4 weeks ago

In mitiq/benchmarks/randomized_benchmarking.py we use _gate_seq_to_mats from 'cirq.experiments.qubit_characterizations' and that function is no longer there in cirq 1.4.0.

In fact, we should not have code that depends on functions (from external modules) that are intended for internal use (single underscore functions).

bdg221 commented 4 weeks ago

Doing a quick search, I also found:

mitiq/benchmarks/mirror_circuits.py uses _single_qubit_cliffords from cirq.experiments.qubit_characterizations.

mitiq/pec/types/types.py uses _format_coefficient from cirq.value.linear_dict

Both of these functions still exist. _format_coefficient has remained the same for 5 years, while _single_qubit_cliffords was slightly updated in January 2024.

cosenal commented 4 weeks ago

Thanks, @bdg221. Ideally we want to get rid of all of those cirq internal function calls in Mitiq.

cosenal commented 1 week ago

The solution I implemented in commmit ad9249d in this PR only works with cirq-core>=1.4.0. The solution relies on another internal function, _reduce_gate_seq, which was introduced only in Cirq 1.4.0.

This makes the tests break at the moment. However, if we want to support Python 3.12 and drop Python 3.9, we will want to enforce a dependency to cirq-core>=1.4.0 anyway, in which case commit ad9249d will be a valid solution. This will have to come all together in #2066 (cc @natestemen)

dependabot[bot] commented 4 days ago

A newer version of cirq-core exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.