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

Add an optional CompilationTargetGateset postprocessor to contract the circuit #6433

Closed NoureldinYosri closed 9 months ago

NoureldinYosri commented 9 months ago

fixes https://github.com/quantumlib/Cirq/issues/6422 as suggested by @tanujkhattar https://github.com/quantumlib/Cirq/issues/6422#issuecomment-1915363510

calling optimize_for_target_gateset with gateset=cirq.CZTargetGateset(preserve_moment_structure=False) and max_num_passes equal a value >= 2 or None) produces the desired result

codecov[bot] commented 9 months ago

Codecov Report

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

Comparison is base (5dd05bf) 97.81% compared to head (089bc2a) 97.81%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6433 +/- ## ======================================= Coverage 97.81% 97.81% ======================================= Files 1111 1111 Lines 97167 97198 +31 ======================================= + Hits 95047 95078 +31 Misses 2120 2120 ```

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