File tree Expand file tree Collapse file tree
src/openfermion/circuits/gates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111# limitations under the License.
1212import numpy as np
1313import pytest
14- from scipy .linalg import expm , kron
14+ from scipy .linalg import expm
1515import cirq
1616
1717import openfermion
@@ -84,8 +84,8 @@ def test_compare_ryxxy_to_cirq_equivalent(rads):
8484def 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):
9797def 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 )
You can’t perform that action at this time.
0 commit comments