Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize clifford benchmark circuit creation for a total 94.5% speedup #6401

Merged
merged 14 commits into from
Jan 8, 2024

Conversation

NoureldinYosri
Copy link
Collaborator

@NoureldinYosri NoureldinYosri commented Jan 8, 2024

This is a followup to #6392 and reduces circuit creation time (for 1000 cliffords and 50 qubits) to 0.213s from the original 3.886s (94.5% speedup) and the 2.148s (90% speedup) following #6392

In [3]: import cirq.experiments.qubit_characterizations as ceq
   ...: import cirq
   ...: import time
   ...: import numpy as np
   ...: 
   ...: num_cliffords = 1000
   ...: qubits = cirq.LineQubit.range(50)
   ...: 
   ...: cliffords = ceq._single_qubit_cliffords()
   ...: c1 = cliffords.c1_in_xy
   ...: t1 = time.time()
   ...: seq = ceq._create_parallel_rb_circuit(qubits, num_cliffords, c1)
   ...: t2 = time.time()
   ...: print(f'{t2-t1} s')
0.2055680751800537 s

@NoureldinYosri NoureldinYosri requested a review from maffoo January 8, 2024 21:03
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d33b1a7) 97.81% compared to head (0458700) 97.81%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6401   +/-   ##
=======================================
  Coverage   97.81%   97.81%           
=======================================
  Files        1111     1111           
  Lines       97054    97088   +34     
=======================================
+ Hits        94931    94965   +34     
  Misses       2123     2123           

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

@NoureldinYosri NoureldinYosri enabled auto-merge (squash) January 8, 2024 22:26
@NoureldinYosri NoureldinYosri merged commit 9e86d36 into main Jan 8, 2024
38 checks passed
@dabacon
Copy link
Collaborator

dabacon commented Jan 18, 2024

Nice work!

harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
quantumlib#6401)

This is a followup to quantumlib#6392 and reduces circuit creation time (for 1000 cliffords and 50 qubits) to 0.213s from the original 3.886s (94.5% speedup) and the 2.148s (90% speedup) following quantumlib#6392

```
In [3]: import cirq.experiments.qubit_characterizations as ceq
   ...: import cirq
   ...: import time
   ...: import numpy as np
   ...: 
   ...: num_cliffords = 1000
   ...: qubits = cirq.LineQubit.range(50)
   ...: 
   ...: cliffords = ceq._single_qubit_cliffords()
   ...: c1 = cliffords.c1_in_xy
   ...: t1 = time.time()
   ...: seq = ceq._create_parallel_rb_circuit(qubits, num_cliffords, c1)
   ...: t2 = time.time()
   ...: print(f'{t2-t1} s')
0.2055680751800537 s
```
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.

3 participants