quantumlib / Cirq

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

Check identity first when comparing circuits #6375

Closed maffoo closed 11 months ago

maffoo commented 11 months ago

Add identity check to short-circuit exact and approximate equality checks on cirq.AbstractCircuit and subclasses. Also change the implementation of __eq__ to avoid creating new tuples of moments; instead we check the length and then zip over the moments.

codecov[bot] commented 11 months ago

Codecov Report

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

Comparison is base (be7b059) 97.80% compared to head (c494dfa) 97.81%. Report is 8 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6375 +/- ## ======================================== Coverage 97.80% 97.81% ======================================== Files 1111 1111 Lines 96877 97037 +160 ======================================== + Hits 94754 94914 +160 Misses 2123 2123 ```

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