Skip to content

Commit 4e2d4fd

Browse files
committed
Use np.kron instead of scipy.kron
SciPy 1.15 warns that the `kron` method is going away and that people should use the NumPy version of `kron`.
1 parent 9875c48 commit 4e2d4fd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/openfermion/circuits/gates/common_gates_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# limitations under the License.
1212
import numpy as np
1313
import pytest
14-
from scipy.linalg import expm, kron
14+
from scipy.linalg import expm
1515
import cirq
1616

1717
import openfermion
@@ -84,8 +84,8 @@ def test_compare_ryxxy_to_cirq_equivalent(rads):
8484
def test_rxxyy_unitary(rads):
8585
X = np.array([[0, 1], [1, 0]])
8686
Y = np.array([[0, -1j], [1j, 0]])
87-
XX = kron(X, X)
88-
YY = kron(Y, Y)
87+
XX = np.kron(X, X)
88+
YY = np.kron(Y, Y)
8989
np.testing.assert_allclose(
9090
cirq.unitary(openfermion.Rxxyy(rads)), expm(-1j * rads * (XX + YY) / 2), atol=1e-8
9191
)
@@ -97,8 +97,8 @@ def test_rxxyy_unitary(rads):
9797
def test_ryxxy_unitary(rads):
9898
X = np.array([[0, 1], [1, 0]])
9999
Y = np.array([[0, -1j], [1j, 0]])
100-
YX = kron(Y, X)
101-
XY = kron(X, Y)
100+
YX = np.kron(Y, X)
101+
XY = np.kron(X, Y)
102102
np.testing.assert_allclose(
103103
cirq.unitary(openfermion.Ryxxy(rads)), expm(-1j * rads * (YX - XY) / 2), atol=1e-8
104104
)

0 commit comments

Comments
 (0)