Skip to content

Commit eb2c98a

Browse files
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
1 parent 8cde2ba commit eb2c98a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cirq-core/cirq/linalg/transformations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# user provides a different np.array([]) value.
3030
RaiseValueErrorIfNotProvided: np.ndarray = np.array([])
3131

32-
_NPY_MAXDIMS = 32 # Should be changed once numpy/numpy#5744 is resolved.
32+
_NPY_MAXDIMS = 64
3333

3434

3535
def reflection_matrix_pow(reflection_matrix: np.ndarray, exponent: float):

0 commit comments

Comments
 (0)