Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
diracology.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 
23 #ifndef DIRACOLOGY_H
24 #define DIRACOLOGY_H
25 
26 #include <csl.h>
27 #include "quantumField.h"
28 
29 namespace mty {
30 
31 inline std::shared_ptr<csl::TDerivativeParent> partialMinko_shared
32  = csl::tderivative_s("d", &csl::Minkowski);
33 
34 inline csl::TDerivativeParent& partialMinko = *partialMinko_shared;
35 
36 class DiracSpace: public csl::Space {
37 
38  public:
39 
40  struct alignedCycle {
41  csl::vector_expr tensors;
42  std::vector<size_t> cutsBtwCycles;
43  };
44 
45  struct Chain {
46  csl::Expr factor;
47  std::vector<csl::Index> indices;
48  std::vector<size_t> cuts;
49  std::vector<std::pair<size_t, size_t>> fiertzFlipping;
50 
51  IMPLEMENTS_STD_VECTOR(csl::Index, indices)
52  };
53 
55 
56  size_t i;
57  size_t j;
58  size_t i_cut;
59  size_t j_cut;
60  Chirality i_chir;
61  Chirality j_chir;
62 
63  bool isChiral() const {
64  return i_chir != Chirality::None
65  and j_chir != Chirality::None;
66  }
67 
68  bool areChiralitySame() const {
69  return i_chir == j_chir;
70  }
71  };
72 
73  private:
74 
75  csl::Space const* spaceTime;
76 
77  public:
78 
79  mutable
80  csl::Tensor gamma;
81 
82  mutable
83  csl::Tensor sigma;
84 
85  mutable
86  csl::Tensor gamma_chir;
87 
88  mutable
89  csl::Tensor P_L;
90 
91  mutable
92  csl::Tensor P_R;
93 
94  mutable
95  csl::Tensor C_matrix;
96 
97  public:
98 
99  DiracSpace(csl::Space const* t_spaceTime);
100 
101  ~DiracSpace();
102 
103  csl::Space const* getSpaceTime() const;
104 
105  bool hasSpecialTraceProperty(
106  const csl::vector_expr& tensors) const override;
107 
108  csl::Expr calculateTrace(csl::vector_expr tensors) const override;
109 
110  csl::Expr calculateTrace(csl::Expr const& init) const;
111 
112  csl::Index index() const;
113 
114  csl::Index st_index() const;
115 
116  friend void setDiracTensor4(const DiracSpace* self);
117 
118  void initProperties();
119 
120  alignedCycle align(csl::vector_expr tensors) const;
121 
122  alignedCycle alignOpen(csl::vector_expr tensors) const;
123 
124  void insert(csl::Index const & toInsert,
125  std::vector<csl::Index>& tensors,
126  std::vector<size_t> & cuts,
127  size_t i) const;
128 
129  void contract(std::vector<csl::Index>& tensors,
130  std::vector<size_t> & cuts,
131  size_t i) const;
132 
133  void contract(std::vector<csl::Index>& tensors,
134  std::vector<size_t> & cuts,
135  size_t i,
136  size_t j) const;
137 
138  void contractTensor(
139  std::vector<csl::Index>& tensors,
140  std::vector<size_t> & cuts,
141  size_t i,
142  size_t j) const;
143 
144  std::vector<Chain> simplifyGammaProd(
145  std::vector<csl::Index> const &indices,
146  std::vector<size_t> const &cuts,
147  csl::Expr const &factor
148  ) const;
149 
150  std::vector<Chain> simplifyGammaProd(
151  Chain const &init
152  ) const;
153 
154  Chirality getChirality(
155  size_t pos,
156  size_t cut,
157  csl::Index proj
158  ) const;
159 
160  std::vector<FiertzContraction> getFiertzContractions(
161  Chain const &init
162  ) const;
163 
164  std::vector<Chain> simplifyFiertzProd(
165  Chain const &init
166  ) const;
167 
168  void applyUniqueChiralityStructure(
169  std::vector<csl::Index>& tensors,
170  std::vector<size_t>& cuts,
171  csl::Expr& factor) const;
172 
173  std::pair<csl::Index, csl::Index>
174  getBorderOfChain(std::vector<csl::Expr>::const_iterator first,
175  std::vector<csl::Expr>::const_iterator last) const;
176 
177  std::vector<std::pair<csl::Index, csl::Index>>
178  getBorderOfChains(std::vector<csl::Expr> const& tensors,
179  std::vector<size_t> & cuts) const;
180 
181  csl::vector_expr applyChainIndices(
182  std::vector<csl::Index> const& tensors,
183  std::vector<size_t> const& cuts,
184  std::vector<std::pair<size_t, size_t>> const& flipped,
185  std::vector<std::pair<csl::Index, csl::Index>> const& indices)
186  const;
187 
188  csl::vector_expr simplifyChain(csl::vector_expr const& tensors) const;
189 
190  std::vector<csl::Index> applyInvolution(
191  csl::vector_expr& tensors,
192  csl::Expr & factor) const;
193 
194  void applyChiralityProp(
195  std::vector<csl::Index>& tensors,
196  csl::Expr & factor) const;
197 
198  void simplifySquares(
199  std::vector<csl::Index>& tensors,
200  csl::Expr & factor) const;
201 
202  csl::Expr applyRecursion(
203  std::vector<csl::Index>& tensors,
204  csl::Expr & factor) const;
205 
206  csl::Expr applyStandardRecursion(
207  std::vector<csl::Index> const& tensors,
208  bool first = true) const;
209 
210  csl::Expr applyChiralRecursion(
211  std::vector<csl::Index> const& tensors,
212  bool first = true) const;
213 
214  csl::Expr compute(csl::vector_expr const& tensors) const;
215 
216  static
217  size_t getSpinorDimension(size_t spaceTimeDim);
218 
219  size_t countGammaMult(csl::vector_expr const& tensors) const;
220 
221  size_t countGammaMult(std::vector<csl::Index> const& tensors) const;
222 
223  std::vector<csl::Index> exprToIndex(
224  std::vector<csl::Expr> const& tensors,
225  std::vector<size_t>& cuts) const;
226 
227  csl::Expr indexToExpr(csl::Index const& spaceTimeIndex,
228  csl::Index const& first,
229  csl::Index const& second) const;
230 
231  bool isDelta(csl::Expr const& tensor) const;
232 
233  bool isGammaTensor(csl::Expr const& tensor) const;
234 
235  bool isGammaMu(csl::Expr const& tensor) const;
236 
237  bool isSigma(csl::Expr const& tensor) const;
238 
239  bool isGammaChir(csl::Expr const& tensor) const;
240 
241  bool isP_L(csl::Expr const& tensor) const;
242 
243  bool isP_R(csl::Expr const& tensor) const;
244 
245  bool isProjector(csl::Expr const& tensor) const;
246 
247  bool isCMatrix(csl::Expr const &tensor) const;
248 
249  bool isSymmetric(csl::Expr const& tensor) const;
250 
251  bool isDelta(csl::Expr_info tensor) const;
252 
253  bool isGammaTensor(csl::Expr_info tensor) const;
254 
255  bool isGammaMu(csl::Expr_info tensor) const;
256 
257  bool isSigma(csl::Expr_info tensor) const;
258 
259  bool isGammaChir(csl::Expr_info tensor) const;
260 
261  bool isP_L(csl::Expr_info tensor) const;
262 
263  bool isP_R(csl::Expr_info tensor) const;
264 
265  bool isProjector(csl::Expr_info tensor) const;
266 
267  bool isCMatrix(csl::Expr_info tensor) const;
268 
269  bool isSymmetric(csl::Expr_info tensor) const;
270 
271  bool isDelta(csl::Index const& tensor) const;
272 
273  bool isGammaMu(csl::Index const& tensor) const;
274 
275  bool isGammaChir(csl::Index const& tensor) const;
276 
277  bool isP_L(csl::Index const& tensor) const;
278 
279  bool isP_R(csl::Index const& tensor) const;
280 
281  bool isProjector(csl::Index const& tensor) const;
282 
283  bool isCMatrix(csl::Index const& tensor) const;
284 
285  void flipChirality(csl::Index& tensor) const;
286  csl::Index flippedChirality(csl::Index const& tensor) const;
287 
288  csl::Index getSpaceTimeIndex(csl::Expr const& tensor) const;
289 
290  csl::Index getFirstIndex(csl::Expr const& tensor) const;
291 
292  csl::Index getSecondIndex(csl::Expr const& tensor) const;
293 };
294 
296 
297 public:
298 
299  ConjugationSimplifier(mty::DiracSpace const *t_diracSpace)
300  :diracSpace(t_diracSpace)
301  {}
302 
303  bool hasContractionProperty(
304  csl::Expr_info self,
305  csl::Expr_info other
306  ) const;
307 
308  csl::Expr contraction(
309  csl::Expr_info self,
310  csl::Expr_info other
311  ) const;
312 
313 private:
314 
315  bool commutation(
316  csl::Index &first,
317  csl::Index &second,
318  csl::Expr &tensor
319  ) const;
320 
321  bool commutationWithTensor(
322  csl::Index &first,
323  csl::Index &second,
324  csl::Expr &tensor
325  ) const;
326  bool commutationWithIntegral(
327  csl::Index &first,
328  csl::Index &second,
329  csl::Expr &tensor
330  ) const;
331  bool commutationWithProduct(
332  csl::Index &first,
333  csl::Index &second,
334  csl::Expr &prod
335  ) const;
336  bool commutationWithSum(
337  csl::Index &first,
338  csl::Index &second,
339  csl::Expr &sum
340  ) const;
341 private:
342 
343  mty::DiracSpace const *diracSpace;
344 };
345 
346 inline
347 const DiracSpace dirac4(&csl::Minkowski);
348 
349 csl::Expr slashed_s(csl::Tensor p,
350  const csl::Index& alpha,
351  const csl::Index& beta,
352  const DiracSpace* space = &dirac4);
353 
354 csl::Expr bar_s(const csl::Expr& tensor,
355  const DiracSpace* space = &dirac4);
356 
357 } // End of namespace mty
358 
359 #endif /* DIRACOLOGY_H */
csl::Expr beta
Ratio of Higgs vacuum expectation values.
Definition: MSSM.h:79
Namespace of MARTY.
Definition: 2HDM.h:31
csl::Expr alpha
Diagonalization angle for (h0 H0).
Definition: MSSM.h:75
Chirality
Chirality for fermions. Either Left or Right for WeylFermion, or None for DiracFermion.
Definition: quantumField.h:40
Definition: diracology.h:36
Definition: diracology.h:54
Definition: diracology.h:45
Definition: diracology.h:295
Contains QuantumField and QuantumFieldParent, basic objects handling quantum fields as csl expression...
Definition: diracology.h:40