Class Simulation#

class py_alf.Simulation(alf_src, ham_name, sim_dict, **kwargs)#

Object corresponding to an ALF simulation.

Parameters:
alf_srcALF_source

Objet representing ALF source code.

ham_namestr

Name of the Hamiltonian.

sim_dictdict or list of dicts

Dictionary specfying parameters owerwriting defaults. Can be a list of dictionaries to enable parallel tempering.

sim_dirpath-like object, optional

Directory in which the Monte Carlo will be run. If not specified, sim_dir is generated from sim_dict.

sim_rootpath-like object, default=”ALF_data”

Directory to prepend to sim_dir.

mpibool, default=False

Employ MPI.

parallel_paramsbool, default=False

Run independent parameter sets in parallel. Based on parallel tempering, but without exchange steps.

n_mpiint, default=2

Number of MPI processes if mpi is true.

n_ompint, default=1

Number of OpenMP threads per process.

mpiexecstr, default=”mpiexec”

Command used for starting a MPI run. This may have to be adapted to fit with the MPI library used at compilation. Possible candidates include ‘orterun’, ‘mpiexec.hydra’.

mpiexec_argslist of str, optional

Additional arguments to MPI executable. E.g. the flag --hostfile /path/to/file is specified by mpiexec_args=['--hostfile', '/path/to/file']

machine{“GNU”, “INTEL”, “PGI”, “Other machines defined in configure.sh”}

Compiler and environment.

stabstr, optional

Stabilization strategy employed by ALF. Possible values: “STAB1”, “STAB2”, “STAB3”, “LOG”. Not case sensitive.

develbool, default=False

Compile with additional flags for development and debugging.

hdf5bool, default=True

Whether to compile ALF with HDF5. Full postprocessing support only exists with HDF5.

analysis(python_version=True, **kwargs)#

Perform default analysis on Monte Carlo data.

Calls py_alf.analysis(), if run with python_version=True.

Parameters:
python_versionbool, default=True

Use Python version of analysis. The non-Python version is legacy and does not support all postprocessing features.

**kwargsdict, optional

Extra arguments for py_alf.analysis(), if run with python_version=True.

check_rebin(names, gui='tk', **kwargs)#

Plot error vs n_rebin to control autocorrelation.

Parameters:
nameslist of str

Names of observables to check.

gui{‘tk’, ‘ipy’}

Whether to use Tkinter or Jupyter Widget for GUI. default: ‘tk’

**kwargsdict, optional

Extra arguments for py_alf.check_rebin_tk() or py_alf.check_rebin_ipy().

check_warmup(names, gui='tk', **kwargs)#

Plot bins to determine n_skip.

Parameters:
nameslist of str

Names of observables to check.

gui{‘tk’, ‘ipy’}

Whether to use Tkinter or Jupyter Widget for GUI. default: ‘tk’

**kwargsdict, optional

Extra arguments for py_alf.check_warmup_tk() or py_alf.check_warmup_ipy().

compile(verbosity=0)#

Compile ALF.

Parameters:
verbosityint, default=0

0: Don’t echo make reciepes. 1: Echo make reciepes. else: Print make tracing information.

get_directories()#

Return list of directories connected to this simulation.

get_obs(python_version=True)#

Return Pandas DataFrame containing anaysis results from observables.

The non-python version is legacy and does not support all postprocessing features, e.g. time-displaced observables.

print_info_file()#

Print info file(s) that get generated by ALF.

run(copy_bin=False, only_prep=False, bin_in_sim_dir=False)#

Prepare simulation directory and run ALF.

Parameters:
copy_binbool, default=False

Copy ALF binary into simulation directory.

only_prepbool, default=False

Do not run ALF, only prepare simulation directory.

bin_in_sim_dirbool, default=False

Assume that the ALF binary is already present in simultation directory and use this.

\(\phantom{\xi}\)