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

enable simulation of controlled gates in classical simulator #6589

Closed GregDMeyer closed 5 months ago

GregDMeyer commented 6 months ago

Currently, only X, CNOT, TOFFOLI, SWAP, and measurement are supported by cirq.ClassicalStateSimulator. This pull request adds support for versions of the first four gates with an arbitrary number of controls (as generated by the .controlled() function).

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 97.81%. Comparing base (f246c2b) to head (083f79c). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6589 +/- ## ======================================= Coverage 97.81% 97.81% ======================================= Files 1063 1063 Lines 91761 91796 +35 ======================================= + Hits 89755 89793 +38 + Misses 2006 2003 -3 ```

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

GregDMeyer commented 5 months ago

whoops, I realized why I wasn't seeing the linter errors locally---I was mistaken about what running format-incremental checked for. I thought it was equivalent to pylint but only on changed lines. Anyway all pylint checks seem to pass with my latest commit so I think CI should pass now :-)