aiida_spirit package



aiida_spirit.calculations module

Calculations provided by aiida_spirit.

Register calculations via the “aiida.calculations” entry point in setup.json.

class aiida_spirit.calculations.SpiritCalculation(*args: Any, **kwargs: Any)[source]

Bases: CalcJob

Run Spirit calculation from user defined inputs.

_DEFAULT_INPUT_FILE = 'input_created.cfg'
_DEFAULT_OUTPUT_FILE = 'spirit.stdout'
__abstractmethods__ = frozenset({})
__module__ = 'aiida_spirit.calculations'
_abc_impl = <_abc_data object>
classmethod define(spec)[source]

Define inputs and outputs of the calculation.


Get the defects info that is added to the config file


Create input files.


folder – an aiida.common.folders.Folder where the plugin should temporarily place all files needed by the calculation.


aiida.common.datastructures.CalcInfo instance


Write the couplings.txt file that contains the Jij’s


Create the defects.txt file from the defects input array

We write the defects.txt in this format:

### Atom types: type index 0..n or or vacancy (type < 0) ### Specify the number of defects and then the defects in terms of translations and type ### i da db dc itype n_defects 3 # this is skipped and all defects that are found in the file are used 0 0 0 0 -1 0 1 0 0 -1 0 0 1 0 -1


Write the ‘initial_state.txt’ file that contains the direction for each spin


Write the input.cfg file from the parameters input


Write the MC script version of


Create the pinning.txt file from the pinning input array

We write the pinning.txt in this format (i, da, db, dc, Sx, Sy, Sz):

0 0 0 0 1.0 0.0 0.0 0 1 0 0 0.0 1.0 0.0 0 0 1 0 0.0 0.0 1.0


write the script that controls the spirit python API.


Get the geometry string from the structure

aiida_spirit.calculations._modify_line(my_string, new_value)[source]

Gets a line and the new parameter value as inputs and returns the line with the new parameter

aiida_spirit.calculations.validate_params(params, _)[source]

Validate the input parameters.

aiida_spirit.cli module

aiida_spirit.parsers module

Parsers provided by aiida_spirit.

Register parsers via the “aiida.parsers” entry point in setup.json.

class aiida_spirit.parsers.SpiritParser(node)[source]

Bases: Parser

Parser class for parsing output of calculation.

__abstractmethods__ = frozenset({})

Initialize Parser instance

Checks that the ProcessNode being passed was produced by a SpiritCalculation.

  • node (type) – ProcessNode of calculation

  • nodeaiida.orm.ProcessNode

__module__ = 'aiida_spirit.parsers'
_abc_impl = <_abc_data object>
_parse_if_found(filename, *args, folder=None, **kwargs)[source]

Parses a file and loads it with np.loadtxt. The *args and **kwargs are passed to np.loadtxt. If the file is not found it returns None.


Parse outputs, store results in database.


an exit code, if parsing fails (or nothing if parsing succeeds)


Parse the output from the retrieved and create aiida nodes

parse_temporary_retrieved(_retrieved_dict, retrieved_temporary_folder)[source]

Parse files that are defined in the retrieve_temporary_list


parse the spirit output file

Module contents


AiiDA plugin for the spirit code