Submodules module

Interface to the spirit web view used in the plotting tool.'', height_px=600, width_percent=100)[source]

Create a frame in the jupyter ntoebook to into which the spins are shown., directions, rectilinear=True, vfr_frame_id='')[source]

Update the spins in the frame. module

Tools to get files from the remote folder, fname)[source]

copy a text file from the remote to a temporary dir and load it from there[source]

Open an ssh connection and return the list of files in the remote module

Helper functions for automatically setting up computer & code. Helper functions for setting up

  1. An AiiDA localhost computer

  2. A “spirit” code on localhost, computer)[source]

Get local code. Sets up code for given entry point on given computer.

  • entry_point – Entry point of calculation plugin

  • computer – (local) AiiDA computer


The code node

Return type

aiida.orm.Code'localhost-test', workdir=None)[source]

Get AiiDA computer. Loads computer ‘name’ from the database, if exists. Sets up local computer ‘name’, if it isn’t found in the DB.

  • name – Name of computer to load or set up.

  • workdir – path to work directory Used only when creating a new computer.


The computer node

Return type


Get path to local executable. :param executable: Name of executable in the $PATH variable :type executable: str :return: path to executable :rtype: str[source]

Prepare the input parameters, structure and load the Jij’s for a simple SpiritCalculation for bcc Fe, module

Plotting tools for aiida-spirit., n_basis_cells, cell, spin_directions, scale_spins=1.0, vfr_frame_id='')[source]

Construct positions and directions array and update the vfrendering spin view'', height_px=600, width_percent=100)[source]

Initialize the vfrendering HTML object.

Needs to be called before the show_spins function can set the spins :param vfr_frame_id: a string that controls if multiple windows should be openend. Use the same string in show_spins to update this. :param height_px: height of the window in pixels :param width_percent: window width in percent of the current width size, show_final_structure=True, scale_spins=1.0, list_spin_files_on_remote=False, use_remote_spins_id=None, mask=None, vfr_frame_id='')[source]

Update the vfrendering spin view plot with the final or initial spin structure.

Needs to have the init_spinview() function called to initialize a window where the plot is shown.

  • spirit_calc – the SpiritCalculation which is supposed to be visualized

  • show_final_structure – boolean that tells us if the initial or final structure of the spins should be displayed

  • scale_spins – a scaling factor that can be used to scale the size of the arrows

  • list_spin_files_on_remote – print a list of the available spin image files on the remote folder.

  • use_remote_spins_id – show neither final nor initial spin structure but show the structure of a certain checkpoint (see list_spin_files_on_remote=True output for available checkpoints).

  • mask – mask which can be used to hide or rescale spins (mask is multiplied to the spins, i.e. mask==0 hides a spin, mask>1 enhaces its size).

  • vfr_frame_id – if given this allows to control into which spinview frame the spins are shown. Should be the same as in the init_spinview. This is not fully implemented yet and does not work in this version. module

Helper class for builder run_spirit script.


Bases: object

Helper class to build python scripts with correct indentation

__dict__ = mappingproxy({'__module__': '', '__doc__': 'Helper class to build python scripts with correct indentation', 'indentation': '', 'indentation_increment': '    ', '__init__': <function PythonScriptBuilder.__init__>, '__enter__': <function PythonScriptBuilder.__enter__>, '__exit__': <function PythonScriptBuilder.__exit__>, '__str__': <function PythonScriptBuilder.__str__>, '__iadd__': <function PythonScriptBuilder.__iadd__>, 'empty_line': <function PythonScriptBuilder.empty_line>, 'block': <function PythonScriptBuilder.block>, 'write': <function PythonScriptBuilder.write>, '__dict__': <attribute '__dict__' of 'PythonScriptBuilder' objects>, '__weakref__': <attribute '__weakref__' of 'PythonScriptBuilder' objects>, '__annotations__': {}})

On entering a with clause we increase the indentation.

__exit__(exception_type, exception_value, traceback)[source]

On exiting a with clause we decrease the indentation.

Operator += appends to script body and respects indentation.

Ignores leading empty lines. Automatically appends ‘


IMPORTANT: When appending multiline strings, make sure that the first non-empty line has a correct relative indentation to the rest of the lines. This is because the first non-empty line will be used to figure out how much leading whitespace to remove from the rest of the lines.

__module__ = ''

String representation.


list of weak references to the object (if defined)


” Start a block with a header. e.g:

with s.block("for i in range(10):"):

Append an empty line to the script body

indentation = ''
indentation_increment = '    '

Write script to file



Helper class to build pyton scripts for the spirit api

__module__ = ''
static _dict_to_arg_string(dict)[source]

Format a dict as a string of keyword arguments

_method_dict = {'llg': 'simulation.METHOD_LLG', 'mc': 'simulation.METHOD_MC'}
_module_dict = {'configuration': 'configuration', 'geometry': 'geometry', 'io': 'io', 'simulation': 'simulation', 'state': 'state'}
_solver_dict = {'depondt': 'simulation.SOLVER_DEPONDT', 'heun': 'simulation.SOLVER_HEUN', 'lbfgs_atlas': 'simulation.SOLVER_LBFGS_Atlas', 'lbfgs_oso': 'simulation.SOLVER_LBFGS_OSO', 'rk4': 'simulation.SOLVER_SIB', 'sib': 'simulation.SOLVER_SIB', 'vp': 'simulation.SOLVER_VP', 'vp_oso': 'simulation.SOLVER_VP_OSO'}
_spirit_call(module, function_name, *args, **kwargs)[source]

A generic call to any of the spirit api functions.

configuration(fname, *args, **kwargs)[source]

Sets one of the configuration api functions on of p_state


Imports the modules given in *args. If no *args are given, imports all modules in the module dict

static list_to_arg_string(list)[source]

Format a list as a string of positional arguments


Set Spirit run method (i.e. LLG, MC)


Import the spirit modules


Set spirit solver (Depodt, VP, …)

start_simulation(method, solver, *args, **kwargs)[source]

Start a simulation with a method and a solver.


Creates the state_block and thereby creates the p_state

Module contents