SpinToolkit python documentation

Functions

spintoolkit_py.date_and_time() str

Return a string with the current date and time.

spintoolkit_py.total_omp_threads() int

Get the total number of OpenMP threads, or 1 if OpenMP is disabled.

spintoolkit_py.print_system_info() None

Print system information (e.g., CPU, compiler, OpenMP status) to the console.

spintoolkit_py.round2int(x: SupportsFloat) int

Round a floating-point number to the nearest integer.

spintoolkit_py.save_state_dipole(*, lattice: spintoolkit_py.lattice, s: spintoolkit_py.Vec3List, time: SupportsFloat, E: SupportsFloat, dump_dir: str, filename: str) None

Save a list of spin dipoles to a gzip compressed file.

Parameters:
  • lattice – Underlying lattice.

  • s – List of spin dipoles to be saved to file.

  • time – Current simulation time (e.g., sweep number in MC or time in molecular dynamics).

  • E – Current energy.

  • dump_dir – Directory for saving the state.

  • filename – Name of the file.

spintoolkit_py.save_state_SUN(*, lattice: spintoolkit_py.lattice, Z: spintoolkit_py.VecZList, time: SupportsFloat, E: SupportsFloat, dump_dir: str, filename: str) None

Save a list of SU(N) coherent states to a gzip compressed file.

Parameters:
  • lattice – Underlying lattice.

  • Z – List of SU(N) coherent states to be saved to file.

  • time – Current simulation time (e.g., sweep number in MC or time in molecular dynamics).

  • E – Current energy.

  • dump_dir – Directory for saving the state.

  • filename – Name of the file.

spintoolkit_py.load_state_dipole(*, lattice: spintoolkit_py.lattice, s: spintoolkit_py.Vec3List, dump_dir: str, filename: str) tuple[int, float, float]

Load a list of spin dipoles from a gzip compressed file.

Parameters:
  • lattice – Underlying lattice.

  • s – List of spin dipoles to be loaded from file (modified in-place).

  • dump_dir – Directory for loading the state.

  • filename – Name of the file.

Returns:

  • info (int) – Whether loading succeeded (0) or not (1).

  • time (float) – Simulation time from file (e.g., sweep number in MC or time in molecular dynamics).

  • E (float) – Energy from the file.

spintoolkit_py.load_state_SUN(*, lattice: spintoolkit_py.lattice, Z: spintoolkit_py.VecZList, dump_dir: str, filename: str) tuple[int, float, float]

Load a list of SU(N) coherent states from file a gzip compressed file.

Parameters:
  • lattice – Underlying lattice.

  • Z – List of SU(N) coherent states to be loaded from file (modified in-place).

  • dump_dir – Directory for loading the state.

  • filename – Name of the file.

Returns:

  • info (int) – Whether loading succeeded (0) or not (1).

  • time (float) – Simulation time from file (e.g., sweep number in MC or time in molecular dynamics).

  • E (float) – Energy from the file.