Commit fd73593
authored
Change asserts in qsimcirq/qsim_simulator.py to raise errors instead (#1036)
Replace assert statements in qsimcirq/qsim_simulator.py with explicit if
checks that raise TypeError and ValueError. This ensures that validation
of qsim_state dtype and ndim is always performed, even when Python
optimizations are enabled.1 parent 11e5942 commit fd73593
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
529 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
530 | 532 | | |
531 | 533 | | |
532 | 534 | | |
| |||
0 commit comments