Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of the sign convention of rotation matrices #172

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/workflows/cmake-format-linter.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Generate Coverage
run: cmake --build --preset $GeneratedCMakeProfile -j${{ steps.cpu-cores.outputs.count }} -t coverage
- name: Upload coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.BSMPT_CODECOV_UPLOAD_TOKEN }}
flags: unittests # optional
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
name: documentation
path: documentation
- name: Deploy
uses: JamesIves/[email protected].4
uses: JamesIves/[email protected].9
with:
branch: gh-pages # The branch the action should deploy to.
folder: documentation # The folder the action should deploy.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
name: cpp-linter
name: Run all linters

on:
on:
pull_request:
branches: [master]

branches: [ master, develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
cpp-linter:
linter:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
token: ${{ secrets.LINTER_PAT }}

- name: Install clang-format
if: inputs.apply_clang_format
Expand All @@ -28,6 +30,12 @@ jobs:
run:
echo "branchName=$GITHUB_BASE_REF" >> $GITHUB_OUTPUT

- name: Format CMake files
id: cmake-format
uses: PuneetMatharu/[email protected]
with:
args: --config-files .cmake-format.py --in-place

- name: Define base git diff args
id: git-diff-args
run: |
Expand Down
20 changes: 1 addition & 19 deletions include/BSMPT/minimum_tracer/minimum_tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,24 +580,6 @@ Create1DimGrid(const std::vector<double> &min_start,
const std::vector<double> &min_end,
const int npoints = 100);

/**
* Returns true if two values are the same given some relative precision
*/
bool almost_the_same(const double &a,
const double &b,
const double &rel_precision = 0.01,
const double &num_zero = 1e-10);

/**
* Returns true if two vectors are the element-wise the same given some relative
* precision
*/
bool almost_the_same(const std::vector<double> &a,
const std::vector<double> &b,
const bool &allow_for_sign_flip = false,
const double &rel_precision = 0.01,
const double &num_zero = 1e-10);

/**
* @brief Phase object
*
Expand Down Expand Up @@ -950,4 +932,4 @@ struct Vacuum
void PrintPhasesDiagram(int size = 100);
};

} // namespace BSMPT
} // namespace BSMPT
5 changes: 5 additions & 0 deletions include/BSMPT/models/ClassPotentialC2HDM.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class Class_Potential_C2HDM : public Class_Potential_Origin
double CTempC1 = 0, CTempC2 = 0, CTempCS = 0;
double R_Hh_1 = 0, R_Hh_2 = 0, R_Hh_3 = 0, R_Hl_1 = 0, R_Hl_2 = 0, R_Hl_3 = 0,
R_Hsm_1 = 0, R_Hsm_2 = 0, R_Hsm_3 = 0;

int pos_G0, pos_G1, pos_G2, pos_H1, pos_H2, pos_h1, pos_h2, pos_h3;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the sufixes 1 as + and 2 as - might be a bit confusing, particular when h1exists.
Could we use

G1 = Gp
G2 = Gm
H1 = Hp
H2 = Hm

instead?

int pos_h_SM, pos_h_l, pos_h_H;

void ReadAndSet(const std::string &linestr,
std::vector<double> &par) override;
std::vector<std::string> addLegendCT() const override;
Expand All @@ -121,6 +125,7 @@ class Class_Potential_C2HDM : public Class_Potential_Origin
void set_CT_Pot_Par(const std::vector<double> &par) override;
void write() const override;

void AdjustRotationMatrix() override;
void TripleHiggsCouplings() override;
std::vector<double> calc_CT() const override;

Expand Down
4 changes: 4 additions & 0 deletions include/BSMPT/models/ClassPotentialCPintheDark.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ class Class_Potential_CPintheDark : public Class_Potential_Origin
// vev
double v1;

int pos_Gp, pos_Gm, pos_Hp, pos_Hm, pos_HSM;
int pos_G0, pos_h1, pos_h2, pos_h3;

void ReadAndSet(const std::string &linestr,
std::vector<double> &par) override;
std::vector<std::string> addLegendCT() const override;
Expand All @@ -106,6 +109,7 @@ class Class_Potential_CPintheDark : public Class_Potential_Origin
void set_CT_Pot_Par(const std::vector<double> &par) override;
void write() const override;

void AdjustRotationMatrix() override;
void TripleHiggsCouplings() override;
std::vector<double> calc_CT() const override;

Expand Down
5 changes: 5 additions & 0 deletions include/BSMPT/models/ClassPotentialCxSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ class Class_CxSM : public Class_Potential_Origin

double vh, vs, va;

int pos_Gp, pos_Gm, pos_G0;
int pos_h1, pos_h2, pos_h3;
int pos_h_SM, pos_h_l, pos_h_H;

void ReadAndSet(const std::string &linestr,
std::vector<double> &par) override;
std::vector<std::string> addLegendCT() const override;
Expand All @@ -109,6 +113,7 @@ class Class_CxSM : public Class_Potential_Origin
void set_CT_Pot_Par(const std::vector<double> &par) override;
void write() const override;

void AdjustRotationMatrix() override;
void TripleHiggsCouplings() override;
std::vector<double> calc_CT() const override;

Expand Down
5 changes: 5 additions & 0 deletions include/BSMPT/models/ClassPotentialN2HDM.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ class Class_Potential_N2HDM : public Class_Potential_Origin
double NDus = 0, NDL6 = 0, NDL7 = 0, NDL8 = 0, NDvs = 0, NDTS = 0;
double DTCharged = 0;

int pos_G0, pos_G1, pos_G2, pos_H1, pos_H2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the sufixes 1 as + and 2 as - might be a bit confusing, particular when h1exists.
Could we use

G1 = Gp
G2 = Gm
H1 = Hp
H2 = Hm

instead?

int pos_h1, pos_h2, pos_h3, pos_A;
int pos_h_SM, pos_h_l, pos_h_H;

void ReadAndSet(const std::string &linestr,
std::vector<double> &par) override;
std::vector<std::string> addLegendCT() const override;
Expand All @@ -125,6 +129,7 @@ class Class_Potential_N2HDM : public Class_Potential_Origin
void set_CT_Pot_Par(const std::vector<double> &par) override;
void write() const override;

void AdjustRotationMatrix() override;
void TripleHiggsCouplings() override;
std::vector<double> calc_CT() const override;

Expand Down
17 changes: 15 additions & 2 deletions include/BSMPT/models/ClassPotentialOrigin.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ class Class_Potential_Origin
*/
bool SetCurvatureDone = false;
/**
* @brief CalcCouplingsdone Used to check if CalculatePhysicalCouplings has
* @brief CalcCouplingsDone Used to check if CalculatePhysicalCouplings has
* already been called
*/
bool CalcCouplingsdone = false;
bool CalcCouplingsDone = false;
/**
* @brief CalculatedTripleCopulings Used to check if TripleHiggsCouplings has
* already been called
Expand Down Expand Up @@ -287,6 +287,11 @@ class Class_Potential_Origin
* tree-level Vacuum
*/
std::vector<std::vector<double>> HiggsRotationMatrix;
/**
* Storage of the model-specific Higgs rotation matrix for the Higgs mass
* matrix at the tree-level Vacuum
*/
std::vector<std::vector<double>> HiggsRotationMatrixEnsuredConvention;
/**
* @brief Couplings_Higgs_Quartic Stores the quartic Higgs couplings in the
* mass base
Expand Down Expand Up @@ -969,6 +974,14 @@ class Class_Potential_Origin
*/
Eigen::MatrixXcd LeptonMassMatrix(const std::vector<double> &v) const;

/**
* Ensures the correct rotation matrix convention
*/
virtual void AdjustRotationMatrix() = 0;
/**
* Checks whether rotation matrix is properly set after implying conventions
*/
bool CheckRotationMatrix();
/**
* Calculates the triple Higgs couplings at NLO in the mass basis.
*
Expand Down
4 changes: 4 additions & 0 deletions include/BSMPT/models/ClassPotentialR2HDM.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class Class_Potential_R2HDM : public Class_Potential_Origin
int Type = 0;
double CTempC1 = 0, CTempC2 = 0, CTempCS = 0;

int pos_G1, pos_G2, pos_H1, pos_H2, pos_G0, pos_A, pos_H, pos_h;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the sufixes 1 as + and 2 as - might be a bit confusing, particular when h1exists.
Could we use

G1 = Gp
G2 = Gm
H1 = Hp
H2 = Hm

instead?

int pos_h_SM, pos_h_H;

void ReadAndSet(const std::string &linestr,
std::vector<double> &par) override;
std::vector<std::string> addLegendCT() const override;
Expand All @@ -112,6 +115,7 @@ class Class_Potential_R2HDM : public Class_Potential_Origin
void set_CT_Pot_Par(const std::vector<double> &par) override;
void write() const override;

void AdjustRotationMatrix() override;
void TripleHiggsCouplings() override;
std::vector<double> calc_CT() const override;

Expand Down
1 change: 1 addition & 0 deletions include/BSMPT/models/ClassPotentialSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Class_SM : public Class_Potential_Origin
void set_CT_Pot_Par(const std::vector<double> &par) override;
void write() const override;

void AdjustRotationMatrix() override;
void TripleHiggsCouplings() override;
std::vector<double> calc_CT() const override;

Expand Down
1 change: 1 addition & 0 deletions include/BSMPT/models/ClassTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Class_Template : public Class_Potential_Origin
void set_CT_Pot_Par(const std::vector<double> &par) override;
void write() const override;

void AdjustRotationMatrix() override;
void TripleHiggsCouplings() override;
std::vector<double> calc_CT() const override;

Expand Down
23 changes: 23 additions & 0 deletions include/BSMPT/utility/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <random>
#include <string>
#include <vector>
#include <complex>


#ifdef Boost_FOUND
#include <boost/version.hpp>
Expand Down Expand Up @@ -284,6 +286,27 @@ double Li2(const double &x);
*/
double EllipIntSecond(const double &x);

/**
* @brief Checks if two double numbers are (almost) the same with a given
* relative precision; if both numbers are smaller than num_zero, then they
* are considered to be zero and the function always returns true; with
* additional versions of the function for std::complex<double> and
* std::vector<double> input.
*/
bool almost_the_same(const double &a,
const double &b,
const double &rel_precision = 0.01,
const double &num_zero = 1e-10);
bool almost_the_same(const std::complex<double> &a,
const std::complex<double> &b,
const double &rel_precision = 0.01,
const double &num_zero = 1e-10);
bool almost_the_same(const std::vector<double> &a,
const std::vector<double> &b,
const bool &allow_for_sign_flip = false,
const double &rel_precision = 0.01,
const double &num_zero = 1e-10);

/**
* @brief operator << overload for the model parameter
*/
Expand Down
46 changes: 0 additions & 46 deletions src/minimum_tracer/minimum_tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1425,52 +1425,6 @@ Create1DimGrid(const std::vector<double> &min_start,
return res_vec;
}

bool almost_the_same(const double &a,
const double &b,
const double &rel_precision,
const double &num_zero)
{
if (std::abs(a) < num_zero and std::abs(b) < num_zero)
{
return true;
}
return std::abs(a - b) < std::abs(a + b) / 2 * rel_precision;
}

bool almost_the_same(const std::vector<double> &a,
const std::vector<double> &b,
const bool &allow_for_sign_flip,
const double &rel_precision,
const double &num_zero)
{
if (a.size() != b.size())
{
throw std::runtime_error("Error. Vectors must have the same size.");
}
int count_true = 0;
for (std::size_t i = 0; i < a.size(); i++)
{
if (allow_for_sign_flip)
{
count_true +=
int(almost_the_same(a.at(i), b.at(i), rel_precision, num_zero));
}
else
{
count_true += int(almost_the_same(
std::abs(a.at(i)), std::abs(b.at(i)), rel_precision, num_zero));
}
}
if (std::size_t(count_true) == a.size())
{
return true;
}
else
{
return false;
}
}

Phase::Phase()
{
}
Expand Down
Loading
Loading