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

Don't create a new list of qubits in `Gate.on` #6390

Closed maffoo closed 11 months ago

maffoo commented 11 months ago

The value received from *qubits is a tuple, and GateOperation.__init__ would immediately convert the passed-in list back to a tuple anyway, so we can save on lots of small allocations by just passing the tuple of args through to GateOperation.

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 (efe2c67) 97.81%. Report is 12 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6390 +/- ## ======================================== Coverage 97.80% 97.81% ======================================== Files 1111 1111 Lines 96877 97054 +177 ======================================== + Hits 94754 94931 +177 Misses 2123 2123 ```

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