From 7aa5c888a4e08a1de29cf7b2af83b83760cd713f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Viana?= <57032457+vollous@users.noreply.github.com> Date: Thu, 25 Apr 2024 19:04:59 +0100 Subject: [PATCH] Remove unused function --- include/BSMPT/minimum_tracer/minimum_tracer.h | 10 -- src/minimum_tracer/minimum_tracer.cpp | 125 ------------------ 2 files changed, 135 deletions(-) diff --git a/include/BSMPT/minimum_tracer/minimum_tracer.h b/include/BSMPT/minimum_tracer/minimum_tracer.h index 12e3d57a..7229fc3b 100644 --- a/include/BSMPT/minimum_tracer/minimum_tracer.h +++ b/include/BSMPT/minimum_tracer/minimum_tracer.h @@ -236,16 +236,6 @@ class MinimumTracer const bool &output = true, const bool &unprotected = false); - /** - * @brief Calculates the VEV splitting when Hessian matrix gets a single - * negative eigenvalue. - * - * @param point where grad is zero and hessian is not positive definite - * @param T is the temperature. - */ - void CalculateVEVSplittings(const std::vector &point, - const double &T); - /** * @brief bool to store whether flat directions are found */ diff --git a/src/minimum_tracer/minimum_tracer.cpp b/src/minimum_tracer/minimum_tracer.cpp index 0cb40b17..e3db654d 100644 --- a/src/minimum_tracer/minimum_tracer.cpp +++ b/src/minimum_tracer/minimum_tracer.cpp @@ -420,7 +420,6 @@ MinimumTracer::TrackPhase(double &globMinEndT, { zeroTemp = FindZeroSmallestEigenvalue( point, currentT - dT, new_point, currentT); - // CalculateVEVSplittings(new_point, currentT); if (zeroTemp.back() > 0) { currentT = zeroTemp.back(); @@ -694,7 +693,6 @@ MinimumTracer::TrackPhase(const std::vector &point_In, { zeroTemp = FindZeroSmallestEigenvalue( point, currentT - dT, new_point, currentT); - // CalculateVEVSplittings(new_point, currentT); if (zeroTemp.back() > 0) { currentT = zeroTemp.back(); @@ -780,129 +778,6 @@ MinimumTracer::TrackPhase(const std::vector &point_In, return MinimumList; } -void MinimumTracer::CalculateVEVSplittings(const std::vector &point, - const double &T) -{ - double eps = 0.1; - int dim = this->modelPointer->get_nVEV(); - std::function)> V; - std::function(std::vector)> dV; - std::function>(std::vector)> Hessian; - // Define potential 1 - V = [&](std::vector vev) - { - // Potential wrapper - std::vector res = this->modelPointer->MinimizeOrderVEV(vev); - return this->modelPointer->VEff(res, T) / (1 + T * T); - }; - - dV = [=](auto const &arg) { return NablaNumerical(arg, V, eps, dim); }; - Hessian = [=](auto const &arg) { return HessianNumerical(arg, V, eps, dim); }; - std::vector> current_hessian = Hessian(point); - // Calculate smallest EV - Eigen::MatrixXd mat(dim, dim); - for (int i = 0; i < dim; i++) - { - mat.col(i) = Eigen::Map(current_hessian[i].data(), dim); - } - - // Eigensolver - EigenSolver eigenValueSolver(mat); - MatrixXd eigenvalueMatrix = eigenValueSolver.eigenvalues().real(); - // the eigenvectors are stored column wise - MatrixXd eigenvectorMatrix = eigenValueSolver.eigenvectors().real(); - // Determine the eigenvector with the smallest eigenvalue - double SEV = 1e100; - VectorXd EigenVector; - for (int it = 0; it < dim; it++) - { - if (eigenvalueMatrix(it) < SEV) - { - SEV = eigenvalueMatrix(it); - EigenVector = eigenvectorMatrix.col(it); - } - } - - // Typecast to std::vector - std::vector NegativeDirection( - EigenVector.data(), - EigenVector.data() + EigenVector.rows() * EigenVector.cols()); - - std::function(double)> LineFromSaddlePoint = [&](double l) - { return point + l * NegativeDirection; }; - - std::function V_l = [&](double l) - { return V(LineFromSaddlePoint(l)); }; - - // Search roughly in one direction - - double Candidate_l, Best_l = 0; - double V_of_candidate = 1e100; - for (double m = -1; m <= 1; m += 0.1) - { - Candidate_l = dim * exp(m); - if (V_l(Candidate_l) < V_of_candidate) - { - Best_l = Candidate_l; - V_of_candidate = V_l(Candidate_l); - } - } - if (Candidate_l > 0) - { - std::vector Candidate = - LocateMinimum(LineFromSaddlePoint(Best_l), - dV, - Hessian, - 1e-4 * GradientThreshold * dim); - - if (L2NormVector(dV(Candidate) / dim) < GradientThreshold and - SmallestEigenvalue(Candidate, Hessian) > 0) - { - Minimum NewMinimumFound; - ReduceVEV(Candidate); - ConvertToNonFlatDirections(Candidate); - NewMinimumFound.point = Candidate; - NewMinimumFound.temp = T; - NewMinimumFound.potential = V(NewMinimumFound.point) * (1 + T * T); - SavedMinimaFromVEVSplitting.push_back(NewMinimumFound); - } - } - - // Other direction - - V_of_candidate = 1e100; - for (double m = -10.; m <= 1; m += 0.1) - { - Candidate_l = -dim * exp(m); - if (V_l(Candidate_l) < V_of_candidate) - { - Best_l = Candidate_l; - V_of_candidate = V_l(Candidate_l); - } - } - - if (Candidate_l < 0) - { - std::vector Candidate = - LocateMinimum(LineFromSaddlePoint(Best_l), - dV, - Hessian, - 1e-4 * GradientThreshold * dim); - - if (L2NormVector(dV(Candidate) / dim) < GradientThreshold and - SmallestEigenvalue(Candidate, Hessian) > 0) - { - Minimum NewMinimumFound; - ReduceVEV(Candidate); - ConvertToNonFlatDirections(Candidate); - NewMinimumFound.point = Candidate; - NewMinimumFound.temp = T; - NewMinimumFound.potential = V(NewMinimumFound.point) * (1 + T * T); - SavedMinimaFromVEVSplitting.push_back(NewMinimumFound); - } - } -} - void MinimumTracer::ReduceVEV(std::vector &vev) { // Saveguard if GroupElements is not populated