Skip to content
Snippets Groups Projects
Commit d4f2faea authored by patavirt's avatar patavirt
Browse files

tests: fix factors of i

parent 2ab1fb98
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ def basic_setup(terminals=False, nx=15, ny=5):
Delta[2:, :2] = np.eye(2)
s = usadelndsoc.solver.Solver(nx=nx, ny=ny)
s.Omega[...] = Delta
s.Omega[...] = 1j * Delta
s.alpha = 0.0
s.Lx = 10
s.Ly = 10
......@@ -48,7 +48,7 @@ def test_result_S_J0():
res = s.solve_many(omega=0.5 + 0.8j)
S = res.S
vol = s.Lx * s.Ly / (s.shape[0] * s.shape[1])
vol = s.Lx * s.Ly / (s.shape[0] * s.shape[1]) * 4j
assert_allclose(S[:, :, :2, :2], vol * res.G)
assert_allclose(S[:, :, :2, 2:], vol * res.F)
......
......@@ -9,6 +9,7 @@ from usadelndsoc.solver import *
from usadelndsoc.bcs import BCS_Delta
try:
raise ImportError()
import usadel1
except ImportError:
usadel1 = None
......@@ -25,15 +26,16 @@ def example_sns_1d(phi, L, nx=500, ny=1, Delta0=1.0, alpha=0.0):
solver.Omega[...] = 0
solver.Omega[0, :, :2, 2:] = Delta0 * np.exp(-1j * phi / 2) * np.eye(2)
solver.Omega[0, :, 2:, :2] = Delta0 * np.exp(+1j * phi / 2) * np.eye(2)
solver.Omega[0, :, :2, 2:] = 1j * Delta0 * np.exp(-1j * phi / 2) * np.eye(2)
solver.Omega[0, :, 2:, :2] = 1j * Delta0 * np.exp(+1j * phi / 2) * np.eye(2)
solver.Omega[-1, :, :2, 2:] = Delta0 * np.exp(+1j * phi / 2) * np.eye(2)
solver.Omega[-1, :, 2:, :2] = Delta0 * np.exp(-1j * phi / 2) * np.eye(2)
solver.Omega[-1, :, :2, 2:] = 1j * Delta0 * np.exp(+1j * phi / 2) * np.eye(2)
solver.Omega[-1, :, 2:, :2] = 1j * Delta0 * np.exp(-1j * phi / 2) * np.eye(2)
return solver
@pytest.mark.slow
def test_example_sns_1d():
# Test against analytic solution
omega = 30
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment