corrected Vij Vji storage

class-solution
Daniel Pozsar 3 months ago
parent 72b9f8d7b7
commit a0cdecc306

@ -1,26 +1,16 @@
from useful import * import warnings
def main():
import os
from sys import stdout from sys import stdout
from timeit import default_timer as timer 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 numpy as np
import sisl import sisl
from mpi4py import MPI from mpi4py import MPI
from numpy.linalg import inv from numpy.linalg import inv
from tqdm import tqdm
from useful import *
def main():
start_time = timer() start_time = timer()
# this cell mimicks an input file # 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=1, Ruc=np.array([0, 0, 0])),
# dict(ai=3, aj=2, 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 = [ magnetic_entities = [
dict(atom=3, l=2), dict(atom=3, l=2),
dict(atom=4, l=2), dict(atom=4, l=2),
dict(atom=5, l=2), dict(atom=5, l=2),
dict(
atom=[3, 4],
),
] ]
# pair information # pair information
@ -67,22 +83,15 @@ def main():
ai=0, aj=2, Ruc=np.array([0, 0, 0]) ai=0, aj=2, Ruc=np.array([0, 0, 0])
), # these should all be around -41.9 in the isotropic part ), # these should all be around -41.9 in the isotropic part
dict(ai=1, aj=2, Ruc=np.array([0, 0, 0])), 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=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])), dict(ai=1, aj=2, Ruc=np.array([-1, 0, 0])),
] ]
# Brilloun zone sampling and Green function contour integral # Brilloun zone sampling and Green function contour integral
kset = 20 kset = 100
kdirs = "xy" kdirs = "xy"
ebot = -30 ebot = -30
eset = 50 eset = 100
esetp = 1000 esetp = 1000
# MPI parameters # MPI parameters
@ -250,12 +259,6 @@ def main():
pair["Gji"] = [] pair["Gji"] = []
pair["Gij_tmp"] = [] # Greens function for parallelization pair["Gij_tmp"] = [] # Greens function for parallelization
pair["Gji_tmp"] = [] 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: for i in ref_xcf_orientations:
pair["Gij"].append( pair["Gij"].append(
np.zeros((eset, spin_box_shape_i, spin_box_shape_j), dtype="complex128") 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"], :] 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() reference_rotations_time = timer()
if rank == root_node: if rank == root_node:

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save