|
|
|
@ -1,27 +1,28 @@
|
|
|
|
|
import os
|
|
|
|
|
from sys import stdout
|
|
|
|
|
from tqdm import tqdm
|
|
|
|
|
from timeit import default_timer as timer
|
|
|
|
|
|
|
|
|
|
from tqdm import tqdm
|
|
|
|
|
|
|
|
|
|
os.environ["OMP_NUM_THREADS"] = "1" # export OMP_NUM_THREADS=4
|
|
|
|
|
os.environ["OPENBLAS_NUM_THREADS"] = "1" # export OPENBLAS_NUM_THREADS=4
|
|
|
|
|
os.environ["MKL_NUM_THREADS"] = "1" # export MKL_NUM_THREADS=6
|
|
|
|
|
os.environ["VECLIB_MAXIMUM_THREADS"] = "1" # export VECLIB_MAXIMUM_THREADS=4
|
|
|
|
|
os.environ["NUMEXPR_NUM_THREADS"] = "1" # export NUMEXPR_NUM_THREADS=6
|
|
|
|
|
|
|
|
|
|
import warnings
|
|
|
|
|
|
|
|
|
|
import numpy as np
|
|
|
|
|
import sisl
|
|
|
|
|
from grogu.useful import *
|
|
|
|
|
from mpi4py import MPI
|
|
|
|
|
from numpy.linalg import inv
|
|
|
|
|
import warnings
|
|
|
|
|
|
|
|
|
|
from grogu.useful import *
|
|
|
|
|
|
|
|
|
|
start_time = timer()
|
|
|
|
|
|
|
|
|
|
# this cell mimicks an input file
|
|
|
|
|
fdf = sisl.get_sile(
|
|
|
|
|
"./lat3_791/Fe3GeTe2.fdf"
|
|
|
|
|
)
|
|
|
|
|
fdf = sisl.get_sile("./lat3_791/Fe3GeTe2.fdf")
|
|
|
|
|
# this information needs to be given at the input!!
|
|
|
|
|
scf_xcf_orientation = np.array([0, 0, 1]) # z
|
|
|
|
|
# list of reference directions for around which we calculate the derivatives
|
|
|
|
@ -35,22 +36,22 @@ ref_xcf_orientations = [
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# human readable definition of magnetic entities
|
|
|
|
|
#magnetic_entities = [
|
|
|
|
|
# magnetic_entities = [
|
|
|
|
|
# dict(atom=0, ),
|
|
|
|
|
# dict(atom=1, ),
|
|
|
|
|
# dict(atom=2, ),
|
|
|
|
|
# dict(atom=3, l=2),
|
|
|
|
|
# dict(atom=4, l=2),
|
|
|
|
|
# dict(atom=5, l=2),
|
|
|
|
|
#]
|
|
|
|
|
#pairs = [
|
|
|
|
|
# ]
|
|
|
|
|
# pairs = [
|
|
|
|
|
# dict(ai=3, aj=4, Ruc=np.array([0, 0, 0])), # isotropic should be -82 meV
|
|
|
|
|
# dict(ai=3, aj=5, Ruc=np.array([0, 0, 0])), # these should all be around -41.9 in the isotropic part
|
|
|
|
|
# dict(ai=4, aj=5, Ruc=np.array([0, 0, 0])),
|
|
|
|
|
# dict(ai=3, aj=0, Ruc=np.array([0, 0, 0])),
|
|
|
|
|
# dict(ai=3, aj=1, Ruc=np.array([0, 0, 0])),
|
|
|
|
|
# dict(ai=3, aj=2, Ruc=np.array([0, 0, 0])),
|
|
|
|
|
#]
|
|
|
|
|
# ]
|
|
|
|
|
magnetic_entities = [
|
|
|
|
|
dict(atom=3, l=2),
|
|
|
|
|
dict(atom=4, l=2),
|
|
|
|
@ -60,7 +61,9 @@ magnetic_entities = [
|
|
|
|
|
# pair information
|
|
|
|
|
pairs = [
|
|
|
|
|
dict(ai=0, aj=1, Ruc=np.array([0, 0, 0])), # isotropic should be -82 meV
|
|
|
|
|
dict(ai=0, aj=2, Ruc=np.array([0, 0, 0])), # these should all be around -41.9 in the isotropic part
|
|
|
|
|
dict(
|
|
|
|
|
ai=0, aj=2, Ruc=np.array([0, 0, 0])
|
|
|
|
|
), # these should all be around -41.9 in the isotropic part
|
|
|
|
|
dict(ai=1, aj=2, Ruc=np.array([0, 0, 0])),
|
|
|
|
|
dict(ai=0, aj=1, Ruc=np.array([-1, 0, 0])),
|
|
|
|
|
dict(ai=0, aj=2, Ruc=np.array([-1, 0, 0])),
|
|
|
|
@ -89,7 +92,8 @@ root_node = 0
|
|
|
|
|
if rank == root_node:
|
|
|
|
|
print("Number of nodes in the parallel cluster: ", size)
|
|
|
|
|
|
|
|
|
|
simulation_parameters = dict(path="Not yet specified.",
|
|
|
|
|
simulation_parameters = dict(
|
|
|
|
|
path="Not yet specified.",
|
|
|
|
|
scf_xcf_orientation=scf_xcf_orientation,
|
|
|
|
|
ref_xcf_orientations=ref_xcf_orientations,
|
|
|
|
|
kset=kset,
|
|
|
|
@ -97,7 +101,8 @@ simulation_parameters = dict(path="Not yet specified.",
|
|
|
|
|
ebot=ebot,
|
|
|
|
|
eset=eset,
|
|
|
|
|
esetp=esetp,
|
|
|
|
|
parallel_size=size)
|
|
|
|
|
parallel_size=size,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# digestion of the input
|
|
|
|
|
# read in hamiltonian
|
|
|
|
@ -265,7 +270,7 @@ site_and_pair_dictionaries_time = timer()
|
|
|
|
|
kset = make_kset(dirs=kdirs, NUMK=kset) # generate k space sampling
|
|
|
|
|
wkset = np.ones(len(kset)) / len(kset) # generate weights for k points
|
|
|
|
|
kpcs = np.array_split(kset, size) # split the k points based on MPI size
|
|
|
|
|
kpcs[root_node] = tqdm(kpcs[root_node], desc='k loop', file=stdout)
|
|
|
|
|
kpcs[root_node] = tqdm(kpcs[root_node], desc="k loop", file=stdout)
|
|
|
|
|
|
|
|
|
|
k_set_time = timer()
|
|
|
|
|
|
|
|
|
@ -411,43 +416,66 @@ if rank == root_node:
|
|
|
|
|
|
|
|
|
|
end_time = timer()
|
|
|
|
|
|
|
|
|
|
print("############################### GROGU OUTPUT ###################################")
|
|
|
|
|
print("================================================================================")
|
|
|
|
|
print(
|
|
|
|
|
"############################### GROGU OUTPUT ###################################"
|
|
|
|
|
)
|
|
|
|
|
print(
|
|
|
|
|
"================================================================================"
|
|
|
|
|
)
|
|
|
|
|
print("Input file: ")
|
|
|
|
|
print(simulation_parameters["path"])
|
|
|
|
|
print("Number of nodes in the parallel cluster: ", simulation_parameters["parallel_size"])
|
|
|
|
|
print("================================================================================")
|
|
|
|
|
print(
|
|
|
|
|
"Number of nodes in the parallel cluster: ",
|
|
|
|
|
simulation_parameters["parallel_size"],
|
|
|
|
|
)
|
|
|
|
|
print(
|
|
|
|
|
"================================================================================"
|
|
|
|
|
)
|
|
|
|
|
try:
|
|
|
|
|
print("Cell [Ang]: ")
|
|
|
|
|
print(simulation_parameters["geom"].cell)
|
|
|
|
|
except:
|
|
|
|
|
print("Geometry could not be read.")
|
|
|
|
|
print("================================================================================")
|
|
|
|
|
print(
|
|
|
|
|
"================================================================================"
|
|
|
|
|
)
|
|
|
|
|
print("DFT axis: ")
|
|
|
|
|
print(simulation_parameters["scf_xcf_orientation"])
|
|
|
|
|
print("Quantization axis and perpendicular rotation directions:")
|
|
|
|
|
for ref in ref_xcf_orientations:
|
|
|
|
|
print(ref["o"], " --» ", ref["vw"])
|
|
|
|
|
print("================================================================================")
|
|
|
|
|
print(
|
|
|
|
|
"================================================================================"
|
|
|
|
|
)
|
|
|
|
|
print("number of k points: ", simulation_parameters["kset"])
|
|
|
|
|
print("k point directions: ", simulation_parameters["kdirs"])
|
|
|
|
|
print("================================================================================")
|
|
|
|
|
print(
|
|
|
|
|
"================================================================================"
|
|
|
|
|
)
|
|
|
|
|
print("Parameters for the contour integral:")
|
|
|
|
|
print("Ebot: ", simulation_parameters["ebot"])
|
|
|
|
|
print("Eset: ", simulation_parameters["eset"])
|
|
|
|
|
print("Esetp: ", simulation_parameters["esetp"])
|
|
|
|
|
print("================================================================================")
|
|
|
|
|
print(
|
|
|
|
|
"================================================================================"
|
|
|
|
|
)
|
|
|
|
|
print("Atomic informations: ")
|
|
|
|
|
print("")
|
|
|
|
|
print("")
|
|
|
|
|
print("Not yet specified.")
|
|
|
|
|
print("")
|
|
|
|
|
print("")
|
|
|
|
|
print("================================================================================")
|
|
|
|
|
print(
|
|
|
|
|
"================================================================================"
|
|
|
|
|
)
|
|
|
|
|
print("Exchange [meV]")
|
|
|
|
|
print("--------------------------------------------------------------------------------")
|
|
|
|
|
print(
|
|
|
|
|
"--------------------------------------------------------------------------------"
|
|
|
|
|
)
|
|
|
|
|
print("Atom1 Atom2 [i j k] d [Ang]")
|
|
|
|
|
print("--------------------------------------------------------------------------------")
|
|
|
|
|
print(
|
|
|
|
|
"--------------------------------------------------------------------------------"
|
|
|
|
|
)
|
|
|
|
|
for pair in pairs:
|
|
|
|
|
J_iso, J_S, D = calculate_exchange_tensor(pair)
|
|
|
|
|
J_iso = J_iso * sisl.unit_convert("eV", "meV")
|
|
|
|
@ -460,14 +488,28 @@ if rank == root_node:
|
|
|
|
|
print("Symmetric-anisotropy: ", J_S)
|
|
|
|
|
print("")
|
|
|
|
|
|
|
|
|
|
print("================================================================================")
|
|
|
|
|
print(
|
|
|
|
|
"================================================================================"
|
|
|
|
|
)
|
|
|
|
|
print("Runtime information: ")
|
|
|
|
|
print("Total runtime: ", end_time - start_time)
|
|
|
|
|
print("--------------------------------------------------------------------------------")
|
|
|
|
|
print(
|
|
|
|
|
"--------------------------------------------------------------------------------"
|
|
|
|
|
)
|
|
|
|
|
print("Initial setup: ", setup_time - start_time)
|
|
|
|
|
print(f"Hamiltonian conversion and XC field extraction: {H_and_XCF_time - setup_time:.3f} s")
|
|
|
|
|
print(f"Pair and site datastructure creatrions: {site_and_pair_dictionaries_time - H_and_XCF_time:.3f} s")
|
|
|
|
|
print(f"k set cration and distribution: {k_set_time - site_and_pair_dictionaries_time:.3f} s")
|
|
|
|
|
print(
|
|
|
|
|
f"Hamiltonian conversion and XC field extraction: {H_and_XCF_time - setup_time:.3f} s"
|
|
|
|
|
)
|
|
|
|
|
print(
|
|
|
|
|
f"Pair and site datastructure creatrions: {site_and_pair_dictionaries_time - H_and_XCF_time:.3f} s"
|
|
|
|
|
)
|
|
|
|
|
print(
|
|
|
|
|
f"k set cration and distribution: {k_set_time - site_and_pair_dictionaries_time:.3f} s"
|
|
|
|
|
)
|
|
|
|
|
print(f"Rotating XC potential: {reference_rotations_time - k_set_time:.3f} s")
|
|
|
|
|
print(f"Greens function inversion: {green_function_inversion_time - reference_rotations_time:.3f} s")
|
|
|
|
|
print(f"Calculate energies and magnetic components: {end_time - green_function_inversion_time:.3f} s")
|
|
|
|
|
print(
|
|
|
|
|
f"Greens function inversion: {green_function_inversion_time - reference_rotations_time:.3f} s"
|
|
|
|
|
)
|
|
|
|
|
print(
|
|
|
|
|
f"Calculate energies and magnetic components: {end_time - green_function_inversion_time:.3f} s"
|
|
|
|
|
)
|
|
|
|
|