summaryrefslogtreecommitdiff
path: root/torus_symmetries.hpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2020-07-20 13:35:48 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2020-07-20 13:35:48 -0400
commit4740abed9fcd40359a9ced3a97ac1b9f56e379a0 (patch)
tree5a49c24fa4421b77c6d8e7def524379233013cc5 /torus_symmetries.hpp
parent468c25eabd1aaac7d02988fef97b66bb378988b3 (diff)
downloadspace_wolff-master.tar.gz
space_wolff-master.tar.bz2
space_wolff-master.zip
Thesis work.HEADmaster
Diffstat (limited to 'torus_symmetries.hpp')
-rw-r--r--torus_symmetries.hpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/torus_symmetries.hpp b/torus_symmetries.hpp
index 53f61ac..829c886 100644
--- a/torus_symmetries.hpp
+++ b/torus_symmetries.hpp
@@ -122,3 +122,54 @@ Gen<double, D, TorusGroup<double, D>, S> uniformGenTorus(double L) {
};
}
+template <int D, class S>
+Gen<double, D, TorusGroup<double, D>, S> rotateSwapTorus(double L, double ε) {
+ return [L, ε](Model<double, D, TorusGroup<double, D>, S>& M,
+ Rng& rng) -> Transformation<double, D, TorusGroup<double, D>, S>* {
+ Spin<double, D, S>* s1 = rng.pick(M.s);
+ Spin<double, D, S>* s2 = rng.pick(M.s);
+
+ while (s1 == s2) {
+ s2 = rng.pick(M.s);
+ }
+
+ Vector<double, D> t1 = s1->x;
+ Vector<double, D> t2 = s2->x;
+ Vector<double, D> t = (t1 + t2) / 2;
+
+ t(0) = mod(t(0) + rng.variate<double>(0, ε), L);
+ t(1) = mod(t(1) + rng.variate<double>(0, ε), L);
+
+ Matrix<double, D> m;
+
+ m(0, 0) = -1;
+ m(1, 1) = -1;
+ m(0, 1) = 0;
+ m(1, 0) = 0;
+
+ TorusGroup<double, D> g(L, t - m * t, m);
+
+ return new PairFlip<double, D, TorusGroup<double, D>, S>(M, g, s1, s2);
+ };
+}
+
+template <int D, class S>
+Gen<double, D, TorusGroup<double, D>, S> nudgeGenTorus(double L, double ε) {
+ std::vector<Matrix<double, D>> torusMatrices = torus_mats<double, D>();
+ return [L, ε,
+ torusMatrices](Model<double, D, TorusGroup<double, D>, S>& M,
+ Rng& rng) -> Transformation<double, D, TorusGroup<double, D>, S>* {
+ Matrix<double, D> m = rng.pick(torusMatrices);
+ Spin<double, D, S>* s = rng.pick(M.s);
+ Vector<double, D> t = s->x;
+
+ for (unsigned i = 0; i < D; i++) {
+ t(i) = mod(t(i) + rng.variate<double>(0, ε), L);
+ }
+
+ TorusGroup<double, D> g = TorusGroup<double, D>({(double)L, t - m * t, m});
+
+ return new SpinFlip<double, D, TorusGroup<double, D>, S>(M, g, s);
+ };
+}
+