TRExMC.jl
Documentation for TRExMC.
TRExMC.Models.LatticesTRExMC.TRExMCTRExMC.Models.Hamiltonians.AbstractDoFTRExMC.Models.Hamiltonians.AbstractHamiltonianTRExMC.Models.Hamiltonians.AbstractHamiltonianIteratorTRExMC.Models.Lattices.AbstractLatticeTRExMC.Models.ModelTRExMC.Models.Observables.AbstractObservablesTRExMC.Models.Observables.NullObservableTRExMC.Models.Hamiltonians.hamiltonianTRExMC.Models.Lattices.construct_lattice!TRExMC.Models.Lattices.nearest_neighborsTRExMC.Models.Lattices.num_sitesTRExMC.Models.Lattices.parametersTRExMC.Models.Lattices.site_indexTRExMC.Models.Observables._observablesTRExMC.Models.Observables.measure!TRExMC.Models.iterate_DoFsTRExMC.Models.latticeTRExMC.Models.observablesTRExMC.Models.rngTRExMC.Simulations.monte_carlo!TRExMC.Simulations.monte_carlo_run!TRExMC.Simulations.run_and_record!TRExMC.Simulations.thermalize!TRExMC.Algorithms.@algorithmTRExMC.Models.Observables.@observables
TRExMC.TRExMC — ModuleTRExMC: Thermodynamics via Replica-Exchange Monte Carlo
TRExMC.Models.Model — TypeModel{L, H[, O]}The main container used for simulations. The type parameters are given by
R <: Random.AbstractRNGL <:AbstractLatticeH <:AbstractHamiltonianO <:AbstractObservable- If no observable is provided, then the
NullObservableis used.
- If no observable is provided, then the
TRExMC.Models.Hamiltonians.hamiltonian — Methodhamiltonian(::Model)Convenience function to access the <:AbstractHamiltonian of a Model.
TRExMC.Models.Observables.measure! — Methodmeasure!(m::Model)Convenience function to take measurements in a Model.
TRExMC.Models.iterate_DoFs — Methoditerate_DoFs(m::AbstractModel)Wrapper to extract the Hamiltonian from the Model and iterate.
TRExMC.Models.lattice — Methodlattice(::Model)Convenience function to access the <:AbstractLattice of a Model.
TRExMC.Models.observables — Methodobservables(::Model)Convenience function to access the <:AbstractObservables of a Model.
TRExMC.Models.rng — Methodrng(::Model)Convenience function to access the Random Number Generator a Model.
TRExMC.Models.Lattices — Modulemodule Lattices
Main entry point for any simulated model to access an underlying geometrical structure. Currently comprised of the following subfiles:
- [
AbstractLattices.jl]:- Interface module that defines the `AbstractLattice as the supertype for all lattices
- [
CubicLattices.jl]:- Defines the
AbstractCubicLatticesubtype - Implements the
CubicLattice2D<: AbstractCubicLatticeand theCubicLattice2DParams
- Defines the
TRExMC.Models.Lattices.AbstractLattice — Typeabstract type AbstractLattice endThe supertype for all Types of lattices one can dream of.
Required Interface Methods
One must define the following methods for each new (non-abstract) AbstractLattice:
Default Interface Methods
The following represent the default methods for AbstractLattices. One may still overload them for any peculiar subtype.
TRExMC.Models.Lattices.construct_lattice! — Methodconstruct_lattice!(::AbstractLattice)Build a lattice and its geometry. Meant to be used in a constructor.
TRExMC.Models.Lattices.nearest_neighbors — Methodnearest_neighbors(::AbstractLattice, site)Return the set of nearest_neighbors for a given site in the AbstractLattice.
Example
julia> latt = Lattices.CubicLattice2D(4, 4);
julia> Lattices.nearest_neighbors(latt, 1)
4-element view(::Matrix{Int32}, 1, :) with eltype Int32:
13
4
2
5TRExMC.Models.Lattices.num_sites — Methodnum_sites(::AbstractLattice)Return the number of sites that an AbstractLattice contains.
Example
julia> latt = Lattices.CubicLattice2D(4, 4);
julia> Lattices.num_sites(latt)
16TRExMC.Models.Lattices.parameters — Methodparameters(::AbstractLattice)Return the parameters used to define the AbstractLattice.
Example
julia> latt = Lattices.CubicLattice2D(4, 4);
julia> Lattices.parameters(latt)
TRExMC.Models.Lattices.CubicLattice2DParams(4, 4)TRExMC.Models.Lattices.site_index — Methodsite_index(::AbstractLattice, indices::itr)Calculate the flattened index from an iterable set of indices in an AbstractLattice.
Example
julia> latt = Lattices.CubicLattice2D(4, 4);
julia> Lattices.site_index(latt, (1, 2))
5TRExMC.Models.Hamiltonians.AbstractDoF — Typeabstract type AbstractDoF endParent type for all degrees of freedom used in the simulations.
The required interface for all DoF types is the following:
DoF_location: Defines the in-memory identification for where the DoF is.DoF_value: Defines what the value of the DoF is (its current state).
TRExMC.Models.Hamiltonians.AbstractHamiltonian — Typeabstract type AbstractHamiltonian endParent type for all Hamiltonians in the simulation.
The required interface that all Hamiltonians must satisfy are specified by the following functions:
DoF: theAbstractDoFstored at a given memory locationenergy: total energy of the HamiltonianDoF_energy: energy associated with a singleAbstractDoF
TRExMC.Models.Hamiltonians.AbstractHamiltonianIterator — Typeabstract type AbstractHamiltonianIterator endIterface for iteration through a given Hamiltonian.
TRExMC.Models.Observables.AbstractObservables — Typeabstract type AbstractObservables endParent type for all observables.
Required Interface
The following methods must be implemented for all subtypes:
* [`measure!`](@ref): how one should take measurements of a system for a given system configuration.TRExMC.Models.Observables.NullObservable — TypeNullObservable <: AbstractObservablesEmpty observable used for testing purposes.
TRExMC.Models.Observables._observables — Method_observables(name, symbol_funcs::AbstractDict)
_observables(name, symbols, funcs)Return an Expression used by the @observables macro.
TRExMC.Models.Observables.@observables — Macro@observables name symbol_funcs::AbstractDict
@observables name symbols funcsGenerate an AbstractObservables subtype with the given name whose fields will be denoted by the given symbols iterable. The measure! method will also be implemented with the supplied [funcs] iterable.
Alternatively one can supply a Dictionary of symbol-function pairs as a single argument.
length(symbols) == length(funcs) by construction.
TRExMC.Algorithms.@algorithm — Macro@algorithmTRExMC.Simulations.monte_carlo! — Methodmonte_carlo!(models, algorithm, mcparams)A single sweep of the Monte Carlo simulation. It's an internal function that is supposed to be used by the monte_carlo_run! function.
TRExMC.Simulations.monte_carlo_run! — Methodmonte_carlo_run!(models, algorithm, mcparams; kwargs...)Main Monte Carlo function that performs a certain simulation algorithm on the systems defined by the given models. The parameters for the simulation are contained with mcparams.
Currently, the available keyword arguments (kwargs) are:
procedure::AbstractMCProcedure = MonteCarloSimulation(): defines the type of simulation to be runverbose = false: whether to dump the progress for run during the simulation
TRExMC.Simulations.run_and_record! — Methodrun_and_record!(models, algorithm, mcparams; [kwargs...])Monte Carlo simulation for a set of models to be simulated in parallel according to the specified algorithm with respect to the given parameters, mcparams.
This is a wrapper around monte_carlo_run! with procedure = MonteCarloSimulation().
TRExMC.Simulations.thermalize! — Methodthermalize(models, algorithm, mcparams; [kwargs...])Thermalization process for a given set of models to be thermalized in parallel according to the specified algorithm with respect to the given parameters, mcparams.
This is a wrapper around monte_carlo_run! with procedure = Thermalization().