From 29b893830acfbc62202f5d94ce345bb316689d5f Mon Sep 17 00:00:00 2001 From: Daniel Pozsar Date: Fri, 8 Nov 2024 14:30:00 +0100 Subject: [PATCH] bunch of new "flags" and streamlined printing --- src/grogu_magn/io.py | 100 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 87 insertions(+), 13 deletions(-) diff --git a/src/grogu_magn/io.py b/src/grogu_magn/io.py index f7c2f19..0ef5529 100644 --- a/src/grogu_magn/io.py +++ b/src/grogu_magn/io.py @@ -15,14 +15,18 @@ default_args = dict( kset=2, kdirs="xyz", ebot=None, + automatic_ebot=False, eset=42, esetp=1000, - calculate_charge=True, + calculate_charge=False, charges=[], - parallel_solver_for_Gk=True, + parallel_solver_for_Gk=False, + parallel_size=None, + padawan_mode=True, ) # parser = ArgumentParser() + # parser.add_argument('--input' , dest = 'infile' , default=None , help = 'Input file name') # parser.add_argument('--output' , dest = 'outfile', default=None , help = 'Output file name') @@ -31,6 +35,7 @@ default_args = dict( # parser.add_argument('--ebot' , dest = 'ebot' , default = None , type=float, help = 'Bottom energy of the contour') # parser.add_argument('--eset' , dest = 'eset' , default = 42 , type=int , help = 'Number of energy points on the contour') # parser.add_argument('--eset-p' , dest = 'esetp' , default = 1000 , type=int , help = 'Parameter tuning the distribution on the contour') + # cmd_line_args = parser.parse_args() @@ -107,6 +112,9 @@ def print_parameters(simulation_parameters): if simulation_parameters["calculate_charge"]: print("The calculated charge of the Hamiltonian in the quantization axes: ") print(simulation_parameters["charges"]) + print( + "================================================================================================================================================================" + ) def print_atoms_and_pairs(magnetic_entities, pairs): @@ -173,20 +181,21 @@ def print_atoms_and_pairs(magnetic_entities, pairs): f"{pair['tags'][0]} {pair['tags'][1]} {pair['Ruc']} d [Ang] {pair['dist']}" ) # print magnetic parameters - print("Isotropic: ", pair["J_iso"]) - print("DMI: ", pair["D"]) - print("Symmetric-anisotropy: ", pair["J_S"]) - print("J: ", pair["J"].flatten()) - print("Energies for debugging: ") - print(np.array(pair["energies"])) + print("Isotropic: ", pair["J_iso"], " # Tr[J] / 3") + print("") + print("DMI: ", pair["D"], " # Dx, Dy, Dz") + print("") print( - "J_ii for debugging: (check if this is the same as in calculate_exchange_tensor)" + "Symmetric-anisotropy: ", + pair["J_S"], + " # J_S = J - J_iso * I ––> Jxx, Jyy, Jxy, Jxz, Jyz", ) - o1, o2, o3 = pair["energies"] - print(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("J: # Jxx, Jxy, Jxz, Jyx, Jyy, Jyz, Jzx, Jzy, Jzz") + print(pair["J"]) + print( + "----------------------------------------------------------------------------------------------------------------------------------------------------------------" + ) print( "================================================================================================================================================================" @@ -223,3 +232,68 @@ def print_runtime_information(times): print( f"Calculate energies and magnetic components: {times['end_time'] - times['green_function_inversion_time']:.3f} s" ) + + +def print_job_description(simulation_parameters): + """_summary_ + + Args: + simulation_parameters (_type_): _description_ + """ + + print( + "================================================================================================================================================================" + ) + print("Input file: ") + print(simulation_parameters["infile"]) + print("Output file: ") + print(simulation_parameters["outfile"]) + print( + "Number of nodes in the parallel cluster: ", + simulation_parameters["parallel_size"], + ) + if simulation_parameters["parallel_solver_for_Gk"]: + print("solver used for Greens function calculation: parallel") + else: + print("solver used for Greens function calculation: sequential") + print( + "================================================================================================================================================================" + ) + print("Cell [Ang]: ") + print(simulation_parameters["cell"]) + print( + "================================================================================================================================================================" + ) + print("DFT axis: ") + print(simulation_parameters["scf_xcf_orientation"]) + print("Quantization axis and perpendicular rotation directions:") + for ref in simulation_parameters["ref_xcf_orientations"]: + print(ref["o"], " --» ", ref["vw"]) + print( + "================================================================================================================================================================" + ) + print("Parameters for the contour integral:") + print("Number of k points: ", simulation_parameters["kset"]) + print("k point directions: ", simulation_parameters["kdirs"]) + if simulation_parameters["automatic_ebot"]: + print( + "Ebot: ", + simulation_parameters["ebot"], + " WARNING: This was automatically determined!", + ) + else: + print("Ebot: ", simulation_parameters["ebot"]) + print("Eset: ", simulation_parameters["eset"]) + print("Esetp: ", simulation_parameters["esetp"]) + print( + "================================================================================================================================================================" + ) + if simulation_parameters["calculate_charge"]: + print( + "Charge calculation required: True WARNING: This causes a slowdown, because we have to use the complete Greens function!" + ) + else: + print("Charge calculation required: False") + print( + "================================================================================================================================================================" + )