42 int NConf,
double epsilon,
43 std::string startType)
46 m_thermSteps = thermSteps;
48 m_correlationSteps = m_MCSteps / m_confs;
50 m_startType = startType;
68 if(m_startType ==
"Cold")
70 else if (m_startType ==
"Hot")
74 for(
auto& obs :
m_obs)
75 obs->initObservable(
m_lat);
77 m_obsValues.resize(m_obs.size());
86 if(Parallel::isActive()){
99 for(
int step = 1; step <= m_thermSteps; step++){
104 if(step % m_correlationSteps == 0){
117 for(
int step = 1; step <= m_MCSteps; step++){
122 if(step % m_correlationSteps == 0){
137 auto thermStart = std::chrono::system_clock::now();
138 auto thermStepStart = std::chrono::system_clock::now();
139 for(
int step = 1; step <= m_thermSteps; step++){
144 if(step % m_correlationSteps == 0){
147 std::chrono::duration<double> thermStepTime = std::chrono::system_clock::now()-thermStepStart;
148 if(Parallel::rank() == 0)
149 printf(
"\tThermalization Step Time: %lf s\n\n", thermStepTime.count());
150 thermStepStart = std::chrono::system_clock::now();
153 std::chrono::duration<double> thermTime = std::chrono::system_clock::now()-thermStart;
154 if(Parallel::rank() == 0){
155 printf(
"Total Thermalization Steps: %i\n", m_thermSteps);
156 printf(
"Total Thermalization Time: %lf s\n\n", thermTime.count());
166 auto confUpdateStart = std::chrono::system_clock::now();
167 auto writeStart = std::chrono::system_clock::now();
168 for(
int step = 1; step <= m_MCSteps; step++){
173 if(step % m_correlationSteps == 0){
176 std::chrono::duration<double> confUpdateTime = std::chrono::system_clock::now()-confUpdateStart;
177 if(Parallel::rank() == 0)
178 printf(
"\tConfiguration Update: %lf s\n", confUpdateTime.count());
179 writeStart = std::chrono::system_clock::now();
182 std::chrono::duration<double> writeTime = std::chrono::system_clock::now()-writeStart;
183 if(Parallel::rank() == 0)
184 printf(
"\tWrite Time: %lf s\n\n", writeTime.count());
185 confUpdateStart = std::chrono::system_clock::now();
194 for(
int x = 0; x <
m_size[0]; x++){
195 for(
int y = 0; y < m_size[1]; y++){
196 for(
int z = 0; z < m_size[2]; z++){
197 for(
int t = 0; t < m_size[3]; t++){
198 for(
int mu = 0; mu < 4; mu++){
210 for(
int i = 0; i < 30; i++){
215 (*m_lat)(x,y,z,t)[mu] = newLink;
224 for(
auto& obs :
m_obs)
std::vector< Observable * > m_obs
Vector of pointers to Observable instances.
static void printInitialConditions()
Prints basic info about the system.
static double randUniform()
returns a number from a uniform distribution between 0 and 1
void sampleConf()
Performs the Monte Carlo updates, every N_Corr saves the lattice and computes observables.
static SU3 randSU3Transf(double epsilon)
returns a random SU3 element with controlled spread around the unity matrix.
void execute()
Executes the App code. Perform initialization of subclasses and the system, then runst the Monte Carl...
static void printThermStep(int step, std::vector< Observable * > &obsList, double acceptRatio)
Prints information about a thermalization step.
Main include file for all headers.
GluonField * m_lat
Pointer to the GluonField instance.
std::array< int, 4 > m_size
Size of the sublattice.
static void printGenStep(int confNum, std::vector< Observable * > &obsList, double acceptRatio)
Prints information about a generation step.
void computeObservables()
Computes the Observable value for all memebers of the m_obs vector.
void sampleConfTime()
Performs the Monte Carlo updates, every N_Corr saves the lattice and computes observables. Prints out times of execution.
void thermalizeTime()
Perform N_Therm Monte Carlo updates to thermalize the system. Prints times of execution.
virtual double compute(int x, int y, int z, int t, int mu, SU3 &newLink)=0
Computes the action difference around a given link for a suggested move.
void generateConfigurations()
Run the thermalization first, then the sampling of configurations.
void initAction(GluonField *field)
Links the action to a given field and initializes.
Action * m_act
Pointer to the Action instance.
void MCUpdate()
Loops over all links and tres to update them.
static void writeObs(std::vector< Observable * > &obsList, int MCSteps)
Writes the list of observables to file at given generation point.
void thermalize()
Perform N_Therm Monte Carlo updates to thermalize the system.
SU3 exp(const SU3 &Q)
exponential of a SU3 algebra matrix
GaugeFieldFactory(int MCSteps, int thermSteps, int NConf, double epsilon, std::string startType)
Constructor of the GaugeFieldFactory object.
void updateLink(int x, int y, int z, int t, int mu)
Tries to update a single link 30 times (N_Hits)
static void writeConf(GluonField &lattice, int confNum)
Saves the given GluonField object to the ouput directory.
void initialize()
Initializes the GluonField based on the initial condition (hot/cold), runs the initializers of the su...
static void initialize(std::vector< Observable * > &obsList)
Opens the files and writes needed headers.
Prototype for the App class group.
virtual void computeStaples(int mu)=0
Computes the sum of the staples around all links.