Commit 31f616f
committed
Use the peephole pass heuristic for best synthesis selection
Previously there was a mismatch between the scoring of synthesis
results and the peephole pass's comparison with the original block. The
pass is documented as using the tuple (num_2q_gates, error, num_gates)
and picking the min of all the choices. But, when we called the unitary
synthesis function that selects the best synthesis outcome it was
maximizing the estimated fidelity but not considering the gate counts
like the pass is documented as doing. This corrects this mismatch by
updating the function doing the synthesis to be generic on score type
and taking a scorer callback. This lets the peephole pass control the
heuristic used for selecting the best score.1 parent 56ea5aa commit 31f616f
2 files changed
Lines changed: 60 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
62 | 82 | | |
63 | 83 | | |
64 | 84 | | |
| |||
108 | 128 | | |
109 | 129 | | |
110 | 130 | | |
| 131 | + | |
111 | 132 | | |
112 | 133 | | |
113 | 134 | | |
| |||
152 | 173 | | |
153 | 174 | | |
154 | 175 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
160 | 186 | | |
161 | 187 | | |
162 | 188 | | |
163 | | - | |
| 189 | + | |
164 | 190 | | |
165 | 191 | | |
166 | 192 | | |
| |||
183 | 209 | | |
184 | 210 | | |
185 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
186 | 217 | | |
187 | 218 | | |
188 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
487 | 489 | | |
488 | 490 | | |
489 | 491 | | |
490 | | - | |
| 492 | + | |
491 | 493 | | |
492 | 494 | | |
493 | | - | |
| 495 | + | |
494 | 496 | | |
495 | 497 | | |
496 | 498 | | |
| |||
544 | 546 | | |
545 | 547 | | |
546 | 548 | | |
547 | | - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
548 | 554 | | |
549 | 555 | | |
550 | 556 | | |
551 | 557 | | |
552 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
553 | 564 | | |
554 | 565 | | |
555 | 566 | | |
| |||
611 | 622 | | |
612 | 623 | | |
613 | 624 | | |
614 | | - | |
| 625 | + | |
615 | 626 | | |
616 | | - | |
| 627 | + | |
617 | 628 | | |
618 | 629 | | |
619 | 630 | | |
| |||
624 | 635 | | |
625 | 636 | | |
626 | 637 | | |
627 | | - | |
| 638 | + | |
628 | 639 | | |
629 | 640 | | |
630 | 641 | | |
| |||
636 | 647 | | |
637 | 648 | | |
638 | 649 | | |
639 | | - | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
640 | 653 | | |
641 | 654 | | |
642 | 655 | | |
| |||
0 commit comments