Compare commits

...

4 Commits

Binary file not shown.

@ -13,13 +13,9 @@ More on the theoretical background can be seen on [arXiv](https://arxiv.org/abs/
### Developing ### Developing
- Use ReadThe Docs [addons](https://docs.readthedocs.io/en/stable/addons.html) - Use ReadThe Docs [addons](https://docs.readthedocs.io/en/stable/addons.html)
- Check the symmetrization of the Hamiltonian and overlap matrix to make them hermitian
- Check if exchange field has scalar part
- Add more tests!! - Add more tests!!
- logging
- orbital indexing must be checked and bad values should raise an error - orbital indexing must be checked and bad values should raise an error
- check on the validity of magnetic entities input - check on the validity of magnetic entities input
- log `$SLURM_JOB_ID` with `os.environ`
## Building wheel ## Building wheel

@ -115,7 +115,6 @@ def parse_command_line() -> dict:
type=int, type=int,
help="Parameter tuning the distribution on the contour", help="Parameter tuning the distribution on the contour",
) )
parser.add_argument( parser.add_argument(
"--parallel-green", "--parallel-green",
dest="parallel_solver_for_Gk", dest="parallel_solver_for_Gk",
@ -219,6 +218,10 @@ def main(simulation_parameters: dict, magnetic_entities: list, pairs: list) -> N
# reformat Hamiltonian and Overlap matrix for manipulations # reformat Hamiltonian and Overlap matrix for manipulations
hh, ss = build_hh_ss(dh) hh, ss = build_hh_ss(dh)
# copy arrays for tests
if rank == root_node:
hh_test, ss_test = hh.copy(), ss.copy()
# symmetrizing Hamiltonian and Overlap matrix to make them hermitian # symmetrizing Hamiltonian and Overlap matrix to make them hermitian
for i in range(dh.lattice.sc_off.shape[0]): for i in range(dh.lattice.sc_off.shape[0]):
j = dh.lattice.sc_index(-dh.lattice.sc_off[i]) j = dh.lattice.sc_index(-dh.lattice.sc_off[i])
@ -227,6 +230,19 @@ def main(simulation_parameters: dict, magnetic_entities: list, pairs: list) -> N
s1, s1d = ss[i], ss[j] s1, s1d = ss[i], ss[j]
ss[i], ss[j] = (s1 + s1d.T.conj()) / 2, (s1d + s1.T.conj()) / 2 ss[i], ss[j] = (s1 + s1d.T.conj()) / 2, (s1d + s1.T.conj()) / 2
# test symmetrization
if rank == root_node:
diff_hh = abs(hh - hh_test).max()
diff_ss = abs(ss - ss_test).max()
if diff_hh > 1e-12:
warnings.warn(
f"Hamiltonian changed after symmetrization. Largest change is {diff_hh}"
)
if diff_ss > 1e-12:
warnings.warn(
f"Overlap matrix changed after symmetrization. Largest change is {diff_hh}"
)
# identifying TRS and TRB parts of the Hamiltonian # identifying TRS and TRB parts of the Hamiltonian
TAUY: np.array = np.kron(np.eye(NO), TAU_Y) TAUY: np.array = np.kron(np.eye(NO), TAU_Y)
hTR: np.array = np.array( hTR: np.array = np.array(
@ -537,5 +553,6 @@ if __name__ == "__main__":
simulation_parameters = process_input_args( simulation_parameters = process_input_args(
DEFAULT_ARGUMENTS, fdf_arguments, command_line_arguments, ACCEPTED_INPUTS DEFAULT_ARGUMENTS, fdf_arguments, command_line_arguments, ACCEPTED_INPUTS
) )
print(simulation_parameters)
# run grogupy
main(simulation_parameters, magnetic_entities, pairs) main(simulation_parameters, magnetic_entities, pairs)

@ -21,6 +21,7 @@
"""Docstring in io. """Docstring in io.
""" """
from os import environ
from pickle import dump, load from pickle import dump, load
from typing import Final from typing import Final
@ -251,6 +252,10 @@ def print_job_description(simulation_parameters: dict) -> None:
print( print(
"================================================================================================================================================================" "================================================================================================================================================================"
) )
try:
print(f"SLURM job ID: {environ['SLURM_JOB_ID']}")
except:
print("SLURM job ID not found.")
print("Input file: ") print("Input file: ")
print(simulation_parameters["infile"]) print(simulation_parameters["infile"])
print("Output file: ") print("Output file: ")
@ -308,6 +313,10 @@ def print_parameters(simulation_parameters: dict) -> None:
print( print(
"================================================================================================================================================================" "================================================================================================================================================================"
) )
try:
print(f"SLURM job ID: {environ['SLURM_JOB_ID']}")
except:
print("SLURM job ID not found.")
print("Input file: ") print("Input file: ")
print(simulation_parameters["infile"]) print(simulation_parameters["infile"])
print("Output file: ") print("Output file: ")

Loading…
Cancel
Save