summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-11-09 10:30:38 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-11-09 10:30:38 +0100
commitd1d89e3a1ef97cd6443d4b0f4890a388d106e32d (patch)
tree1a2d106572dba1e0374645a1b03979634c1e2bdf
parent09adffc5f67dbb41905b254224e8c2d2b46d1516 (diff)
downloadcode-d1d89e3a1ef97cd6443d4b0f4890a388d106e32d.tar.gz
code-d1d89e3a1ef97cd6443d4b0f4890a388d106e32d.tar.bz2
code-d1d89e3a1ef97cd6443d4b0f4890a388d106e32d.zip
Testing implementation of the 2 + 4 spin.
-rw-r--r--langevin.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/langevin.cpp b/langevin.cpp
index dc3d07d..8ecd69c 100644
--- a/langevin.cpp
+++ b/langevin.cpp
@@ -82,13 +82,16 @@ int main(int argc, char* argv[]) {
}
Complex κ(Rκ, Iκ);
- Real σ = sqrt(factorial(p) / ((Real)2 * pow(N, p - 1)));
+ Real σp = sqrt(factorial(p) / ((Real)2 * pow(N, p - 1)));
+ Real σ2 = sqrt(factorial(2) / ((Real)2 * pow(N, 2 - 1)));
+ Real σ4 = sqrt(factorial(4) / ((Real)2 * pow(N, 4 - 1)));
Rng r;
- pSpinModel<Real, p> pSpin;
+ pSpinModel<Real, 2, 4> pSpin;
- std::get<0>(pSpin.Js) = generateCouplings<Real, p>(N, std::normal_distribution<Real>(0, σ), r.engine());
+ std::get<0>(pSpin.Js) = generateCouplings<Real, 2>(N, std::normal_distribution<Real>(0, σ2), r.engine());
+ std::get<1>(pSpin.Js) = generateCouplings<Real, 4>(N, std::normal_distribution<Real>(0, σ4 / 10), r.engine());
std::normal_distribution<Real> Red(0, 1);
@@ -108,7 +111,7 @@ int main(int argc, char* argv[]) {
complex_normal_distribution<Real> d(0, 1, 0);
- pSpinModel<Complex, p> complexPSpin = pSpin.cast<Complex>();;
+ pSpinModel<Complex, 2, 4> complexPSpin = pSpin.cast<Complex>();;
ComplexVector zSaddle = zMin.cast<Complex>();
ComplexVector zSaddleNext;
@@ -132,16 +135,12 @@ int main(int argc, char* argv[]) {
std::cerr << (zSaddle - zSaddleNext).norm() / (Real)N << " " << φ << " " << H1 * exp(Complex(0, φ)) << " " << H2 * exp(Complex(0, φ)) << std::endl;
std::get<0>(complexPSpin.Js) = exp(Complex(0, φ)) * std::get<0>(complexPSpin.Js);
+ std::get<1>(complexPSpin.Js) = exp(Complex(0, φ)) * std::get<1>(complexPSpin.Js);
Cord test(complexPSpin, zSaddle, zSaddleNext, 3);
test.relaxNewton(10, 1, 1e4);
- std::cout << test.z0.transpose() << std::endl;
- std::cout << test.z1.transpose() << std::endl;
-
- for (Vector<Complex>& g : test.gs) {
- std::cout << g.transpose() << std::endl;
- }
+ std::cout << test.totalCost(10) << " " << test.totalCost(20) << std::endl;
return 0;
}