Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
polarization.h
Go to the documentation of this file.
1 // This file is part of MARTY.
2 //
3 // MARTY is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // MARTY is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with MARTY. If not, see <https://www.gnu.org/licenses/>.
15 
22 #ifndef POLARIZATION_H_INCLUDED
23 #define POLARIZATION_H_INCLUDED
24 
25 #include <csl.h>
26 #include "quantumField.h"
27 
28 namespace mty {
29 
38 
39  public:
40 
41  void test(int);
42 
44 
45  PolarizationField(csl::Tensor const& impulsion,
46  csl::Parent const& t_parent);
47 
48  PolarizationField(csl::Tensor const& impulsion,
49  csl::Parent const& t_parent,
50  const std::vector<csl::Index>& indices);
51 
52  PolarizationField(csl::Tensor const& impulsion,
53  csl::Parent const& t_parent,
54  const csl::IndexStructure& indices);
55 
56  PolarizationField(PolarizationField const&) = default;
57 
58  bool getCommutable() const override;
59 
60  std::optional<csl::Expr> getComplexConjugate() const override;
61 
62  bool hasContractionProperty(csl::Expr_info other) const override;
63 
64  csl::Expr contraction(csl::Expr_info other) const override;
65 
66  csl::unique_Expr copy_unique() const override;
67 
68  void printCode(
69  int mode = 0,
70  std::ostream &out = std::cout
71  ) const override;
72 
73  void printProp(std::ostream& out = std::cout) const override;
74 
83  inline
85  return std::static_pointer_cast<QuantumFieldParent>(parent);
86  }
87 
88  bool isConjugationLocked() const {
89  return lockConjugation;
90  }
91 
92  void setConjugationLock(bool t_lock) {
93  lockConjugation = t_lock;
94  }
95 
96  void setParticle(bool) override;
97  void setIncoming(bool) override;
98 
99  friend
100  std::ostream& operator<<(std::ostream& fout, const PolarizationField& pol);
101 
102  private:
103 
104  PolarizationField complexConjugatedField(
105  bool keepFermionOrder = false
106  ) const;
107 
108  bool hasFieldChargeConjugation(
109  mty::PolarizationField const *other
110  ) const;
111 
112  bool spaceIndexContraction(csl::Expr_info other) const;
113  bool spinIndexContraction(csl::Expr_info other) const;
114 
115  bool isContractibleWith(csl::Expr_info otherPolar) const;
116 
117  csl::Expr sumPolarization(csl::Expr_info other) const;
118 
119  csl::Expr matrixChargeConjugation(csl::Expr_info other) const override;
120  csl::Expr fieldChargeConjugation(mty::PolarizationField const *other) const;
121 
122  void updateComplexConjugation();
123 
124  private:
125 
126  bool lockConjugation;
127 };
128 
129 } // End of namespace mty
130 
131 #endif
void setParticle(bool) override
Sets the particle property of the particle.
Definition: polarization.cpp:341
std::shared_ptr< AbstractParent > parent
void setIncoming(bool) override
Sets the incoming property of the particle.
Definition: polarization.cpp:347
This class inherits from std::shared_ptr<QuantumFieldParent> and should be used instead of direct Qua...
Definition: quantumField.h:1409
Namespace of MARTY.
Definition: 2HDM.h:31
Particle getParticle() const
Returns a mty::Particle, pointer to the parent of the field.
Definition: polarization.h:84
Class deriving from csl::TensorFieldElement, may enter expressions. In contrary to QuantumFieldParent...
Definition: quantumField.h:1614
Base class for parents of QuantumField objects.
Definition: quantumField.h:152
Representing polarization vectors in equations. Allows to compute polarization sums in cross-sections...
Definition: polarization.h:37
Contains QuantumField and QuantumFieldParent, basic objects handling quantum fields as csl expression...