Skip to content

Optimize qid comparisons#6386

Merged
maffoo merged 1 commit intomainfrom
u/maffoo/qid-cmp
Dec 18, 2023
Merged

Optimize qid comparisons#6386
maffoo merged 1 commit intomainfrom
u/maffoo/qid-cmp

Conversation

@maffoo
Copy link
Copy Markdown
Contributor

@maffoo maffoo commented Dec 18, 2023

Qid comparison turns out to be a very common operation when manipulating circuits, for example when computing the hash of a moment we sort operations by qubits in order to have a canonical order for hashing. Here we optimize the comparison of common qid types for grid, line, and named qubits.

@maffoo maffoo requested a review from dstrain115 December 18, 2023 19:00
@maffoo maffoo requested review from a team, cduck and vtomole as code owners December 18, 2023 19:00
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2f3c1e2) 97.81% compared to head (4066f83) 97.81%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6386   +/-   ##
=======================================
  Coverage   97.81%   97.81%           
=======================================
  Files        1111     1111           
  Lines       96951    97001   +50     
=======================================
+ Hits        94828    94878   +50     
  Misses       2123     2123           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maffoo maffoo merged commit e3fbd98 into main Dec 18, 2023
@maffoo maffoo deleted the u/maffoo/qid-cmp branch December 18, 2023 19:30
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants