Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
drawer.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 DRAWER_H_INCLUDED
24 #define DRAWER_H_INCLUDED
25 
26 #include "graph.h"
27 #include "latexLink.h"
28 
29 namespace drawer {
30  class Graph;
31 }
32 
33 namespace mty {
34 
35 class Drawer {
36 
37  public:
38 
39  Drawer() = delete;
40 
41  static drawer::LatexLinker buildDiagram(
42  std::shared_ptr<wick::Graph> const& graph,
43  bool external = true);
44 
45  static drawer::LatexLinker buildDiagram(
46  std::shared_ptr<wick::Graph> const& graph,
47  drawer::Graph const& model,
48  std::map<size_t, size_t> & mapping);
49 
50  static std::vector<drawer::LatexLinker> buildDiagrams(
51  std::vector<std::shared_ptr<wick::Graph>> const& graph);
52 
53  static void launchViewer(
54  std::vector<drawer::LatexLinker> const& links);
55 
56  static void launchViewer(
57  std::vector<std::shared_ptr<wick::Graph>> const& links);
58 
59  static std::string buildLatex(
60  std::shared_ptr<wick::Graph> const& graph);
61 
62  static void exportPDF(
63  std::string const& name,
64  std::vector<std::shared_ptr<wick::Graph>> const& graphs,
65  std::string const& path = "diagrams");
66 
67  static void exportPNG(
68  std::string const& name,
69  std::vector<std::shared_ptr<wick::Graph>> const& graphs,
70  std::string const& path = "diagrams");
71 
72  protected:
73 
74  static drawer::ParticleType getType(
75  mty::QuantumField const& field);
76 
77  static drawer::Graph convertGraph(
78  std::shared_ptr<wick::Graph> const& graph,
79  bool minimize = true,
80  bool external = true);
81 };
82 
83 }
84 
85 #endif
Definition: latexLink.h:52
Definition: drawer.h:29
Namespace of MARTY.
Definition: 2HDM.h:31
Definition: planargraph.h:169
Definition: drawer.h:35
Class deriving from csl::TensorFieldElement, may enter expressions. In contrary to QuantumFieldParent...
Definition: quantumField.h:1614
Handles graphs for applying wick theorem. In this file lies the algorithm performing Wick contraction...