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

Bidiagonalization mass convention #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 20 additions & 20 deletions src/marty/core/fermionicField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ WeylFermion::WeylFermion(std::weak_ptr<DiracFermion> t_parent,
}

WeylFermion::WeylFermion(const std::string &t_name,
Model const & t_model,
Model const &t_model,
Chirality t_chirality)
: WeylFermion(t_name, t_model.getGauge(), t_chirality)
{
Expand All @@ -54,23 +54,23 @@ WeylFermion::WeylFermion(const std::string &t_name,
}

WeylFermion::WeylFermion(const std::string &t_name,
Gauge * gauge,
Gauge *gauge,
Chirality t_chirality)
: QuantumFieldParent(t_name, 1, gauge), chirality(t_chirality)
{
initPropagator();
}

WeylFermion::WeylFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
Chirality t_chirality)
: QuantumFieldParent(t_name, 1, irrep), chirality(t_chirality)
{
initPropagator();
}

WeylFermion::WeylFermion(const std::string &t_name,
Gauge * t_gauge,
Gauge *t_gauge,
bool t_isSelfConjugate,
Chirality t_chirality)
: QuantumFieldParent(t_name, 1, t_gauge, t_isSelfConjugate),
Expand All @@ -80,7 +80,7 @@ WeylFermion::WeylFermion(const std::string &t_name,
}

WeylFermion::WeylFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
bool t_isSelfConjugate,
Chirality t_chirality)
: QuantumFieldParent(t_name, 1, irrep, t_isSelfConjugate),
Expand All @@ -90,7 +90,7 @@ WeylFermion::WeylFermion(const std::string &t_name,
}

WeylFermion::WeylFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
const FlavorIrrep &flavorRep,
Chirality t_chirality)
: QuantumFieldParent(t_name, 1, irrep, flavorRep), chirality(t_chirality)
Expand Down Expand Up @@ -206,17 +206,17 @@ void WeylFermion::initPropagator()
propagator[this] = &IntegratedFermionPropagator;
}

void WeylFermion::breakParticle(mty::Group * brokenGroup,
void WeylFermion::breakParticle(mty::Group *brokenGroup,
std::vector<std::string> const &newNames)
{
if (getDiracParent())
return;
QuantumFieldParent::breakParticle(brokenGroup, newNames);
}
void WeylFermion::breakParticle(
mty::FlavorGroup * brokenFlavor,
mty::FlavorGroup *brokenFlavor,
std::vector<mty::FlavorGroup *> const &subGroups,
std::vector<std::string> const & names)
std::vector<std::string> const &names)
{
if (getDiracParent())
return;
Expand All @@ -229,13 +229,13 @@ void WeylFermion::breakParticle(
/*************************************************/
///////////////////////////////////////////////////

auto findWeylSignature(std::string const &name)
std::size_t findWeylSignature(std::string const &name)
{
constexpr static auto signatures = {"_L", "_R", "L", "R", "_l", "_r"};
auto iter = signatures.begin();
while (iter != signatures.end()) {
auto pos = name.rfind(*iter);
if (pos != std::string::npos)
if (pos != std::string::npos && pos != 0)
return pos;
++iter;
}
Expand All @@ -245,7 +245,7 @@ auto findWeylSignature(std::string const &name)
std::string DiracNameOf(std::string const &leftWeylName)
{
auto pos = findWeylSignature(leftWeylName);
if (pos == std::string::npos) {
if (pos == std::string::npos || pos == 0) {
return leftWeylName + "_D";
}
auto diracName{leftWeylName};
Expand Down Expand Up @@ -309,7 +309,7 @@ DiracFermion::DiracFermion(const std::string &t_name, const GaugeIrrep &irrep)
}

DiracFermion::DiracFermion(const std::string &t_name,
Gauge * t_gauge,
Gauge *t_gauge,
bool t_isSelfConjugate)
: QuantumFieldParent(t_name, 1, t_gauge, t_isSelfConjugate)
{
Expand All @@ -325,7 +325,7 @@ DiracFermion::DiracFermion(const std::string &t_name,
}

DiracFermion::DiracFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
bool t_isSelfConjugate)
: QuantumFieldParent(t_name, 1, irrep, t_isSelfConjugate)
{
Expand All @@ -341,7 +341,7 @@ DiracFermion::DiracFermion(const std::string &t_name,
}

DiracFermion::DiracFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
const FlavorIrrep &flavorRep)
: QuantumFieldParent(t_name, 1, irrep, flavorRep)
{
Expand All @@ -356,7 +356,7 @@ DiracFermion::DiracFermion(const std::string &t_name,
initPropagator();
}

DiracFermion::DiracFermion(const std::string & t_name,
DiracFermion::DiracFermion(const std::string &t_name,
const DiracFermion *other)
: DiracFermion(*other)
{
Expand Down Expand Up @@ -463,7 +463,7 @@ Particle DiracFermion::getWeylFermion(Chirality chirality) const
return res;
}

void DiracFermion::breakParticle(mty::Group * brokenGroup,
void DiracFermion::breakParticle(mty::Group *brokenGroup,
std::vector<std::string> const &newNames)
{
QuantumFieldParent::breakParticle(brokenGroup, newNames);
Expand All @@ -473,9 +473,9 @@ void DiracFermion::breakParticle(mty::Group * brokenGroup,
}

void DiracFermion::breakParticle(
mty::FlavorGroup * brokenFlavor,
mty::FlavorGroup *brokenFlavor,
std::vector<mty::FlavorGroup *> const &subGroups,
std::vector<std::string> const & names)
std::vector<std::string> const &names)
{
QuantumFieldParent::breakParticle(brokenFlavor, subGroups, names);
const auto vSpace = brokenFlavor->getVectorSpace();
Expand All @@ -484,7 +484,7 @@ void DiracFermion::breakParticle(

void DiracFermion::updateChiralBrokenParts(csl::Space const *space)
{
const auto & brokenParts = getBrokenParts(space);
const auto &brokenParts = getBrokenParts(space);
const size_t sz = brokenParts.size();
std::vector<mty::Particle> leftBroken(sz);
std::vector<mty::Particle> rightBroken(sz);
Expand Down
36 changes: 19 additions & 17 deletions src/marty/core/fermionicField.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,29 @@ class WeylFermion : public QuantumFieldParent {
Chirality chirality = Chirality::Left);

WeylFermion(const std::string &t_name,
Model const & t_model,
Model const &t_model,
Chirality chirality = Chirality::Left);

WeylFermion(const std::string &t_name,
Gauge * t_gauge,
Gauge *t_gauge,
Chirality chirality = Chirality::Left);

WeylFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
Chirality chirality = Chirality::Left);

WeylFermion(const std::string &t_name,
Gauge * t_gauge,
Gauge *t_gauge,
bool t_isSelfConjugate,
Chirality chirality = Chirality::Left);

WeylFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
bool t_isSelfConjugate,
Chirality chirality = Chirality::Left);

WeylFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
const FlavorIrrep &flavorRep,
Chirality chirality = Chirality::Left);

Expand Down Expand Up @@ -127,11 +127,11 @@ class WeylFermion : public QuantumFieldParent {

void setDiracParent(Particle const &parent) override;

void breakParticle(mty::Group * brokenGroup,
void breakParticle(mty::Group *brokenGroup,
std::vector<std::string> const &newNames) override;
void breakParticle(mty::FlavorGroup * brokenFlavor,
void breakParticle(mty::FlavorGroup *brokenFlavor,
std::vector<mty::FlavorGroup *> const &subGroups,
std::vector<std::string> const & names) override;
std::vector<std::string> const &names) override;

protected:
void initPropagator() override;
Expand Down Expand Up @@ -185,15 +185,15 @@ class DiracFermion : public QuantumFieldParent {
DiracFermion(const std::string &t_name, const GaugeIrrep &irrep);

DiracFermion(const std::string &t_name,
Gauge * t_gauge,
Gauge *t_gauge,
bool t_isSelfConjugate);

DiracFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
bool t_isSelfConjugate);

DiracFermion(const std::string &t_name,
const GaugeIrrep & irrep,
const GaugeIrrep &irrep,
const FlavorIrrep &flavorRep);

DiracFermion(const std::string &t_name, const DiracFermion *other);
Expand Down Expand Up @@ -234,11 +234,11 @@ class DiracFermion : public QuantumFieldParent {

Particle getWeylFermion(Chirality chirality) const override;

void breakParticle(mty::Group * brokenGroup,
void breakParticle(mty::Group *brokenGroup,
std::vector<std::string> const &newNames) override;
void breakParticle(mty::FlavorGroup * brokenFlavor,
void breakParticle(mty::FlavorGroup *brokenFlavor,
std::vector<mty::FlavorGroup *> const &subGroups,
std::vector<std::string> const & names) override;
std::vector<std::string> const &names) override;

private:
void initPropagator() override;
Expand All @@ -258,7 +258,7 @@ class DiracFermion : public QuantumFieldParent {
* @return The newly created Weyl fermion.
*/
template <class... Args>
inline Particle weylfermion_s(Args &&... args)
inline Particle weylfermion_s(Args &&...args)
{
auto weyl = csl::make_shared<WeylFermion>(std::forward<Args>(args)...);
return weyl;
Expand All @@ -276,13 +276,15 @@ inline Particle weylfermion_s(Args &&... args)
* @return The newly created Dirac fermion.
*/
template <class... Args>
inline Particle diracfermion_s(Args &&... args)
inline Particle diracfermion_s(Args &&...args)
{
auto part = csl::make_shared<DiracFermion>(std::forward<Args>(args)...);
part->initWeylFermions();
return part;
}

std::size_t findWeylSignature(const std::string &particleName);

} // namespace mty

#endif
Loading
Loading