Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

cps::AlgHmc Class Reference

A class implementing the Hybrid Monte Carlo algorithm. More...

#include <alg_hmc.h>

List of all members.

Public Member Functions

 AlgHmc (AlgIntAB &integrator, CommonArg &c_arg, HmcArg &arg)
virtual ~AlgHmc ()
 Performs a single HMC trajectory.
Float run (void)

Protected Attributes

int g_size
 < The size of the gauge field.
Matrixgauge_field_init
 The final gauge field configuration.
Matrixgauge_field_final
 The initial gauge field configuration.
LRGState lrg_state
 The initial random numbers.
int config_no
Float h_init
 Initial Hamiltonian.
Float h_final
 Final Hamiltonian.
Float delta_h
 Final-Initial Hamiltonian.
Float h_delta
 Final-Initial Hamiltonian (reversibility).
Matrixmom
 The (traceless antihermitian) conjugate momentum field.
HmcArghmc_arg
CommonArgcommon_arg
AlgIntABintegrator
 The integrator which defines the algorithm.
unsigned int checksum [2]
 Store the checksums of the final lattice (used for repro test).


Detailed Description

A class implementing the Hybrid Monte Carlo algorithm.

This is an abstract implementation of HMC, the exact type of hmc is determined by the integrator that is passed to it.

The main method evolves a gauge field along a molecular dynamics trajectory followed by a metropolis accept/reject step using the integrator which is passed to it.

Definition at line 40 of file alg_hmc.h.


Constructor & Destructor Documentation

cps::AlgHmc::AlgHmc AlgIntAB Integrator,
CommonArg c_arg,
HmcArg arg
 

Parameters:
Integrator The integrator which defines the HMC type.
c_arg The common argument structure for all algorithms.
arg The algorithm parameters.

< Allocate memory for the initial gauge field.

< Allocate memory for the final gauge field.

Definition at line 61 of file alg_hmc.C.

References common_arg, cps::F_CLASS_NONE, cps::Float, cps::Verbose::Func(), cps::G_CLASS_NONE, g_size, gauge_field_final, gauge_field_init, cps::GJP, cps::Lattice::GsiteSize(), hmc_arg, integrator, cps::HmcArg::reverse, cps::smalloc(), cps::GlobalJobParameter::VolNodeSites(), and cps::VRB.

cps::AlgHmc::~AlgHmc  )  [virtual]
 

Performs a single HMC trajectory.

< Free memory for the final gauge field.

Definition at line 96 of file alg_hmc.C.

References cps::Verbose::Func(), gauge_field_final, gauge_field_init, hmc_arg, cps::HmcArg::reverse, cps::sfree(), and cps::VRB.


Member Function Documentation

Float cps::AlgHmc::run void   ) 
 

Returns:
The probability used in the metropolis step.
Postcondition:
The following results are written to the file specified in the CommonArg structure:
  1. Number of molecular dynamics steps + 1
  2. Change in the hamiltonian
  3. 1/0 if accepted/rejected
  4. A measure of the change in the gauge field due to reunitarisation
  5. Another measure of the change in the gauge field due to reunitarisation
  6. Average number of solver iterations.
  7. Minimum number of solver iterations.
  8. Maximum number of solver iterations.
  9. Average solver residue
  10. Minimum solver residue
  11. Maximum solver residue

< Save initial lattice and rngs (if necessary)

< Must initialise the integrator

< Restore state if necessary

< Calculate initial Hamiltonian

< Metropolis step

< Calculate average of monitor variables

< Print out monitor info

Definition at line 134 of file alg_hmc.C.

References cps::CgStats::cg_calls, cps::CgStats::cg_iter_av, cps::CgStats::cg_iter_max, cps::CgStats::cg_iter_min, cps::CgStats::cg_iter_total, checksum, common_arg, config_no, cps::AlgIntAB::cost(), delta_h, cps::AlgIntAB::energy(), cps::ERR, cps::AlgIntAB::evolve(), cps::F_CLASS_NONE, cps::Fclose(), cps::Error::FileA(), cps::Float, cps::Verbose::Flow(), cps::Fopen(), cps::Fprintf(), cps::Verbose::Func(), cps::G_CLASS_NONE, gauge_field_init, cps::Lattice::GaugeField(), cps::GDS, cps::GJP, cps::glb_sum(), cps::global_checksum(), cps::Lattice::GsoCheck(), cps::Lattice::GupdCnt(), cps::Lattice::GupdCntInc(), h_delta, h_final, h_init, cps::Error::Hardware(), cps::AlgIntAB::heatbath(), hmc_arg, cps::IFloat, cps::AlgIntAB::init(), integrator, cps::HmcArg::metropolis, cps::Lattice::MetropolisAccept(), cps::MPISCU::printf(), cps::HmcArg::reproduce_attempt_limit, cps::Verbose::Result(), cps::CommonArg::results, cps::Lattice::Reunitarize(), cps::HmcArg::reunitarize, cps::AlgIntAB::reverse(), cps::HmcArg::reverse, cps::GlobalDataShift::SetOrigin(), cps::GlobalJobParameter::Snodes(), cps::Lattice::SoCheck(), cps::HmcArg::step_size, cps::HmcArg::steps_per_traj, cps::CgStats::true_rsd_av, cps::CgStats::true_rsd_max, cps::CgStats::true_rsd_min, cps::VRB, cps::HmcArg::wfm_md_sloppy, and cps::wilson_set_sloppy().


Member Data Documentation

unsigned int cps::AlgHmc::checksum[2] [protected]
 

Store the checksums of the final lattice (used for repro test).

Definition at line 100 of file alg_hmc.h.

Referenced by run().

CommonArg* cps::AlgHmc::common_arg [protected]
 

Definition at line 94 of file alg_hmc.h.

Referenced by AlgHmc(), and run().

int cps::AlgHmc::config_no [protected]
 

Definition at line 80 of file alg_hmc.h.

Referenced by run().

Float cps::AlgHmc::delta_h [protected]
 

Final-Initial Hamiltonian.

Definition at line 84 of file alg_hmc.h.

Referenced by run().

int cps::AlgHmc::g_size [protected]
 

< The size of the gauge field.

The size of the gauge field on the local lattice in terms of the total number of floating point numbers.

Definition at line 64 of file alg_hmc.h.

Referenced by AlgHmc().

Matrix* cps::AlgHmc::gauge_field_final [protected]
 

The initial gauge field configuration.

Definition at line 73 of file alg_hmc.h.

Referenced by AlgHmc(), and ~AlgHmc().

Matrix* cps::AlgHmc::gauge_field_init [protected]
 

The final gauge field configuration.

Definition at line 70 of file alg_hmc.h.

Referenced by AlgHmc(), run(), and ~AlgHmc().

Float cps::AlgHmc::h_delta [protected]
 

Final-Initial Hamiltonian (reversibility).

Definition at line 85 of file alg_hmc.h.

Referenced by run().

Float cps::AlgHmc::h_final [protected]
 

Final Hamiltonian.

Definition at line 83 of file alg_hmc.h.

Referenced by run().

Float cps::AlgHmc::h_init [protected]
 

Initial Hamiltonian.

Definition at line 82 of file alg_hmc.h.

Referenced by run().

HmcArg* cps::AlgHmc::hmc_arg [protected]
 

Definition at line 93 of file alg_hmc.h.

Referenced by AlgHmc(), run(), and ~AlgHmc().

AlgIntAB* cps::AlgHmc::integrator [protected]
 

The integrator which defines the algorithm.

Definition at line 97 of file alg_hmc.h.

Referenced by AlgHmc(), and run().

LRGState cps::AlgHmc::lrg_state [protected]
 

The initial random numbers.

Definition at line 78 of file alg_hmc.h.

Matrix* cps::AlgHmc::mom [protected]
 

The (traceless antihermitian) conjugate momentum field.

This is i times the actual conjugate momentum.

Definition at line 88 of file alg_hmc.h.


The documentation for this class was generated from the following files:
Generated on Sat Oct 10 14:11:55 2009 for Columbia Physics System by  doxygen 1.3.9.1