|
|
|
@ -1,26 +1,16 @@
|
|
|
|
|
import warnings
|
|
|
|
|
from sys import stdout
|
|
|
|
|
from timeit import default_timer as timer
|
|
|
|
|
|
|
|
|
|
import numpy as np
|
|
|
|
|
import sisl
|
|
|
|
|
from mpi4py import MPI
|
|
|
|
|
from numpy.linalg import inv
|
|
|
|
|
from tqdm import tqdm
|
|
|
|
|
from useful import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
import os
|
|
|
|
|
from sys import stdout
|
|
|
|
|
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 mpi4py import MPI
|
|
|
|
|
from numpy.linalg import inv
|
|
|
|
|
|
|
|
|
|
start_time = timer()
|
|
|
|
|
|
|
|
|
|
# this cell mimicks an input file
|
|
|
|
@ -54,10 +44,36 @@ def main():
|
|
|
|
|
# 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),
|
|
|
|
|
# dict(atom=5, l=2),
|
|
|
|
|
# ]
|
|
|
|
|
|
|
|
|
|
# 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=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])),
|
|
|
|
|
# dict(ai=0, aj=1, Ruc=np.array([1, 0, 0])),
|
|
|
|
|
# dict(ai=0, aj=2, Ruc=np.array([1, 0, 0])),
|
|
|
|
|
# dict(ai=0, aj=1, Ruc=np.array([0, -1, 0])),
|
|
|
|
|
# dict(ai=0, aj=2, Ruc=np.array([0, -1, 0])),
|
|
|
|
|
# dict(ai=0, aj=1, Ruc=np.array([0, 1, 0])),
|
|
|
|
|
# dict(ai=0, aj=2, Ruc=np.array([0, 1, 0])),
|
|
|
|
|
# dict(ai=1, aj=2, Ruc=np.array([-1, 0, 0])),
|
|
|
|
|
# ]
|
|
|
|
|
magnetic_entities = [
|
|
|
|
|
dict(atom=3, l=2),
|
|
|
|
|
dict(atom=4, l=2),
|
|
|
|
|
dict(atom=5, l=2),
|
|
|
|
|
dict(
|
|
|
|
|
atom=[3, 4],
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# pair information
|
|
|
|
@ -67,22 +83,15 @@ def main():
|
|
|
|
|
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])),
|
|
|
|
|
dict(ai=0, aj=1, Ruc=np.array([1, 0, 0])),
|
|
|
|
|
dict(ai=0, aj=2, Ruc=np.array([1, 0, 0])),
|
|
|
|
|
dict(ai=0, aj=1, Ruc=np.array([0, -1, 0])),
|
|
|
|
|
dict(ai=0, aj=2, Ruc=np.array([0, -1, 0])),
|
|
|
|
|
dict(ai=0, aj=1, Ruc=np.array([0, 1, 0])),
|
|
|
|
|
dict(ai=0, aj=2, Ruc=np.array([0, 1, 0])),
|
|
|
|
|
dict(ai=1, aj=2, Ruc=np.array([-1, 0, 0])),
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# Brilloun zone sampling and Green function contour integral
|
|
|
|
|
kset = 20
|
|
|
|
|
kset = 100
|
|
|
|
|
kdirs = "xy"
|
|
|
|
|
ebot = -30
|
|
|
|
|
eset = 50
|
|
|
|
|
eset = 100
|
|
|
|
|
esetp = 1000
|
|
|
|
|
|
|
|
|
|
# MPI parameters
|
|
|
|
@ -250,12 +259,6 @@ def main():
|
|
|
|
|
pair["Gji"] = []
|
|
|
|
|
pair["Gij_tmp"] = [] # Greens function for parallelization
|
|
|
|
|
pair["Gji_tmp"] = []
|
|
|
|
|
|
|
|
|
|
pair["Vij"] = [
|
|
|
|
|
list([]) for _ in range(len(ref_xcf_orientations))
|
|
|
|
|
] # These will be the perturbed potentials from eq. 100
|
|
|
|
|
pair["Vji"] = [list([]) for _ in range(len(ref_xcf_orientations))]
|
|
|
|
|
|
|
|
|
|
for i in ref_xcf_orientations:
|
|
|
|
|
pair["Gij"].append(
|
|
|
|
|
np.zeros((eset, spin_box_shape_i, spin_box_shape_j), dtype="complex128")
|
|
|
|
@ -315,16 +318,6 @@ def main():
|
|
|
|
|
Vu2[:, mag_ent["spin_box_indeces"]][mag_ent["spin_box_indeces"], :]
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
for pair in pairs:
|
|
|
|
|
ai = magnetic_entities[pair["ai"]][
|
|
|
|
|
"spin_box_indeces"
|
|
|
|
|
] # get the pair orbital sizes from the magnetic entities
|
|
|
|
|
aj = magnetic_entities[pair["aj"]]["spin_box_indeces"]
|
|
|
|
|
pair["Vij"][i].append(
|
|
|
|
|
Vu1[:, ai][aj, :]
|
|
|
|
|
) # fill up the perturbed potentials (for now) based on the on-site projections
|
|
|
|
|
pair["Vji"][i].append(Vu1[:, aj][ai, :])
|
|
|
|
|
|
|
|
|
|
reference_rotations_time = timer()
|
|
|
|
|
|
|
|
|
|
if rank == root_node:
|
|
|
|
|