From d1d89e3a1ef97cd6443d4b0f4890a388d106e32d Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 9 Nov 2021 10:30:38 +0100 Subject: Testing implementation of the 2 + 4 spin. --- langevin.cpp | 19 +++++++++---------- 1 file 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 pSpin; + pSpinModel pSpin; - std::get<0>(pSpin.Js) = generateCouplings(N, std::normal_distribution(0, σ), r.engine()); + std::get<0>(pSpin.Js) = generateCouplings(N, std::normal_distribution(0, σ2), r.engine()); + std::get<1>(pSpin.Js) = generateCouplings(N, std::normal_distribution(0, σ4 / 10), r.engine()); std::normal_distribution Red(0, 1); @@ -108,7 +111,7 @@ int main(int argc, char* argv[]) { complex_normal_distribution d(0, 1, 0); - pSpinModel complexPSpin = pSpin.cast();; + pSpinModel complexPSpin = pSpin.cast();; ComplexVector zSaddle = zMin.cast(); 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& g : test.gs) { - std::cout << g.transpose() << std::endl; - } + std::cout << test.totalCost(10) << " " << test.totalCost(20) << std::endl; return 0; } -- cgit v1.2.3-70-g09d2