From b1381d39bc5d2b7d80c8b8260197b56029dab35e Mon Sep 17 00:00:00 2001 From: Lisa Biermann Date: Mon, 4 Nov 2024 14:20:55 +0100 Subject: [PATCH 1/3] add mass over temperature ratio check output --- .../transition_tracer/transition_tracer.h | 13 +++- src/transition_tracer/transition_tracer.cpp | 67 ++++++++++++++++++- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/include/BSMPT/transition_tracer/transition_tracer.h b/include/BSMPT/transition_tracer/transition_tracer.h index 8ca1690a2..43cf73ff3 100644 --- a/include/BSMPT/transition_tracer/transition_tracer.h +++ b/include/BSMPT/transition_tracer/transition_tracer.h @@ -181,7 +181,6 @@ class TransitionTracer /** * @brief Store the list of bounce solutions - * */ std::vector ListBounceSolution; @@ -189,6 +188,16 @@ class TransitionTracer * @brief output data storage */ output output_store; + + /** + * @brief CheckMassRatio + * @param input + * @param vev + * @param temp + */ + void CheckMassRatio(const user_input &input, + const std::vector &vec, + const double &temp) const; }; -} // namespace BSMPT \ No newline at end of file +} // namespace BSMPT diff --git a/src/transition_tracer/transition_tracer.cpp b/src/transition_tracer/transition_tracer.cpp index 5041100cc..6e22e8c94 100644 --- a/src/transition_tracer/transition_tracer.cpp +++ b/src/transition_tracer/transition_tracer.cpp @@ -138,6 +138,9 @@ TransitionTracer::TransitionTracer(user_input &input) new_transition_data.crit_false_vev = pair.false_phase.Get(pair.crit_temp).point; + CheckMassRatio( + input, new_transition_data.crit_false_vev, pair.crit_temp); + BounceSolution bounce(input.modelPointer, mintracer, pair, @@ -172,6 +175,10 @@ TransitionTracer::TransitionTracer(user_input &input) .Get(new_transition_data.nucl_approx_temp.value_or( EmptyValue)) .point; + + CheckMassRatio(input, + new_transition_data.nucl_approx_false_vev, + bounce.GetNucleationTempApprox()); } else { @@ -195,6 +202,9 @@ TransitionTracer::TransitionTracer(user_input &input) pair.false_phase .Get(new_transition_data.nucl_temp.value_or(EmptyValue)) .point; + CheckMassRatio(input, + new_transition_data.nucl_false_vev, + bounce.GetNucleationTemp()); } else { @@ -218,6 +228,9 @@ TransitionTracer::TransitionTracer(user_input &input) pair.false_phase .Get(new_transition_data.perc_temp.value_or(EmptyValue)) .point; + CheckMassRatio(input, + new_transition_data.perc_false_vev, + bounce.GetPercolationTemp()); } else { @@ -243,6 +256,9 @@ TransitionTracer::TransitionTracer(user_input &input) .Get( new_transition_data.compl_temp.value_or(EmptyValue)) .point; + CheckMassRatio(input, + new_transition_data.compl_false_vev, + bounce.GetCompletionTemp()); } else { @@ -489,4 +505,53 @@ TransitionTracer::~TransitionTracer() { } -} // namespace BSMPT \ No newline at end of file +void TransitionTracer::CheckMassRatio(const user_input &input, + const std::vector &vec, + const double &temp) const +{ + std::stringstream ss; + std::vector massOverTempSq, tmp; + massOverTempSq = input.modelPointer->HiggsMassesSquared( + input.modelPointer->MinimizeOrderVEV(vec), temp) / + std::pow(temp, 2); + tmp = input.modelPointer->GaugeMassesSquared( + input.modelPointer->MinimizeOrderVEV(vec), temp) / + std::pow(temp, 2); + + massOverTempSq.insert(massOverTempSq.end(), tmp.begin(), tmp.end()); + + int color = 0; + for (auto el : massOverTempSq) + { + if (el > 0.25) // m/T > 0.5 + { + color = 1; + if (el > 1) // m/T > 1.0 + { + color = 2; + break; + } + } + } + + if (color == 0) + { + ss << "\n\033[1;92mm^2(vev_false, T = " << std::to_string(temp) + << ") / T^2 = " << vec_to_string(massOverTempSq) << "\033[0m\n"; + } + else if (color == 1) + { + ss << "\n\033[1;93mm^2(vev_false, T = " << std::to_string(temp) + << ") / T^2 = " << vec_to_string(massOverTempSq) << "\033[0m\n"; + } + else + { + ss << "\n\033[1;91mm^2(vev_false, T = " << std::to_string(temp) + << ") / T^2 = " << vec_to_string(massOverTempSq) << "\033[0m\n"; + } + + Logger::Write(LoggingLevel::TransitionDetailed, ss.str()); + return; +} + +} // namespace BSMPT From 3bd4f9d46a4c8bb1a52da0af146162e834d33b88 Mon Sep 17 00:00:00 2001 From: Lisa Biermann Date: Wed, 11 Dec 2024 16:37:46 +0100 Subject: [PATCH 2/3] Rename tmp in a meaningful way --- src/transition_tracer/transition_tracer.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/transition_tracer/transition_tracer.cpp b/src/transition_tracer/transition_tracer.cpp index 6e22e8c94..f14066009 100644 --- a/src/transition_tracer/transition_tracer.cpp +++ b/src/transition_tracer/transition_tracer.cpp @@ -510,15 +510,17 @@ void TransitionTracer::CheckMassRatio(const user_input &input, const double &temp) const { std::stringstream ss; - std::vector massOverTempSq, tmp; + std::vector massOverTempSq, massOverTempSqGauge; massOverTempSq = input.modelPointer->HiggsMassesSquared( input.modelPointer->MinimizeOrderVEV(vec), temp) / std::pow(temp, 2); - tmp = input.modelPointer->GaugeMassesSquared( - input.modelPointer->MinimizeOrderVEV(vec), temp) / - std::pow(temp, 2); + massOverTempSqGauge = input.modelPointer->GaugeMassesSquared( + input.modelPointer->MinimizeOrderVEV(vec), temp) / + std::pow(temp, 2); - massOverTempSq.insert(massOverTempSq.end(), tmp.begin(), tmp.end()); + massOverTempSq.insert(massOverTempSq.end(), + massOverTempSqGauge.begin(), + massOverTempSqGauge.end()); int color = 0; for (auto el : massOverTempSq) From 3ac2b2b5e2d031588a2407e5a51c5d9ad441fa03 Mon Sep 17 00:00:00 2001 From: Lisa Biermann Date: Fri, 13 Dec 2024 10:15:17 +0100 Subject: [PATCH 3/3] Add max ratio output and unit test --- .../transition_tracer/transition_tracer.h | 7 +-- src/transition_tracer/transition_tracer.cpp | 41 ++++++++------ tests/unittests/Test-gw.cpp | 54 ++++++++++++++++++- 3 files changed, 81 insertions(+), 21 deletions(-) diff --git a/include/BSMPT/transition_tracer/transition_tracer.h b/include/BSMPT/transition_tracer/transition_tracer.h index 43cf73ff3..32e4e7be7 100644 --- a/include/BSMPT/transition_tracer/transition_tracer.h +++ b/include/BSMPT/transition_tracer/transition_tracer.h @@ -194,10 +194,11 @@ class TransitionTracer * @param input * @param vev * @param temp + * @return maximal ratio */ - void CheckMassRatio(const user_input &input, - const std::vector &vec, - const double &temp) const; + double CheckMassRatio(const user_input &input, + const std::vector &vec, + const double &temp) const; }; } // namespace BSMPT diff --git a/src/transition_tracer/transition_tracer.cpp b/src/transition_tracer/transition_tracer.cpp index f14066009..c52033580 100644 --- a/src/transition_tracer/transition_tracer.cpp +++ b/src/transition_tracer/transition_tracer.cpp @@ -138,7 +138,7 @@ TransitionTracer::TransitionTracer(user_input &input) new_transition_data.crit_false_vev = pair.false_phase.Get(pair.crit_temp).point; - CheckMassRatio( + auto max_ratio = CheckMassRatio( input, new_transition_data.crit_false_vev, pair.crit_temp); BounceSolution bounce(input.modelPointer, @@ -176,9 +176,10 @@ TransitionTracer::TransitionTracer(user_input &input) EmptyValue)) .point; - CheckMassRatio(input, - new_transition_data.nucl_approx_false_vev, - bounce.GetNucleationTempApprox()); + auto max_ratio = + CheckMassRatio(input, + new_transition_data.nucl_approx_false_vev, + bounce.GetNucleationTempApprox()); } else { @@ -202,9 +203,11 @@ TransitionTracer::TransitionTracer(user_input &input) pair.false_phase .Get(new_transition_data.nucl_temp.value_or(EmptyValue)) .point; - CheckMassRatio(input, - new_transition_data.nucl_false_vev, - bounce.GetNucleationTemp()); + + auto max_ratio = + CheckMassRatio(input, + new_transition_data.nucl_false_vev, + bounce.GetNucleationTemp()); } else { @@ -228,9 +231,11 @@ TransitionTracer::TransitionTracer(user_input &input) pair.false_phase .Get(new_transition_data.perc_temp.value_or(EmptyValue)) .point; - CheckMassRatio(input, - new_transition_data.perc_false_vev, - bounce.GetPercolationTemp()); + + auto max_ratio = + CheckMassRatio(input, + new_transition_data.perc_false_vev, + bounce.GetPercolationTemp()); } else { @@ -256,9 +261,11 @@ TransitionTracer::TransitionTracer(user_input &input) .Get( new_transition_data.compl_temp.value_or(EmptyValue)) .point; - CheckMassRatio(input, - new_transition_data.compl_false_vev, - bounce.GetCompletionTemp()); + + auto max_ratio = + CheckMassRatio(input, + new_transition_data.compl_false_vev, + bounce.GetCompletionTemp()); } else { @@ -505,9 +512,9 @@ TransitionTracer::~TransitionTracer() { } -void TransitionTracer::CheckMassRatio(const user_input &input, - const std::vector &vec, - const double &temp) const +double TransitionTracer::CheckMassRatio(const user_input &input, + const std::vector &vec, + const double &temp) const { std::stringstream ss; std::vector massOverTempSq, massOverTempSqGauge; @@ -553,7 +560,7 @@ void TransitionTracer::CheckMassRatio(const user_input &input, } Logger::Write(LoggingLevel::TransitionDetailed, ss.str()); - return; + return *std::max_element(massOverTempSq.begin(), massOverTempSq.end()); } } // namespace BSMPT diff --git a/tests/unittests/Test-gw.cpp b/tests/unittests/Test-gw.cpp index 83292683b..4866f588d 100644 --- a/tests/unittests/Test-gw.cpp +++ b/tests/unittests/Test-gw.cpp @@ -683,6 +683,58 @@ TEST_CASE("Checking phase tracking for SM with Mode 2", "[gw]") REQUIRE(vac.PhasesList.size() == 2); } +TEST_CASE("Check maximal thermal mass squared over temperature ratio") +{ + const std::vector example_point_SM{ + /* muSq = */ -7823.7540500000005, + /* lambda = */ 0.12905349405143487}; + + using namespace BSMPT; + const auto SMConstants = GetSMConstants(); + std::shared_ptr modelPointer = + ModelID::FChoose(ModelID::ModelIDs::SM, SMConstants); + modelPointer->initModel(example_point_SM); + + std::shared_ptr MinTracer( + new MinimumTracer(modelPointer, Minimizer::WhichMinimizerDefault, false)); + + user_input input; + input.modelPointer = modelPointer; + input.gw_calculation = true; + TransitionTracer trans(input); + trans.ListBounceSolution.at(0).CalculatePercolationTemp(); + + auto output = trans.output_store; + + REQUIRE(0.781639 == Approx(trans.CheckMassRatio( + input, + output.vec_trans_data.at(0).crit_false_vev, + output.vec_trans_data.at(0).crit_temp.value())) + .epsilon(1e-2)); + REQUIRE(0.781639 == + Approx(trans.CheckMassRatio( + input, + output.vec_trans_data.at(0).nucl_approx_false_vev, + output.vec_trans_data.at(0).nucl_approx_temp.value())) + .epsilon(1e-2)); + REQUIRE(0.781639 == Approx(trans.CheckMassRatio( + input, + output.vec_trans_data.at(0).nucl_false_vev, + output.vec_trans_data.at(0).nucl_temp.value())) + .epsilon(1e-2)); + REQUIRE(0.781639 == Approx(trans.CheckMassRatio( + input, + output.vec_trans_data.at(0).perc_false_vev, + output.vec_trans_data.at(0).perc_temp.value())) + .epsilon(1e-2)); + REQUIRE(0.781639 == + Approx(trans.CheckMassRatio( + input, + output.vec_trans_data.at(0).compl_false_vev, + output.vec_trans_data.at(0).compl_temp.value())) + .epsilon(1e-2)); +} + TEST_CASE("Checking phase tracking and GW for BP3", "[gw]") { const std::vector example_point_CXSM{/* v = */ 245.34120667410863, @@ -843,7 +895,7 @@ TEST_CASE("Checking phase tracking and GW for BP3 (low sample)", "[gw]") } TEST_CASE( - "Checking phase tracking and GW for BP3 (low sample) (suposed to fail)", + "Checking phase tracking and GW for BP3 (low sample) (supposed to fail)", "[gw]") { const std::vector example_point_CXSM{/* v = */ 245.34120667410863,