Commit 9e86d36
authored
optimize clifford benchmark circuit creation for a total 94.5% speedup (#6401)
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
```1 parent b3e0eeb commit 9e86d36
File tree
2 files changed
+19
-14
lines changed- cirq-core/cirq
- experiments
- sim/clifford
2 files changed
+19
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | 260 | | |
262 | 261 | | |
263 | | - | |
| 262 | + | |
264 | 263 | | |
265 | 264 | | |
266 | 265 | | |
| |||
271 | 270 | | |
272 | 271 | | |
273 | 272 | | |
274 | | - | |
| 273 | + | |
275 | 274 | | |
276 | 275 | | |
277 | 276 | | |
| |||
560 | 559 | | |
561 | 560 | | |
562 | 561 | | |
563 | | - | |
| 562 | + | |
564 | 563 | | |
565 | | - | |
566 | | - | |
567 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
568 | 572 | | |
569 | 573 | | |
570 | 574 | | |
| |||
609 | 613 | | |
610 | 614 | | |
611 | 615 | | |
612 | | - | |
| 616 | + | |
613 | 617 | | |
| 618 | + | |
614 | 619 | | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
| 620 | + | |
| 621 | + | |
619 | 622 | | |
620 | 623 | | |
621 | 624 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
327 | 330 | | |
328 | | - | |
329 | | - | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| |||
0 commit comments