github quantumlib/Cirq v1.5.0

18 days ago

Cirq v1.5.0 release

Summary

Added support for Python 3.13 and NumPy-2. Deprecated the Cirq-Rigetti
package, which was changed to an opt-in component of the Cirq suite.

Deprecation of Cirq-Rigetti

The Cirq-Rigetti subpackage has been deprecated. For more details or to provide
feedback, see #7058. Cirq-Rigetti needs to be installed explicitly using
pip install cirq-rigetti as it is not included with the cirq installation anymore.
Note that installation of Cirq-Rigetti requires a downgrade to Python 3.12 and NumPy-1.

cirq-core

Added BitMaskKeyCondition to provide multiqubit classical control conditions with bit
masks. Added support to concatenate parameter sweeps as a new sweep. Added preliminary
support for parsing OpenQASM-3. Improved MatrixGate decomposition to compensate for
global phase change. Added function for computing Rényi entropy. Added transformers for
cphase gauge transformation, simulation of depolarizing noise, and for performing
randomized measurement protocol. Added contrib utilities for readout error
benchmarking and an experimental workflow for Z-phase calibration of two-qubit gates.

API change

In next release the default value of the use_repetition_ids argument of the
CircuitOperation will change from True to False. Please pass an explicit
use_repetition_ids=True to preserve the current behavior of the code.

cirq-google

Enhanced serialization capability to support more circuit objects and parameter types
for the cirq-google service backend. Added support for stimcirq gates and operations.
Enhanced sweep proto messages with typed units and optional metadata.
Added support for custom device parameter overrides for circuit execution.

cirq-ionq

Added definitions for the IonQ ZZGate and for device gatesets AriaNativeGateset and
ForteNativeGateset. Added capability for circuit transpilation to native gatesets.

A Huge Thank You

Thank you to all our contributors for this release:

Alessandro Cosentino, Ashiq Firoz, Benno Bielmeier, Bharath Thotakura, Bicheng Ying,
Chamod Perera, Codrut Grosu, Danni Wang, Dave Bacon, Dax Fohl, Divyanshu Verma,
Doug Strain, Eliott Rosenberg, Festus Ayobami Owumi, Gaurav Gyawali, Ilya K. Drozdov,
Jacob Selig, Justin Pan, K M Lau, Matthew Neeley, Michael A. Perlin, Michael Hucka,
Nate Stemen, Nour Yosri, Pavol Juhas, Radu Marginean, Renyi Chen, richrines1,
Rodolfo Carobene, Rohan Jain, Roland Siegbert, Ryan Hill, Rémi Doreau, Seneca Meeks,
Shivansh Mittal, Victory Omole, William Courtney, Yash Gondhalekar

What's Changed

6e47e2e Add classical conditions to cirq_google proto (#7250)
da6ec5d Fix serialization error in cirq_google (#7260)
65a4105 Avoid using NotImplemented as a boolean (#7259)
66c630b Fix typos in XEB (#7254)
6fd52aa Do mild editing for grammar, consistency, and Markdown (#7246)
cc4f208 Correct minor typo in BitMaskKeyCondition (#7251)
b199b21 Fix issue #7245: update docs referring to calibration_api.ipynb (#7253)
9b367de Switch notebooks from dev to stable cirq where possible (#7247)
bdf9249 Fix a few capitalization typos (#7244)
58d9619 Flip back to default use_repetition_ids=True in CircuitOperation (#7237)
5ee16b7 Fix docker installation for cirq_pre_release image (#7240)
0684419 Address pandas warning about deprecated DataFrameGroupBy.apply default (#7235)
0a326d0 Assume PhasedXPowGate is different from XPowGate and YPowGate (#7070)
d39112e Add tuples, ndarrays, and complex numbers to cirq_google proto (#7226)
9fd4751 Ignore spurious PollerCompletionQueue errors in AsyncioExecutor (#6492)
02941bf Allow _mixture_ to return gates instead of just raw unitary matrices (#7048)
d87d87e Fix EigenGate equality (#7057)
a68adcd Compensate for global phase in MatrixGate decomposition (#7118)
5a81b3d Remove previously deprecated fields in cirq_google proto (#7183)
4436b85 Test qcircuit pdf generation without extra prepare_only argument (#7227)
9cb81ad Switch to unquoted type annotations part 1 (#7193)
24b07a8 Fix ALL THE COVERAGE (#7220)
d909a6e Recommend use of unquoted annotations in coding style guide (#7222)
11f0f51 Clarify docstring of is_parameterized (#7215)
c34989b Improve cirq-dev installation command (#7213)
f6187b3 Better stimcirq serialization (#7192)
efabff1 Resolve issue #7000 by adding PR labeler workflow (#7203)
586b3f6 Change a list of if statements into match (#7204)
75f0dd3 Add bytes to cirq_google proto (#7201)
4b87002 Revise Community section (#7199)
b140970 Fix #5497: update IonQ docs to remove decompose_operation (#7198)
8a3d1ef Create a new condition that allows easy control by bitmasks (#7166)
4819570 Update and make minor additions to docs/ in time for Cirq 1.5 (#7175)
250f129 Sort import statements - no change in the effective code (#7195)
fa18b82 Improve check of expected shell commands in check/format-incremental (#7196)
0f652e1 Update Zenodo info & correct a small typo (#7191)
c3d315e Fix isort invocation in format-incremental (#7194)
3b268c2 Add isort for import linting (#7181)
cdbc196 Avoid frequent test failure in greedy_test.py by increasing timeout (#7188)
c95af3e Fix WaitGate for multiple qubits in cirq_google proto (#7189)
53d3331 Simplify python package description (#7187)
0eea89e Fix flakes in pauli_string_measurement_with_readout_mitigation_test (#7185)
80a63b9 Fix np.einsum type annotations (#7184)
815649c Update _NPY_MAXDIMS (#7167)
b3561b4 Add a tool for measuring expectation values of Pauli strings with readout error mitigation (#7067)
eddb281 Add boolean support to cirq_google protos (#7177)
ea1679d Deprecate Cirq-Rigetti (#7176)
71c3cf1 Clarify the license statement for examples/ (#7173)
aaa66f6 Decouple cirq package from cirq-rigetti (#7170)
4bdf21f Add missing license files & do minor updates to dot files (#7161)
2bfa1cd Add info to CITATION.cff (#7140)
43d033b Add ability to add custom tag (de)serializers (#7169)
840bb2b Avoid Moment typechecks when (un)freezing circuits (#7150)
ce31720 Fix moment commutation detection for group-commuting operations (#7082)
0551f85 Allow cirq-google installation with protobuf-5 (#7147)
5d59cf7 Ensure InsertStrategy.NAME is identical after pickle round-trip (#7138)
abf6051 Update pass_operations_over with fixed conjugated_by (#7123)
e014f4d Small fixes of linalg.decompositions (#7128)
b3af2ee Fix nondeterminacy in Circuit.insert (simplified) (#7043)
8073d4c Fix deserialization of reset gates when dimensions missing (#7135)
5e7bc33 Add missing import of qiskit.qasm2 in unit test (#7137)
2167552 Support for stimcirq gates and operations in cirq_google protos (#7101)
78d30e7 Remove sweep_must_pass (#7124)
927f600 Add cphase_gauge (#7111)
fe72856 cirq-google - get CZ gate noise properties from engine calibration data (#7116)
3b9eceb Add magic square game (#7109)
6ff3d66 [Bugfix] Re-allow non-integral line/grid qubits (#7110)
2ad4136 Correct the sweep order example in the docstring (#7104)
fe946a1 Use fixed PauliString.after() (#7103)
22ed25e Fix conjugated_by of PauliString (#7065)
8f2f198 Ensure SycamoreGate instances are preserved over serialization (#7093)
61548e0 Fix decompose for controlled CZ gates with phase shift (#7071)
60551b4 Partial support of reset gate in cirq_google protos (#7095)
09432f6 Fix #6970: mention release cadence (#7099)
d8ec3e4 Remove apt package pandoc and add shellcheck (#7096)
094eb9a Add badge for OpenSSF score (#7097)
9604ab1 Add warning about GenAI code generation (#7098)
7a834a0 Remove arg_function_language (#7092)
96583fe Add a .editorconfig file (#7081)
931bc66 Increase min version of Python Requests for multiple security advisories (#7075)
aee2c30 Support parameters in InternalTag (#7060)
e3b46a1 Increase min version of Python tqdm for security (#7076)
f30e6d4 Remove rST-specific code in snippets_test.py (#7085)
a2bf6e8 Add workflow for OpenSSF Scorecard (#7074)
ca6ceb3 Allow ability to plug in custom (de)serializers for cirq_google protos (#7059)
d5c2b41 Make mypy pass no matter if qsimcirq is installed or not (#7063)
dd3df78 Fix the format of CliffordGate repr (#7046)
bc9fc97 Improve the readability of CliffordTableau _full_str_ function (#7047)
1c55f3f Partial Support for tags in cirq_google protos (#7044)
83f3579 Add NDArrays to cirq-google protos (#7032)
e2de439 Remove [float,int] unions from type declarations (#7042)
7f46121 Add InternalTag to support non-public tags (#7040)
72e1d20 Clean up redundant complex type unions (#7041)
14d61c8 Compile to ZZ gate instead of MS for Forte backends when transpiling to native IonQ gates (#6973)
d589bfc Move coverage configuration to pyproject.toml (#7038)
dee2c5c Allow symbolic scalars in linear combinations (#7030)
35322ae Specify long_description_content_type so that PyPI accepts wheels (#7035)
cc82f52 Fix QASM lexer when identifiers start with keywords (#7018)
6c9db55 Move moment index into circuit message (#7008)
5c198ce Allow symbolic scalars in LinearDict (#7003)
0e5db12 Enable test of the Contract-a-Grid-Circuit.ipynb notebook (#7015)
5e8466b Avoid CI flake due to random-seed-dependent test (#7016)
6b2f4d7 Update and refresh cirq-* module README files (#6900)
aba898c Minor edits and updates to Markdown files in docs/ (#7009)
bb10251 Reformat miscellaneous .md files outside of docs/ (#6999)
d936ee3 Overhaul top-level README and convert to Markdown (#6988)
4a12309 doctest - exclude third-party sources in node_modules (#7011)
3208b94 Add snapshot_id to get_sampler interface on engine object (#7005)
08b1efb Streamline proto serialization of circuits with duplicate operations (#6991)
6ebc78b Fix check/nbformat installation and execution (#7004)
0e5df4e Fix mapped measurement keys of repeat_until fields in CircuitOperations (#6881)
e6c1101 Fix logic for handling repetition_ids in CircuitOperation.replace (#6984)
785fd1c Update .markdownlintrc (#6990)
d150371 Bump grpcio-tools from 1.59 to 1.62 (#6976)
238ce87 Use encoding UTF-8 when opening files (#6989)
ab62c25 CI - run the pytest-numpy-2 job also with Python 3.13 (#6974)
b4190e9 Add PyPI keywords and edit maintainers name (#6992)
b73eb28 Add a default fallback for the equal_up_to_global_phase protocol (#6950)
435f3e1 Support numpy qid indexes (#6987)
79d562a Update scientific Python core dependencies per NEP-29 and SPEC-0 (#6975)
0f21e0a Implement _value_equality_approximate_values_ for PhasedISwapPowGate (#6959)
48aadd0 Perf optimization for building circuits using only appends (#6882)
ebbaad6 Replace OpTree with OP_TREE (#6960)
4206cb1 Fix classical conditions getting optimized ahead of their measurements (#6872)
870860f Optimize qubit hash for Set operations (#6908)
eec204f Add a function for running circuits in a shuffled order with readout error benchmarking (#6945)
9945db6 Apply as_sweep for SqrtCZGauge (#6931)
55c592b [cleanup] Remove unused GridParallelXEBMetadata class (#6909)
05bb69a Refactor engine client test_create_job test names for better clarity and consistency (#6885)
0a955cc Correct noise channel approximate equality (#6632)
426178b Revert "#6586 - Avoid DivisionByZero error when TensorNetwork simplifies to a scalar" (#6958)
2b49589 Support custom gate defintions in QASM parser (#6917)
3a835dd Add a new sweep metadata from/to proto approach (#6925)
1efa25c Add construction examples to docstrings of ClassicallyControlledOperation (#6913)
57d9d21 Streamline proto serialization of circuits with duplicate moments (#6941)
5ab7869 Improve __pow__ for SingleQubitCliffordGate (issue #6327) (#6919)
be8b04b Pass sweep_transformer recursively (#6951)
df776a0 Add YAML file linter (#6896)
0b796d1 Fix order preservation in align_right (#6899)
84adca9 Handle qudits in drop_terminal_measurements (#6879)
2949afd Improve __str__ and __repr__ for SingleQubitCliffordGate (issue #6326) (#6920)
b127bb7 Consider all-false invert_mask equal to no invert_mask (#6952)
2933c72 Fix qasm tests for qiskit 1.0 (#6927)
0361a81 Fix dd issue in calling PauliString.after (#6943)
cd9a3ff Remove notebooks refering to removed service (#6580)
63e4c7d Disallow passing types as tags (#6947)
326a287 Add Markdown file linter (#6895)
f596c43 Make qubits a memoized property of Moment (#6894)
7f66b42 Add info to examples/README.rst & convert to Markdown (#6889)
7bb36c3 Remove references to run_batch in engine docs (#6948)
988ecbc Adjust some more TeX expressions for rendering in web docs (#6942)
3a13041 Support inverse gate JSON seralization (#6912)
5d317ba Add recommended files for community support & update CONTRIBUTING.md (#6898)
dbada0e Add bitwise option to Sympy evaluator for classical controls (#6914)
ecf9ed7 Re-enable streaming Engine interface (#6930)
bb86fb1 Avoid flaky test execution in z_phase_calibration_test (#6928)
9ada8a8 Fix flaky curve fitting tests (#6916)
25b3362 Fix diagram for Identity with no qubits (#6926)
3e16e15 Apply as_sweep for iswap_gauge, spin_inversion_gauge, sqrt_iswap_gauge (#6911)
b5a04f0 Fix documentation for PhasedXZGate (#6870)
5ffb3ad CircuitOperation: change use_repetition_ids default to False (#6910)
b840178 Add metadata into single sweep (#6869)
83a8e0e Add examples for transform_qubits function (#6915)
c5d29fe Add documentation for QASM export (#6891)
4ad58f6 Return NotImplemented for diagram info for empty PauliStringPhasors (#6880)
0f8701f Add more informative message for improper cirq.qasm arguments (#6905)
59ab27a Infer QASM for classical KeyConditions in circuit (#6871)
32bf399 Fix exponent location on classically controlled diagrams (#6897)
e446d74 Replace references to "master" branch with "main" (#6888)
686766f Support run_sweep in GaugeTransformer. Pioneered in the CZ Gauge (#6852)
29d99d3 Create a transformer cancels the effect of Z-phases (#6837)
0d9a6ee Allow passing a callable to de/serialization funcs (#6855)
324a086 Make DensityMatrixSimulator more numerically stable (#6850)
ea605d4 Disable local Google Cloud credentials in tests (#6851)
4d03aea Add ability to pass tags to XEB and related methods (#6836)
2e79aa7 Support serialization of sweeps with tunits (#6829)
f07a4b5 Add Concat to cirq-google sweep proto (#6821)
e9fbabc Support "cu1", "cu3", and "crz" in QasmParser (#6820)
def1b08 Add Concat to Sweeps (#6819)
35733fd Disable streaming by default (#6818)
e61e3be Add zip_longest support to the cirq_google sweep proto (#6815)
495d913 Divert cirq.Sampler's run_batch to run_batch_async (#6813)
429bb9b Add parsing of the reset instruction to QASM parser (#6710)
550555d Vectorize readout mitigation (#6812)
d760f00 Add option to specify batch size (#6809)
e0087b0 Allow measurement keys with differing qubits in OpenQASM (#6803)
76125a2 Force decimals in scientific notation for OpenQASM 2.0 (#6802)
02f2f84 Preliminary support for parsing OpenQASM 3.0 (#6797)
2991e80 Update docs to use quantumai-oss-maintainers@googlegroups.com (#6804)
7096acd Fix Moment.resolve_parameter for constant sympy expressions (#6794)
f2c7330 Preliminary support for outputting to OpenQASM 3.0 (#6795)
326df25 Add custom args to value equality (#6799)
dc8a43b Fix phase_by protocol for tagged operations (#6792)
30f5b48 Create a way to encode general functions (#6788)
fd95547 Replace type_workarounds.NotImplementedType with types.NotImplementedType (#6790)
d1b0430 Add DynamicalDecouplingTag to cirq-google (#6782)
4bc068c Add throttle for jobs run with ProcessorSampler (#6786)
170b20b Parallel XEB: Add option to specify pairs (#6787)
59be462 Create workflow for Z-phase calibration (#6728)
81d3fd9 Limit the number of db reads using duet.Limiter (#6783)
ae6e4e4 Support TUnits in circuit serialization (#6781)
c0b8aed Batch circuit submit in cirq_ionq (#6652)
7a7ef2b Create an insertion_sort transformer and incorporate it into the transpiling protocol (#6776)
f9ed148 Transpile to native IonQ gates (#6572)
81f66b9 Add request limiter when polling for results (#6774)
351a08e Add TypedUnits to the requirements of cirq-google (#6773)
01b0c12 Update pyquil dependency and remove workaround pinning of quil (#6763)
e8e53da Mark QSD QFT5 with xfail (#6767)
9ff9b6b Use pytest fixture for multiprocessing Pool in XEB tests (#6766)
54f9e8c Allow external users to use snapshot_id (#6739)
5718365 Fix Quantum Shannon Decomposition (#6756)
9520466 coverage - exclude code guarded by if TYPE_CHECKING (#6753)
769ad50 Update copyright checker and switch to pylint-3 (#6751)
55b2c30 CI - fix flaky type check failure in cirq.vis.heatmap (#6750)
95f6a3f CI - fix flakiness of stream_manager_test on Windows (#6749)
ce1d903 Restore cirq_google.api.v2 protos deleted in 6442 (#6746)
756abe3 Dynamical decoupling: Support pulling through the whole circuit with non-clifford moments (#6718)
bb24dae Update the const proto field name (#6744)
2bbc3c4 CI - add temporary job pytest-numpy-2 to test with NumPy-2 on Ubuntu (#6740)
3fefe29 Fix #6706 – Update sources for compatibility with NumPy 2 (#6724)
d15549c Exclude conftest.py files from enforcing changed-code coverage (#6738)
484df6f Silence pytest warnings about asyncio fixture scope (#6736)
ad29fa8 Fix Rigetti check for Aspen family device kind (#6734)
d74e0dc Add support for const sweep with None (#6729)
2adc218 Implement and enforce explicit re-export for cirq modules (#6722)
19af193 Update node dependencies & generate bundled JavaScript files (#6720)
f56a799 Introduce a generic value type for DeviceParametersDiff proto (#6712)
f0ead96 Limit maximum multiprocessing pool size in xeb tests (#6713)
6037f18 Update sources for mypy-1.11.1 (#6707)
e3fbf20 Stop using deprecated module pkg_resouces (#6708)
d94c457 Add IdentityGate._commutes_ (#6702)
8d8a6c5 Enable pulling through Clifford operations, also add an option of only applying dd to single qubit gate moments (#6675)
1640116 Avoid CI flakes due to random-seed-dependent unit tests (#6700)
e2e8aef Mark ProjectorSum class as unhashable (#6701)
5377fff Test hash consistency of cirq objects loaded from a pickle (#6677)
51e8c3d Fix recent type check failure in the CI (#6699)
c6b69a2 Update NumPy APIs that will be removed in numpy-2.0 (#6693)
cd3182a Move Coupler to cirq_gooogle.ops (#6697)
978b5e3 Add serialization for Coupler Qids (#6682)
3fee420 Add validation for couplers (#6681)
60ab3c0 Eliminate awful slowdown of EigenGate._value_equality_values_ (#6695)
2e51014 Fix docstrings for the ionq GPIGate and GPI2Gate (#6694)
c25678e np.infty no longer supported in NumPy 2.0 (#6692)
94f1e09 Exclude all setup.py files from typecheck (#6690)
bae02e4 Allow using protobuf version 5 and later (#6683)
c58a05c Add GridCoupler Qid to cirq_google (#6678)
bc4cd6d Added random single-qubit CUE and Clifford gates (#6670)
45a6bbb Fix XEB error rate computation (#6673)
ee934fe Use np.complex128 for simulating xeb circuits (#6672)
df20ade Fix bug that caused XEB to fail when requesting depth > 100 (#6671)
8d09a32 Fix equality for cphase gate initialized with sympy constant (#6669)
75b3f40 Adds tools for appending randomized measurement bases and processing renyi entropy from bitstring (#6664)
3922a63 Add noise amplification transformer (#6665)
5d22a53 Support creating XEB calibration options for arbitary FSim like gates (#6657)
590a9f5 Update files to conform to new mypy standard (#6662)
32d4833 Change to optimize_for_target_gateset in docs (#6658)
da5c3b5 Add uncorrelated readout error mitigation for arbitrarily long Pauli strings (#6654)
ac63c60 cirq_pasqal getting_started.ipynb - enforce single operation per moment (#6656)
9c836ba Fix error on MSGate unitary matrix (#6645)
4b8e8e4 Enforces specifying run_name and device_config_name on Engine interfaces (#6649)
0aae3c1 CI - add Python 3.12 tests to ci-daily (#6605)
71c79da Allow highlighting a subset of qubits when displaying heatmap (#6642)
2c993f8 Pass metadata to sweeps (#6644)
5f7881f Remove implicit thread creation in XEB sampling (#6643)
03aa511 Allow passing None to AbstractCircuit.from_moments (#6637)
ac3a70f Make implicit Optional type hints in Quantum Engine PEP 484 compliant (#6640)
543d9cd Fix Xa*Zb*Zb*Zb works but Xa*Zb**3 (#6618)
16de069 Improve replace_version tool and development wheels (#6626)
d077532 Add a new proto DeviceParametersDiff which provides a compact way to bundle multiple DeviceParameters and their values (#6583)

Don't miss a new Cirq release

NewReleases is sending notifications on new releases.