Commit b43a2f3
authored
Correctly enforce matrix size check in
* Fixed the matrix size check for non-cachable gates in the commutation checker.
A typo in the matrix size check allowed to sneak into a matrix-based check even if the operations exceeded the maximum matrix size. The operations `first_..` and `second_..` are sorted, but `..1` and `..2` are not! The wrong one was used here.
* Reduce test size
This test now doesn't rely on the internal path panicking, but still tests the right behavior since the results with and without a matrix check differ.CommutationChecker (#15933)1 parent 50c18fa commit b43a2f3
3 files changed
Lines changed: 27 additions & 3 deletions
File tree
- crates/transpiler/src
- releasenotes/notes
- test/python/circuit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
573 | | - | |
574 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
504 | 522 | | |
505 | 523 | | |
506 | 524 | | |
| |||
0 commit comments