From d4f2faea67d3b995893f8edb29c8569091523c90 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen <pauli.t.virtanen@jyu.fi> Date: Mon, 29 Aug 2022 12:36:42 +0300 Subject: [PATCH] tests: fix factors of i --- tests/test_basic.py | 4 ++-- tests/test_solver.py | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/test_basic.py b/tests/test_basic.py index 21ef438..3dcc8f7 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -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) diff --git a/tests/test_solver.py b/tests/test_solver.py index 9f477cc..f478a73 100644 --- a/tests/test_solver.py +++ b/tests/test_solver.py @@ -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 -- GitLab