spirit.state module

The state contains the chain of spin systems (also called images).

To create a new state with containing a single image and run a simple example of a spin dynamics simulation:

# Import spirit
from spirit import state
from spirit import simulation

# Create a state using an input file
with state.State("input/input.toml") as p_state:
    # Start a LLG simulation using the SIB solver
    simulation.start(p_state, simulation.METHOD_LLG, simulation.SOLVER_SIB)

or call setup and delete manually:

# Import spirit
from spirit import state
from spirit import simulation

# Create a state using an input file
p_state = state.setup("input/input.toml")
# Start a LLG simulation using the SIB solver
simulation.start(p_state, simulation.METHOD_LLG, simulation.SOLVER_SIB)
# Delete the state and free memory etc.
state.delete(p_state)

You can pass an input file specifying your initial system parameters. If you do not pass an input file, the implemented defaults are used.

class spirit.state.State(configfile='', quiet=False)

Bases: object

Wrapper Class for a Spirit State.

Can be used as with spirit.state.State() as p_state:

spirit.state.date_time(p_state)

Returns a string containing the date-time of the creation of the state.

spirit.state.delete(p_state)
spirit.state.setup(configfile='', quiet=False)
spirit.state.to_config(p_state, filename, comment='')

Write a config (input) file corresponding to the current parameters etc. of the state.