Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

back to su3 #45

Merged
merged 2 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions include/omeasurements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,24 @@ namespace omeasurements {
* @return double
*/
template <class Group>
double get_retr_plaquette_density(const gaugeconfig<Group> &U, const std::string &bc) {
const double ndims_fact = spacetime_lattice::num_pLloops_half(U.getndims());
double get_retr_plaquette_density(const gaugeconfig<Group> &U,
const std::string &bc,
const bool &spatial = false) {
const double ndims_fact =
spacetime_lattice::num_pLloops_half(U.getndims() - int(spatial));
double P = 0.0; // plaquette density value
double den = ndims_fact * double(U.getNc());

if (bc == "periodic") {
using flat_spacetime::retr_sum_Wplaquettes;
P = retr_sum_Wplaquettes(U); // xi=1.0, anisotropic=false, spatial_only=false
P = flat_spacetime::retr_sum_Wplaquettes(U, /*xi=*/1.0, /*anisotropic=*/false,
/*spatial=*/spatial);
den *= U.getVolume();
} else if (bc == "spatial_open") {
const size_t ndims = U.getndims();
obc::weights w(bc, U.getLx(), U.getLy(), U.getLz(), U.getLt(), ndims);

P = obc::retr_sum_Wplaquettes(U, w); // xi = 1.0, anisotropic = false
P = obc::retr_sum_Wplaquettes(U, w, /*xi=*/1.0, /*anisotropic=*/false,
/*spatial=*/spatial);
if (ndims > 0) {
den *= U.getLt();
if (ndims > 1) {
Expand Down Expand Up @@ -92,10 +96,9 @@ namespace omeasurements {
const std::string path = oss.str();
std::ofstream ofs(path, std::ios::out);

const double ndims_fact = spacetime_lattice::num_pLloops_half(U.getndims());

ofs << "i P\n";
double P = get_retr_plaquette_density(U, S.plaquette.bc); // plaquette density value
// plaquette density value
const double P = get_retr_plaquette_density(U, S.plaquette.bc, S.plaquette.spatial);
ofs << i << std::scientific << std::setprecision(16) << " " << P << "\n";
ofs.close();

Expand Down
1 change: 1 addition & 0 deletions include/parameters.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ namespace global_parameters {

std::string subdir = ""; // subdirectory of the online measurements directory

bool spatial = false; // true when computing only the spatial contributions
// boundary condition type (note: can be different from the MCMC)
std::string bc = "periodic";
};
Expand Down
3 changes: 2 additions & 1 deletion parse_input_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,12 @@ namespace input_file_parsing {

mpparams.measure_it = true;
in.read_opt_verb<std::string>(mpparams.subdir, {"subdir"});
in.read_opt_verb<bool>(mpparams.spatial, {"spatial"});
in.read_opt_verb<std::string>(mpparams.bc, {"bc"});
if (nd["bc"]) {
check_bc(mpparams.bc);
}

in.set_InnerTree(state0); // reset to previous state
}

Expand Down