summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-09-05 22:45:39 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-09-05 22:45:39 -0400
commit10510b7e2a09c102c307165e0cd716e17b17ef84 (patch)
treede7838a18d015245e70ac2ce4c666ced2edd2ed5 /src
parent8a4d4521758f23c960986a0f59d5925eb1a4292b (diff)
downloadc++-10510b7e2a09c102c307165e0cd716e17b17ef84.tar.gz
c++-10510b7e2a09c102c307165e0cd716e17b17ef84.tar.bz2
c++-10510b7e2a09c102c307165e0cd716e17b17ef84.zip
fixed a bug in perturbative generation and set up epsilon to be automatically set by T and H
Diffstat (limited to 'src')
-rw-r--r--src/wolff_On.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/wolff_On.cpp b/src/wolff_On.cpp
index 6cd8777..736eb1b 100644
--- a/src/wolff_On.cpp
+++ b/src/wolff_On.cpp
@@ -142,6 +142,22 @@ int main(int argc, char *argv[]) {
std::function <orthogonal_R_t(gsl_rng *, vector_R_t)> gen_R;
if (use_pert) {
+ double Hish;
+ if (modulated_field) {
+ Hish = fabs(H_vec[0]);
+ } else {
+ double H2 = 0;
+ for (q_t i = 0; i < N_COMP; i++) {
+ H2 += pow(H_vec[i], 2);
+ }
+ Hish = sqrt(H2);
+ }
+
+ if (Hish > 1.0) {
+ epsilon = sqrt(T / Hish);
+ } else {
+ epsilon = sqrt(T);
+ }
gen_R = std::bind(generate_rotation_perturbation <N_COMP>, std::placeholders::_1, std::placeholders::_2, epsilon, order);
pert_type = "PERTURB";
} else {