From ed74755240f2237c4ce7f81f3787c3d21bace7bc Mon Sep 17 00:00:00 2001 From: Daniel Pozsar Date: Wed, 30 Oct 2024 15:18:52 +0100 Subject: [PATCH] added pprint and a bunch of output print for debugging --- src/grogu_magn/useful.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/grogu_magn/useful.py b/src/grogu_magn/useful.py index 55adb34..07aecc1 100644 --- a/src/grogu_magn/useful.py +++ b/src/grogu_magn/useful.py @@ -19,6 +19,7 @@ # SOFTWARE. from itertools import permutations, product +from pprint import pprint import numpy as np from scipy.special import roots_legendre @@ -221,7 +222,7 @@ def calculate_exchange_tensor(pair): # dict(o=np.array([0, 1, 0]), vw=[np.array([1, 0, 0]), np.array([0, 0, 1])]), # dict(o=np.array([0, 0, 1]), vw=[np.array([1, 0, 0]), np.array([0, 1, 0])]), - J_ii = np.array([o2[-1], o3[0], o1[0]]) # xx, yy, zz + J_ii = np.array([o2[-1], o1[0], o1[-1]]) # xx, yy, zz J_S = -0.5 * np.array([o3[1] + o3[2], o2[1] + o2[1], o1[1] + o1[2]]) # yz, zx, xy D = 0.5 * np.array([o1[1] - o1[2], o2[2] - o2[1], o3[1] - o3[2]]) # x, y, z return J_ii.sum() / 3, np.concatenate([J_ii[:2] - J_ii.sum() / 3, J_S]).flatten(), D @@ -365,6 +366,15 @@ def print_output(simulation_parameters, magnetic_entities, pairs, dh, times): print("Isotropic: ", J_iso) print("DMI: ", D) print("Symmetric-anisotropy: ", J_S) + print("Energies for debugging: ") + pprint(np.array(pair["energies"])) + print( + "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)" + ) + o1, o2, o3 = pair["energies"] + pprint(np.array([o2[-1], o3[0], o1[0]])) + print("Test J_xx = E(y,z) = E(z,y)") + print(o2[-1], o3[-1]) print("") print(