GiNaC 1.8.7
color.h
Go to the documentation of this file.
1
5/*
6 * GiNaC Copyright (C) 1999-2023 Johannes Gutenberg University Mainz, Germany
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#ifndef GINAC_COLOR_H
24#define GINAC_COLOR_H
25
26#include "indexed.h"
27#include "tensor.h"
28
29#include <set>
30
31namespace GiNaC {
32
40class color : public indexed
41{
43 // other constructors
44public:
45 color(const ex & b, unsigned char rl = 0);
46 color(const ex & b, const ex & i1, unsigned char rl = 0);
47
48 // internal constructors
49 color(unsigned char rl, const exvector & v);
50 color(unsigned char rl, exvector && v);
51 void archive(archive_node& n) const override;
52 void read_archive(const archive_node& n, lst& sym_lst) override;
53
54 // functions overriding virtual functions from base classes
55protected:
56 ex eval_ncmul(const exvector & v) const override;
57 bool match_same_type(const basic & other) const override;
58 ex thiscontainer(const exvector & v) const override;
59 ex thiscontainer(exvector && v) const override;
60 unsigned return_type() const override { return return_types::noncommutative; }
61 return_type_t return_type_tinfo() const override;
62
63 // non-virtual functions in this class
64public:
65 unsigned char get_representation_label() const {return representation_label;}
66
67 // member variables
68private:
69 unsigned char representation_label;
70};
72
73
75class su3one : public tensor
76{
78
79 // non-virtual functions in this class
80protected:
81 void do_print(const print_context & c, unsigned level) const;
82 void do_print_latex(const print_latex & c, unsigned level) const;
83};
85
87class su3t : public tensor
88{
90
91 // functions overriding virtual functions from base classes
92public:
93 bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
94
95 // non-virtual functions in this class
96protected:
97 void do_print(const print_context & c, unsigned level) const;
98 void do_print_latex(const print_latex & c, unsigned level) const;
99};
101
104class su3f : public tensor
105{
107
108 // functions overriding virtual functions from base classes
109public:
110 ex eval_indexed(const basic & i) const override;
111 bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
112protected:
113 unsigned return_type() const override { return return_types::commutative; }
114
115 // non-virtual functions in this class
116protected:
117 void do_print(const print_context & c, unsigned level) const;
118 void do_print_latex(const print_latex & c, unsigned level) const;
119};
121
123class su3d : public tensor
124{
126
127 // functions overriding virtual functions from base classes
128public:
129 ex eval_indexed(const basic & i) const override;
130 bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override;
131protected:
132 unsigned return_type() const override { return return_types::commutative; }
133
134 // non-virtual functions in this class
135protected:
136 void do_print(const print_context & c, unsigned level) const;
137 void do_print_latex(const print_latex & c, unsigned level) const;
138};
140
141
142// global functions
143
149ex color_ONE(unsigned char rl = 0);
150
156ex color_T(const ex & a, unsigned char rl = 0);
157
164ex color_f(const ex & a, const ex & b, const ex & c);
165
172ex color_d(const ex & a, const ex & b, const ex & c);
173
175ex color_h(const ex & a, const ex & b, const ex & c);
176
181ex color_trace(const ex & e, const std::set<unsigned char> & rls);
182
187ex color_trace(const ex & e, const lst & rll);
188
194ex color_trace(const ex & e, unsigned char rl = 0);
195
196} // namespace GiNaC
197
198#endif // ndef GINAC_COLOR_H
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
Definition: archive.h:49
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
Definition: basic.h:105
This class holds a generator T_a or the unity element of the Lie algebra of SU(3),...
Definition: color.h:41
return_type_t return_type_tinfo() const override
Definition: color.cpp:97
ex eval_ncmul(const exvector &v) const override
Perform automatic simplification on noncommutative product of color objects.
Definition: color.cpp:163
unsigned char representation_label
Representation label to distinguish independent color matrices coming from separated fermion lines.
Definition: color.h:69
unsigned return_type() const override
Definition: color.h:60
unsigned char get_representation_label() const
Definition: color.h:65
void read_archive(const archive_node &n, lst &sym_lst) override
Load (deserialize) the object from an archive node.
Definition: color.cpp:106
void archive(archive_node &n) const override
Save (serialize) the object into archive node.
Definition: color.cpp:114
bool match_same_type(const basic &other) const override
Returns true if the attributes of two objects are similar enough for a match.
Definition: color.cpp:143
color(const ex &b, unsigned char rl=0)
Construct object without any color index.
Definition: color.cpp:78
ex thiscontainer(const exvector &v) const override
Definition: color.cpp:180
Wrapper template for making GiNaC classes out of STL containers.
Definition: container.h:73
Lightweight wrapper for GiNaC's symbolic objects.
Definition: ex.h:72
This class holds an indexed expression.
Definition: indexed.h:40
Base class for print_contexts.
Definition: print.h:103
Context for latex-parsable output.
Definition: print.h:123
This class represents the tensor of symmetric su(3) structure constants.
Definition: color.h:124
unsigned return_type() const override
Definition: color.h:132
void do_print_latex(const print_latex &c, unsigned level) const
void do_print(const print_context &c, unsigned level) const
ex eval_indexed(const basic &i) const override
Automatic symbolic evaluation of indexed symmetric structure constant.
Definition: color.cpp:222
bool contract_with(exvector::iterator self, exvector::iterator other, exvector &v) const override
Contraction of an indexed symmetric structure constant with something else.
Definition: color.cpp:360
This class represents the tensor of antisymmetric su(3) structure constants.
Definition: color.h:105
ex eval_indexed(const basic &i) const override
Automatic symbolic evaluation of indexed antisymmetric structure constant.
Definition: color.cpp:267
unsigned return_type() const override
Definition: color.h:113
bool contract_with(exvector::iterator self, exvector::iterator other, exvector &v) const override
Contraction of an indexed antisymmetric structure constant with something else.
Definition: color.cpp:417
void do_print(const print_context &c, unsigned level) const
void do_print_latex(const print_latex &c, unsigned level) const
This class represents the su(3) unity element.
Definition: color.h:76
void do_print(const print_context &c, unsigned level) const
void do_print_latex(const print_latex &c, unsigned level) const
This class represents an su(3) generator.
Definition: color.h:88
bool contract_with(exvector::iterator self, exvector::iterator other, exvector &v) const override
Contraction of generator with something else.
Definition: color.cpp:305
void do_print(const print_context &c, unsigned level) const
void do_print_latex(const print_latex &c, unsigned level) const
This class holds one of GiNaC's predefined special tensors such as the delta and the metric tensors.
Definition: tensor.h:35
size_t n
Definition: factor.cpp:1432
size_t c
Definition: factor.cpp:757
Interface to GiNaC's indexed expressions.
Definition: add.cpp:38
ex color_ONE(unsigned char rl)
Create the su(3) unity element.
Definition: color.cpp:471
GINAC_DECLARE_UNARCHIVER(add)
ex color_T(const ex &a, unsigned char rl)
Create an su(3) generator.
Definition: color.cpp:477
ex color_trace(const ex &e, const std::set< unsigned char > &rls)
Calculate color traces over the specified set of representation labels.
Definition: color.cpp:532
ex color_f(const ex &a, const ex &b, const ex &c)
Create an su(3) antisymmetric structure constant.
Definition: color.cpp:489
ex color_h(const ex &a, const ex &b, const ex &c)
This returns the linear combination d.a.b.c+I*f.a.b.c.
Definition: color.cpp:513
ex color_d(const ex &a, const ex &b, const ex &c)
Create an su(3) symmetric structure constant.
Definition: color.cpp:501
std::vector< ex > exvector
Definition: basic.h:48
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
Definition: registrar.h:153
To distinguish between different kinds of non-commutative objects.
Definition: registrar.h:44
Interface to GiNaC's special tensors.

This page is part of the GiNaC developer's reference. It was generated automatically by doxygen. For an introduction, see the tutorial.