/[GiNaC]/ginac/clifford.h
ViewVC logotype

Contents of /ginac/clifford.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.26 - (hide annotations)
Tue Apr 24 13:22:09 2001 UTC (12 years, 1 month ago) by cbauer
Branch: MAIN
CVS Tags: release_0-8-2
Changes since 1.25: +10 -0 lines
File MIME type: text/plain
- added get_representation_label()
- clifford contractions honor repr. label
- first implementation of dirac_trace(), works with 0..3 clifford objects

1 cbauer 1.1 /** @file clifford.h
2     *
3 cbauer 1.22 * Interface to GiNaC's clifford algebra (Dirac gamma) objects. */
4 cbauer 1.4
5     /*
6 kreckel 1.14 * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
7 cbauer 1.2 *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21     */
22 cbauer 1.1
23 cbauer 1.2 #ifndef __GINAC_CLIFFORD_H__
24     #define __GINAC_CLIFFORD_H__
25 cbauer 1.1
26 cbauer 1.22 #include "indexed.h"
27     #include "tensor.h"
28 cbauer 1.5
29     namespace GiNaC {
30 cbauer 1.1
31 cbauer 1.15
32     /** This class holds an object representing an element of the Clifford
33     * algebra (the Dirac gamma matrices). These objects only carry Lorentz
34 cbauer 1.25 * indices. Spinor indices are hidden. A representation label (an unsigned
35     * 8-bit integer) is used to distinguish elements from different Clifford
36     * algebras (objects with different labels commute). */
37 cbauer 1.22 class clifford : public indexed
38 cbauer 1.1 {
39 cbauer 1.22 GINAC_DECLARE_REGISTERED_CLASS(clifford, indexed)
40 cbauer 1.15
41 cbauer 1.12 // other constructors
42 cbauer 1.1 public:
43 cbauer 1.25 clifford(const ex & b, unsigned char rl = 0);
44     clifford(const ex & b, const ex & mu, unsigned char rl = 0);
45 cbauer 1.22
46     // internal constructors
47 cbauer 1.25 clifford(unsigned char rl, const exvector & v, bool discardable = false);
48     clifford(unsigned char rl, exvector * vp); // vp will be deleted
49 cbauer 1.1
50 cbauer 1.12 // functions overriding virtual functions from base classes
51 cbauer 1.1 protected:
52 cbauer 1.12 ex simplify_ncmul(const exvector & v) const;
53 cbauer 1.15 ex thisexprseq(const exvector & v) const;
54     ex thisexprseq(exvector * vp) const;
55 cbauer 1.22 unsigned return_type(void) const { return return_types::noncommutative; }
56 cbauer 1.25 unsigned return_type_tinfo(void) const { return TINFO_clifford + representation_label; }
57    
58 cbauer 1.26 // non-virtual functions in this class
59     public:
60     unsigned char get_representation_label(void) const {return representation_label;}
61    
62 cbauer 1.25 // member variables
63     private:
64     unsigned char representation_label; /**< Representation label to distinguish independent spin lines */
65 cbauer 1.22 };
66    
67 cbauer 1.1
68 cbauer 1.23 /** This class represents the Clifford algebra unity element. */
69     class diracone : public tensor
70     {
71     GINAC_DECLARE_REGISTERED_CLASS(diracone, tensor)
72    
73     // functions overriding virtual functions from bases classes
74     public:
75 cbauer 1.24 void print(const print_context & c, unsigned level = 0) const;
76 cbauer 1.23 };
77    
78    
79 cbauer 1.22 /** This class represents the Dirac gamma Lorentz vector. */
80     class diracgamma : public tensor
81     {
82     GINAC_DECLARE_REGISTERED_CLASS(diracgamma, tensor)
83 cbauer 1.1
84 cbauer 1.22 // functions overriding virtual functions from bases classes
85     public:
86 cbauer 1.24 void print(const print_context & c, unsigned level = 0) const;
87 cbauer 1.23 bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
88 cbauer 1.1 };
89    
90 cbauer 1.22
91 cbauer 1.25 /** This class represents the Dirac gamma5 object. */
92     class diracgamma5 : public tensor
93     {
94     GINAC_DECLARE_REGISTERED_CLASS(diracgamma5, tensor)
95    
96     // functions overriding virtual functions from bases classes
97     public:
98     void print(const print_context & c, unsigned level = 0) const;
99     };
100    
101    
102 cbauer 1.15 // global functions
103 cbauer 1.5 inline const clifford &ex_to_clifford(const ex &e)
104     {
105     return static_cast<const clifford &>(*e.bp);
106     }
107 cbauer 1.15
108 cbauer 1.23
109     /** Create a Clifford unity object.
110     *
111 cbauer 1.25 * @param rl Representation label
112 cbauer 1.23 * @return newly constructed object */
113 cbauer 1.25 ex dirac_ONE(unsigned char rl = 0);
114 cbauer 1.22
115     /** Create a Dirac gamma object.
116     *
117     * @param mu Index (must be of class varidx or a derived class)
118 cbauer 1.25 * @param rl Representation label
119 cbauer 1.22 * @return newly constructed gamma object */
120 cbauer 1.25 ex dirac_gamma(const ex & mu, unsigned char rl = 0);
121    
122     /** Create a Dirac gamma5 object.
123     *
124     * @param rl Representation label
125     * @return newly constructed object */
126     ex dirac_gamma5(unsigned char rl = 0);
127 cbauer 1.26
128     /** Calculate the trace of an expression containing gamma objects with
129     * a specified representation label.
130     *
131     * @param rl Representation label */
132     ex dirac_trace(const ex & e, unsigned char rl = 0);
133 cbauer 1.22
134 cbauer 1.1
135 cbauer 1.5 } // namespace GiNaC
136 cbauer 1.1
137 cbauer 1.2 #endif // ndef __GINAC_CLIFFORD_H__

Christian Bauer">Christian Bauer
ViewVC Help
Powered by ViewVC 1.1.15