Monte Carlo (MC)

spirit.parameters.mc.get_iterations(p_state, idx_image=-1, idx_chain=-1)

Returns the maximum number of iterations and the step size.

spirit.parameters.mc.get_metropolis_cone(p_state, idx_image=-1, idx_chain=-1)

Returns the Metropolis algorithm configuration.

  • whether the spins are displaced within a cone (otherwise: on the entire unit sphere)
  • the opening angle within which the spin is placed
  • whether the cone angle is automatically adapted to achieve the set acceptance ratio
  • target acceptance ratio for the adaptive cone algorithm
spirit.parameters.mc.get_temperature(p_state, idx_image=-1, idx_chain=-1)

Returns the global base temperature [K].

spirit.parameters.mc.set_iterations(p_state, n_iterations, n_iterations_log, idx_image=-1, idx_chain=-1)

Set the number of iterations and how often to log and write output.

  • n_iterations: the maximum number of iterations
  • n_iterations_log: the number of iterations after which status is logged and output written
spirit.parameters.mc.set_metropolis_cone(p_state, use_cone=True, cone_angle=40, use_adaptive_cone=True, target_acceptance_ratio=0.5, idx_image=-1, idx_chain=-1)

Configure the Metropolis parameters.

  • use_cone: whether to displace the spins within a cone (otherwise: on the entire unit sphere)
  • cone_angle: the opening angle within which the spin is placed
  • use_adaptive_cone: automatically adapt the cone angle to achieve the set acceptance ratio
  • target_acceptance_ratio: target acceptance ratio for the adaptive cone algorithm
spirit.parameters.mc.set_output_configuration(p_state, step=False, archive=True, filetype=3, idx_image=-1, idx_chain=-1)

Set whether to write spin configuration output files.

  • step: whether to write a new file after each set of iterations
  • archive: whether to append to an archive file after each set of iterations
  • filetype: the format in which the data is written
spirit.parameters.mc.set_output_energy(p_state, step=False, archive=True, spin_resolved=False, divide_by_nos=True, add_readability_lines=True, idx_image=-1, idx_chain=-1)

Set whether to write energy output files.

  • step: whether to write a new file after each set of iterations
  • archive: whether to append to an archive file after each set of iterations
  • spin_resolved: whether to write a file containing the energy of each spin
  • divide_by_nos: whether to divide energies by the number of spins
  • add_readability_lines: whether to separate columns by lines
spirit.parameters.mc.set_output_folder(p_state, folder, idx_image=-1, idx_chain=-1)

Set the folder, where output files are placed.

spirit.parameters.mc.set_output_general(p_state, any=True, initial=False, final=False, idx_image=-1, idx_chain=-1)

Set whether to write any output files at all.

spirit.parameters.mc.set_output_tag(p_state, tag, idx_image=-1, idx_chain=-1)

Set the tag placed in front of output file names.

If the tag is “<time>”, it will be the date-time of the creation of the state.

spirit.parameters.mc.set_temperature(p_state, temperature, idx_image=-1, idx_chain=-1)

Set the global base temperature [K].