Commit 815649c
Update
* Update `_NPY_MAXDIMS`
numpy 1.x supported a maximum of 32 dimensions and then raised an error .. this was an issue for large scale simulations with qubits up to 35 for state vector simulation and up to 18 qubits for density matrix simulations.
As a workaround to support these cases we worked with 1D and 2D arrays for these cases which was very inefficient.
now numpy 2.0 supports up to 64 dimensions
* use the value from numpy instead of hardcoding it
* use suggestion from @maffoo
* Update cirq-core/cirq/linalg/transformations.py
Co-authored-by: Pavol Juhas <[email protected]>
* nit
* Update transformations.py
* Handle negative dimensions in can_numpy_support_shape
And add a direct unit test.
---------
Co-authored-by: Pavol Juhas <[email protected]>_NPY_MAXDIMS (#7167)1 parent b3561b4 commit 815649c
File tree
2 files changed
+16
-3
lines changed- cirq-core/cirq/linalg
2 files changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
807 | 806 | | |
808 | 807 | | |
809 | 808 | | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
810 | 818 | | |
811 | 819 | | |
812 | | - | |
| 820 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
0 commit comments