Commit b78a13ee authored by Grégoire Uhlrich's avatar Grégoire Uhlrich
Browse files

Replacement fixed

parent e5b23751
......@@ -452,8 +452,6 @@ bool Transform(Expr & init,
if (Transform((*init)[i], f, depth-1))
transformed = true;
}
if (transformed)
init = Refreshed(init);
if ((transformed = (f(init) or transformed)))
init = Refreshed(init);
return transformed;
......
......@@ -336,6 +336,7 @@ protected:
void breakSMFlavorSymmetry();
void diagonalizeNeutralinos();
void diagonalizeCharginos();
void promoteMajoranas();
void diagonalizeSFermions();
void renameSFermions();
......
......@@ -255,6 +255,12 @@ public:
FieldType2 &&gaugeBoson
);
template<class FieldType, class ...Args>
void promoteToMajorana(
FieldType &&weylFermion,
Args &&...args
);
static void findAbreviation(csl::Expr &expr);
void integrateOutParticle(
mty::Particle const &particle,
......@@ -485,6 +491,11 @@ protected:
mty::Particle& gaugeBoson
);
void doPromoteToMajorana(
mty::Particle &weylFermion,
std::string const &newParticleName = ""
);
bool doDiagonalizeSymbolically(
mty::Particle const &field,
bool forceDetZero = false
......@@ -642,6 +653,27 @@ template<class FieldType1, class FieldType2>
);
}
template<class FieldType, class ...Args>
void ModelBuilder::promoteToMajorana(
FieldType &&weylFermion,
Args &&...args
)
{
constexpr bool field_valid =
std::is_convertible<
FieldType,
mty::Particle const&>::value;
if constexpr(field_valid) {
return doPromoteToMajorana(weylFermion, std::forward<Args>(args)...);
}
else
return promoteToMajorana(
getParticle(std::forward<FieldType>(weylFermion)),
std::forward<Args>(args)...
);
}
template<class FieldType>
bool ModelBuilder::diagonalizeSymbolically(
FieldType &&field,
......
{
"name" : "SM",
"author" : "Grégoire Uhlrich",
"date" : "08-05-2021",
"version": "1.3",
"flavor":
[
{"name": "SM_flavor", "nF": 3, "complex": true}
],
"quantum numbers": [ "F", "L", "B" ],
"gauge":{
"name" : "3x2x1",
"scale" : 1e3,
"group": [
{
"name":"U1Y",
"type": "U1",
"boson": { "name": "B" },
"coupling": { "name": "gY" }
},
{
"name":"SU2L",
"type":"SU",
"dim":2,
"boson": { "name": "W", "ghost": false },
"coupling": { "name": "gL" }
},
{
"name":"SU3c",
"type":"SU",
"dim":3,
"boson": { "name": "G" },
"coupling": { "name": "g_s" }
}
]
},
"field": [
{
"name": "Q",
"spin": 1,
"chirality": "L",
"irrep": { "U1Y": "1 6", "SU2L": "1", "SU3c": "1 0" },
"flavor": [ "SM_flavor" ],
"quantum numbers": { "F": 1 }
},
{
"name": "U_R",
"spin": 1,
"chirality": "R",
"irrep": { "U1Y": "2 3", "SU3c": "1 0" },
"flavor": [ "SM_flavor" ],
"quantum numbers": { "F": 1 }
},
{
"name": "D_R",
"spin": 1,
"chirality": "R",
"irrep": { "U1Y": "-1 3", "SU3c": "1 0" },
"flavor": [ "SM_flavor" ],
"quantum numbers": { "F": 1 }
},
{
"name": "L",
"spin": 1,
"chirality": "L",
"irrep": { "U1Y": "-1 2", "SU2L": "1" },
"flavor": [ "SM_flavor" ],
"quantum numbers": { "F": 1, "L": 1 }
},
{
"name": "E_R",
"spin": 1,
"chirality": "R",
"irrep": { "U1Y": "-1" },
"flavor": [ "SM_flavor" ],
"quantum numbers": { "F": 1, "L": 1 }
},
{
"name": "H",
"spin": 0,
"irrep": { "U1Y": "1 2", "SU2L": "1" },
"yukawa":
[
{
"flavor": "SM_flavor",
"coupling": "Yu",
"fields": ["Q", "U_R"]
},
{
"flavor": "SM_flavor",
"coupling": "Yd",
"fields": ["Q", "D_R"]
},
{
"flavor": "SM_flavor",
"coupling": "Ye",
"fields": ["L", "E_R"]
}
]
}
]
}
......@@ -130,7 +130,7 @@ void MSSM_Model::initGauginos()
{
s_B = mty::weylfermion_s("~B", B->getGaugeIrrep(), Chirality::Left);
s_Wi = mty::weylfermion_s("~W", Wi->getGaugeIrrep(), Chirality::Left);
s_G = mty::weylfermion_s("~G; \\tilde{G}", G->getGaugeIrrep(), Chirality::Left);
s_G = mty::weylfermion_s("sG; \\tilde{G}", G->getGaugeIrrep(), Chirality::Left);
s_B->setSelfConjugate(true);
s_Wi->setSelfConjugate(true);
s_G->setSelfConjugate(true);
......@@ -946,6 +946,8 @@ void MSSM_Model::getToLowEnergyLagrangian()
diagonalizeNeutralinos();
std::cout << "Diagonalizing Charginos ..." << std::endl;
diagonalizeCharginos();
std::cout << "Promoting Majorana fermions ..." << std::endl;
promoteMajoranas();
std::cout << "Diagonalizing SFermions ..." << std::endl;
csl::ScopedProperty p(&mty::InteractionTerm::abbreviateFactors, true);
diagonalizeSFermions();
......@@ -1385,6 +1387,16 @@ void MSSM_Model::diagonalizeCharginos()
replace(C1p, C1->getWeylFermion(Chirality::Left)(a));
replace(C2p, C2->getWeylFermion(Chirality::Left)(a));
}
void MSSM_Model::promoteMajoranas()
{
promoteToMajorana("sG");
promoteToMajorana("N_1");
promoteToMajorana("N_2");
promoteToMajorana("N_3");
promoteToMajorana("N_4");
}
void MSSM_Model::diagonalizeSFermions()
{
bool diagonalizedSymbolically;
......
......@@ -270,6 +270,8 @@ void PMSSM_Model::getToLowEnergyLagrangian()
diagonalizeNeutralinos();
std::cout << "Diagonalizing Charginos ..." << std::endl;
diagonalizeCharginos();
std::cout << "Promoting Majorana fermions ..." << std::endl;
promoteMajoranas();
std::cout << "Diagonalizing SFermions ..." << std::endl;
diagonalizeSFermions();
renameSFermions();
......
......@@ -233,9 +233,10 @@ void Lagrangian::push_back(TermType const &newTerm)
if (not totalEmpty()) {
Tensor selfPoint = getPoint();
Tensor termPoint = newTerm->getPoint();
if (not termPoint)
if (not termPoint) {
// No field in the interaction newTerm: constant
return;
}
if (selfPoint.get() != termPoint.get()) {
newTerm->setPoint(selfPoint);
}
......
......@@ -935,6 +935,45 @@ void ModelBuilder::doPromoteToGhost(
gaugeBoson->setGhostBoson(t_ghost);
}
void ModelBuilder::doPromoteToMajorana(
mty::Particle &particle,
std::string const &newParticleName
)
{
std::shared_ptr<mty::WeylFermion> weylFermion
= std::dynamic_pointer_cast<mty::WeylFermion>(particle);
HEPAssert(weylFermion,
mty::error::TypeError,
"Expecting a vector boson, " + std::string(weylFermion->getName())
+ " given.");
HEPAssert(weylFermion->isSelfConjugate(),
mty::error::PhysicsError,
"Cannot promote a non self-conjugate Weyl fermion to a Majorana "
"fermion (" + weylFermion->getName() + " given).")
mty::Particle majorana = mty::diracfermion_s(
newParticleName.empty() ? weylFermion->getName() : newParticleName,
weylFermion->getGaugeIrrep(),
weylFermion->getFlavorIrrep()
);
majorana->setSelfConjugate(true);
std::vector<csl::Index> indexSet = weylFermion->getFullSetOfIndices();
std::cout << "HERE FOR : " << particle->getName() << '\n';
printSubPart({particle->getName()});
replace(
csl::GetComplexConjugate(particle(indexSet)),
1 / csl::sqrt_s(2) * csl::GetComplexConjugate(majorana(indexSet))
);
printSubPart({particle->getName()});
replace(
particle(indexSet),
1 / csl::sqrt_s(2) * majorana(indexSet)
);
printSubPart({particle->getName()});
std::cout << "HERE FOR : " << particle->getName() << '\n';
std::cin.get();
}
void ModelBuilder::findAbreviation(csl::Expr& product)
{
csl::IndexStructure quantumStructure;
......@@ -1047,7 +1086,7 @@ void ModelBuilder::applyDiracFermionEmbedding(
std::vector<csl::Expr> interactionTerms(interaction.size());
std::vector<csl::Expr> minusInteractionTerms(interaction.size());
for (size_t i = 0; i != interaction.size(); ++i) {
interactionTerms[i] = interaction[i]->getTerm();
interactionTerms[i] = interaction[i]->getFullExpression();
minusInteractionTerms[i] = -interactionTerms[i];
}
for (size_t i = 0; i != interaction.size(); ++i) {
......@@ -1065,6 +1104,8 @@ void ModelBuilder::applyDiracFermionEmbedding(
field->setChirality(!field->getChirality());
}
});
if (term == CSL_0)
continue;
for (size_t j = i+1; j < interaction.size(); ++j) {
if (interactionTerms[j] == term) {
csl::ForEachNode(term, [&](csl::Expr& expr)
......
......@@ -1316,11 +1316,13 @@ void ModelData::addLagrangianTerm(
if (enableChecks) {
std::vector<mty::Lagrangian::TermType> terms
= mty::InteractionTerm::createAndDispatch(term);
for (const auto& t : terms)
for (const auto& t : terms) {
addLagrangianTerm(t);
}
}
else
else {
addLagrangianTerm(std::make_shared<InteractionTerm>(term));
}
if (addHermitic) {
csl::Expr hermitic = csl::GetHermitianConjugate(term, &mty::dirac4);
addLagrangianTerm(hermitic, false);
......@@ -1335,8 +1337,9 @@ void ModelData::addLagrangianTerm(
checkValidity(term);
if (*term == CSL_0)
return;
if (not L.contains(term))
if (not L.contains(term)) {
L.push_back(term);
}
std::vector<Particle> newParticles = term->getParticles();
for (auto& newPart : newParticles) {
bool found = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment