Workflows
This section describes the aiida-kkr workflows.
Generate KKR start potential
In this module you find the base workflow for a dos calculation and some helper methods to do so with AiiDA
- class aiida_kkr.workflows.voro_start.kkr_startpot_wc(*args: Any, **kwargs: Any)[source]
Workchain create starting potential for a KKR calculation by running voronoi and getting the starting DOS for first checks on the validity of the input setting. Starts from a structure together with a KKR parameter node.
- Parameters:
wf_parameters – (Dict), Workchain specifications
options – (Dict), specifications for the computer
structure – (StructureData), aiida structure node to begin calculation from (needs to contain vacancies, if KKR needs empty spheres)
kkr – (Code)
voronoi – (Code)
calc_parameters – (Dict), KKR parameter set, passed on to voronoi run.
- Return result_kkr_startpot_wc:
(Dict), Information of workflow results like Success, last result node, dos array data
- check_voronoi()[source]
Check voronoi output.
return True/False if voronoi output is ok/problematic if output is problematic try to increase some parameters (e.g. cluster radius) and rerun up tp N_rerun_max times initializes with returning True
- find_cluster_radius_alat()[source]
Find an estimate for the cluster radius.
The radius is chosen such that it comes close to having nclsmin atoms in the cluster.
- classmethod get_wf_defaults(silent=False)[source]
Print and return _wf_defaults dictionary.
Can be used to easily create set of wf_parameters. returns _wf_defaults
KKR scf cycle
In this module you find the base workflow for converging a kkr calculation and some helper methods to do so with AiiDA
- aiida_kkr.workflows.kkr_scf.create_scf_result_node(**kwargs)[source]
This is a pseudo wf, to create the right graph structure of AiiDA.
This workfunction will create the output node in the database. It also connects the output_node to all nodes the information commes from. So far it is just also parsed in as argument, because so far we are to lazy to put most of the code overworked from return_results in here.
- aiida_kkr.workflows.kkr_scf.get_site_symbols(structure)[source]
extract the site number taking into account a possible CPA structure
- class aiida_kkr.workflows.kkr_scf.kkr_scf_wc(*args: Any, **kwargs: Any)[source]
Workchain for converging a KKR calculation (SCF).
It converges the charge potential. Two paths are possible:
(1) Start from a structure and run a voronoi calculation first, optional with calc_parameters (2) Start from an existing Voronoi or KKR calculation, with a remoteData
- Parameters:
wf_parameters – (Dict), Workchain Specifications
options – (Dict); specifications for the computer
structure – (StructureData), Crystal structure
calc_parameters – (Dict), Voronoi/Kkr Parameters
remote_data – (RemoteData), from a KKR, or Voronoi calculation
voronoi – (Code)
kkr – (Code)
- Return output_kkr_scf_wc_para:
(Dict), Information of workflow results like Success, last result node, list with convergence behavior
minimum input example: 1. Code1, Code2, Structure, (Parameters), (wf_parameters) 2. Code2, remote_data, (Parameters), (wf_parameters)
maximum input example: 1. Code1, Code2, Structure, Parameters
- wf_parameters: {‘queue_name’String,
‘resources’ : dict({“num_machines”: int, “num_mpiprocs_per_machine” : int}) ‘walltime’ : int}
Code2, (remote-data), wf_parameters as in 1.
Hints: 1. This workflow does not work with local codes!
- _get_new_noco_angles()[source]
Extract nonco angles from output of calculation.
If fix_dir is True we skip this and leave the initial angles unchanged Here we update self.ctx.initial_noco_angles with the new values
- change_conv_para(new_params, para_check, initial_settings, decrease_mixing_fac, switch_agressive_mixing, switch_higher_accuracy, label, description)[source]
Adapt the kkr parameters to change the convergence settings and the mixing
- check_input_params(params, is_voronoi=False)[source]
Check the input parameter consistency and aborts wf if check fails.
- check_voronoi()[source]
Check output of kkr_startpot_wc workflow.
It checks the starting potential, shapefun etc.
- convergence_on_track()[source]
Check if convergence behavior of the last calculation is on track.
(i.e. going down)
- classmethod get_wf_defaults(silent=False)[source]
Print and return _wf_default dictionary.
Can be used to easily create set of wf_parameters. returns _wf_default, _options_default
- return_results()[source]
Return the results of the calculations.
This should run through and produce output nodes even if everything failed, therefore it only uses results from context.
Density of states
In this module you find the base workflow for a dos calculation and some helper methods to do so with AiiDA
- class aiida_kkr.workflows.dos.kkr_dos_wc(*args: Any, **kwargs: Any)[source]
Workchain a DOS calculation with KKR starting from the remoteData node of a previous calculation (either Voronoi or KKR).
- Parameters:
wf_parameters – (Dict); Workchain specifications
options – (Dict); specifications for the computer
remote_data – (RemoteData), mandatory; from a KKR or Vornoi calculation
kkr – (Code), mandatory; KKR code running the dos calculation
- Return result_kkr_dos_wc:
(Dict), Information of workflow results like Success, last result node, list with convergence behavior
- classmethod get_wf_defaults(silent=False)[source]
Print and return _wf_defaults dictionary.
Can be used to easily create set of wf_parameters. returns _wf_defaults
Bandstructure
This module contains the band structure workflow for KKR which is done by calculating the k-resolved spectral density also known as Bloch spectral function.
- class aiida_kkr.workflows.bs.kkr_bs_wc(*args: Any, **kwargs: Any)[source]
Workchain for BandStructure calculation, starting from RemoteFolderData of the previous converged KKR calculation remote folder data
inputs: :param wf_parameters: (Dict), (optional); Workchain Specifications, contains nepts, tempr, emin (in eV relative to EF), emax (in eV),
and RCLUSTZ (can be used to increase the screening cluster radius) keys.
- Parameters:
options – (Dict), (optional); Computer Specifications, scheduler command, parallel or serial
kpoints – (KpointsData),(optional); Kpoints data type from the structure, but not mendatory as it can be extracted from structure internaly from the remote data
remote_data – (RemoteData)(mendaory); From the previous kkr-converged calculation.
kkr – (Code)(mendaory); KKR code specifiaction
label – (Str) (optional) ; label for WC but will be found in the ‘result_wf’ output Dict as ‘BS_wf_label’ key
description – (Str) (optional) : description for WC but will be found in the ‘result_wf’ output Dict as ‘BS_wf_description’ key
returns: :out BS_Data : (ArrayData) ; Consist of BlochSpectralFunction, k_points (list), energy_points (list), special_kpoints(dict) :out result_wf: (Dict); work_chain_specifications node, BS_data node, remote_folder node
- classmethod define(spec)[source]
Layout of the workflow, defines the input nodes and the outline of the workchain
- classmethod get_wf_defaults(silent=False)[source]
Return the default values of the workflow parameters (wf_parameters input node)
Equation of states
In this module you find the base workflow for a EOS calculation and some helper methods to do so with AiiDA
- aiida_kkr.workflows.eos.get_primitive_structure(structure, return_all)[source]
calls get_explicit_kpoints_path which gives primitive structure auxiliary workfunction to keep provenance
- class aiida_kkr.workflows.eos.kkr_eos_wc(*args: Any, **kwargs: Any)[source]
Workchain of an equation of states calculation with KKR.
- Layout of the workflow:
determine V0, scale_range, etc. from input
- run voro_start for V0 and smallest volume
2.1 get minimum for RMTCORE (needs to be fixed for all calculations to be able to compare total energies
submit kkr_scf calculations for all volumes using RMTCORE setting determined in step 2
collect results
- check_voro_out()[source]
Check output of the vorostart workflow.
The outputs are then used to create inputs for the next set of calculations (rmtcore setting etc.)
- classmethod get_wf_defaults(silent=False)[source]
Print and return _wf_defaults dictionary.
Can be used to easily create set of wf_parameters. returns _wf_defaults, _options_default
- prepare_strucs()[source]
Create new set of scaled structures for the E-V curve.
The structures are generated using the ‘rescale’ workfunction (see end of the workflow)
- run_kkr_steps()[source]
Submit KKR calculations for all structures.
This will skip the vorostart step for smallest structure.
- aiida_kkr.workflows.eos.rescale(inp_structure, scale)[source]
Rescales a crystal structure. Keeps the provenance in the database.
:param inp_structure, a StructureData node (pk, or uuid) :param scale, float scaling factor for the cell
- Returns:
New StructureData node with rescalled structure, which is linked to input Structure and None if inp_structure was not a StructureData
copied and modified from aiida_fleur.tools.StructureData_util
- aiida_kkr.workflows.eos.rescale_no_wf(structure, scale) StructureData [source]
Rescales a crystal structure. DOES NOT keep the provenance in the database.
:param structure, a StructureData node (pk, or uuid) :param scale, float scaling factor for the cell
- Returns:
New StructureData node with rescalled structure, which is linked to input Structure and None if inp_structure was not a StructureData
copied and modified from aiida_fleur.tools.StructureData_util
Find Green Function writeout for KKRimp
In this module you find the base workflow for writing out the kkr_flexfiles and some helper methods to do so with AiiDA
- class aiida_kkr.workflows.gf_writeout.kkr_flex_wc(*args: Any, **kwargs: Any)[source]
Workchain of a kkr_flex calculation to calculate the Green function with KKR starting from the RemoteData node of a previous calculation (either Voronoi or KKR).
- Parameters:
options – (Dict), Workchain specifications
wf_parameters – (Dict), Workflow parameters that deviate from previous KKR RemoteData
remote_data – (RemoteData), mandatory; from a converged KKR calculation
kkr – (Code), mandatory; KKR code running the flexfile writeout
impurity_info – Dict, mandatory: node specifying information of the impurities in the system
- Return workflow_info:
(Dict), Information of workflow results like success, last result node, list with convergence behavior
- Return GF_host_remote:
(RemoteData), host GF of the system
- classmethod get_wf_defaults()[source]
Print and return _wf_defaults dictionary. Can be used to easily create set of wf_parameters. returns _wf_defaults
- move_kkrflex_files()[source]
Move the kkrflex files from the remote folder to KkrimpCalculation._DIRNAME_GF_UPLOAD on the remote computer’s working dir. This skips retrieval to the file repository and reduces cluttering the database.
- return_results()[source]
Return the results of the KKRFLEX calculation. This should run through and produce output nodes even if everything failed, therefore it only uses results from context.
KKRhost Jij calculation
This module contains the workflow that can be used to calculate the exchange coupling constants
- aiida_kkr.workflows.jijs._make_nonco_angles(parent_remote)[source]
Create nonco angles for the 3 directions (x y, z)
- class aiida_kkr.workflows.jijs.kkr_jij_wc(*args: Any, **kwargs: Any)[source]
Workchain for calculation of exchange coupling constants Jij and Dij if parent calculation used the SOC solver.
inputs:
:param wf_parameters: optional Dict node of workchain specifications, contains settings like Jij radius cutoff, selection of sites for i and j and numerical cutoffs. None values in the accuracy sub-dict means that values from parent calculation are coptied. :param remote_data: mandatory RemoteData node of parent (i.e. converged) KkrCalculation :param kkr: optional Code for KKRhost executable (if not given the same as in the parent calculation is used) :param options: optional Dict computer options like scheduler command or parallelization
returns:
:return jij_data: ArrayData with the arrays 'Jij_expanded' (Table of all Jij and Dij pairs) and 'positions_expanded' (positions of all ij pairs) :return structure_jij_sites: StructureData
- _get_para_jij(params)[source]
Set the Jij parameters from the input. Returns a kkrparams instance with the set values
- classmethod define(spec)[source]
Layout of the workflow, defines the input nodes and the outline of the workchain
KKRimp self-consistency
In this module you find the sub workflow for the kkrimp self consistency cycle and some helper methods to do so with AiiDA
- aiida_kkr.workflows.kkr_imp_sub.extract_imp_pot_sfd(retrieved_folder)[source]
Extract potential file from retrieved folder and save as SingleFileData
- class aiida_kkr.workflows.kkr_imp_sub.kkr_imp_sub_wc(*args: Any, **kwargs: Any)[source]
Workchain of a kkrimp self consistency calculation starting from the host-impurity potential of the system. (Not the entire kkr_imp workflow!)
- Parameters:
options – (Dict), Workchain specifications
wf_parameters – (Dict), specifications for the calculation
host_imp_startpot – (RemoteData), mandatory; input host-impurity potential
kkrimp – (Code), mandatory; KKRimp code converging the host-imp-potential
remote_data – (RemoteData), mandatory; remote folder of a previous kkrflex calculation containing the flexfiles …
kkrimp_remote – (RemoteData), remote folder of a previous kkrimp calculation
impurity_info – (Dict), Parameter node with information about the impurity cluster
- Return workflow_info:
(Dict), Information of workflow results like success, last result node, list with convergence behavior
- Return host_imp_pot:
(SinglefileData), output potential of the sytem
- _overwrite_parameters_from_input(new_params)[source]
Overwrite input parameters for KKRimpCalculation if found in input
- convergence_on_track()[source]
Check if convergence behavior of the last calculation is on track (i.e. going down)
- classmethod get_wf_defaults(silent=False)[source]
Print and return _wf_defaults dictionary. Can be used to easily create set of wf_parameters.
returns _wf_defaults
- inspect_kkrimp()[source]
check for convergence and store some of the results of the last calculation to context
- return_results()[source]
Return the results of the calculations This should run through and produce output nodes even if everything failed, therefore it only uses results from context.
KKRimp complete calculation
In this module you find the total workflow for a kkr impurity calculation and some helper methods to do so with AiiDA
- class aiida_kkr.workflows.kkr_imp.kkr_imp_wc(*args: Any, **kwargs: Any)[source]
Workchain of a kkrimp calculation starting either from scratch (with a structure and impurity_info node), or with a converged host potential and impurity startpotentials, … to calculate the converged host-impurity potential of the system.
- Parameters:
options – (Dict), Workchain specifications
wf_parameters – (Dict), specifications for the kkr impurity workflow
voro_aux_parameters – (Dict), specification for the auxiliary voronoi calculation for the impurity
kkrimp – (Code), mandatory: KKRimp code converging the host-imp-potential
kkr – (Code), mandatory: KKR code for calculation the host potential
voronoi – (Code), mandatory: Voronoi code to generate the impurity startpot
remote_data_gf – (RemoteData): remote folder of a previous kkrflex calculation containing the flexfiles …
remote_data_host – (RemoteData): remote folder of a converged KKR host calculation
- Return workflow_info:
(Dict), Information of workflow results
- Return last_calc_output_parameters:
(Dict), output parameters of the last called calculation
- Return last_calc_info:
(Dict), information of the last called calculation
- construct_startpot()[source]
Take the output of GF writeout and the converged host potential as well as the auxiliary startpotentials for the impurity to construct the startpotential for the KKR impurity sub workflow
- classmethod get_wf_defaults(silent=False)[source]
Print and return _wf_defaults dictionary. Can be used to easily create set of wf_parameters.
returns _wf_defaults
- has_starting_potential_input()[source]
check whether or not a starting potential needs to be created
- run_gf_writeout()[source]
Run the gf_writeout workflow to calculate the host Green’s function and the KKR flexfiles using the converged host remote folder and the impurity info node
- run_kkrimp_scf()[source]
Uses both the previously generated host-impurity startpotential and the output from the GF writeout workflow as inputs to run the kkrimp_sub workflow in order to converge the host-impurity potential