added pprint and a bunch of output print for debugging

class-solution
Daniel Pozsar 3 months ago
parent 71eb8cfd70
commit ed74755240

@ -19,6 +19,7 @@
# SOFTWARE. # SOFTWARE.
from itertools import permutations, product from itertools import permutations, product
from pprint import pprint
import numpy as np import numpy as np
from scipy.special import roots_legendre 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, 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])]), # 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 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 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 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("Isotropic: ", J_iso)
print("DMI: ", D) print("DMI: ", D)
print("Symmetric-anisotropy: ", J_S) 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("")
print( print(

Loading…
Cancel
Save