quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.24k stars 1.01k forks source link

Add functionalty for determining whether pairs of moments commute #6679

Open cdbf1 opened 2 months ago

cdbf1 commented 2 months ago

Currently it is not possible to determine if pairs of moments can commute which may be useful for when collections of operations commute as a group but not individually

For instance a pair of single qubit Z gates commute with a two qubit RXX gate together but not separately.

This PR fixes this challenge by decomposing two moments into operations that act on disjoint sets of qubits and then testing whether their unitary representations on these sets of qubits commute.

Closes #6659

google-cla[bot] commented 2 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 97.82%. Comparing base (6e19d0d) to head (acebb77). Report is 13 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6679 +/- ## ======================================= Coverage 97.82% 97.82% ======================================= Files 1072 1072 Lines 92047 92075 +28 ======================================= + Hits 90045 90074 +29 + Misses 2002 2001 -1 ```

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