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

Contents of /ginac/clifford.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.23 - (hide annotations)
Thu Mar 29 16:56:32 2001 UTC (12 years, 1 month ago) by cbauer
Branch: MAIN
Changes since 1.22: +18 -0 lines
File MIME type: text/plain
- added Clifford algebra unity element
- superfluous unity elements are removed from Clifford and color strings
- added Clifford contractions:
    gamma~mu*gamma.mu
    gamma~mu*gamma~alpha*gamma.mu
- added color contractions:
    d.aac
    d.abc*d.abc
    d.akl*d.bkl
    d.abc*f.abc
    d.akl*f.bkl
    f.abc*f.abc
    f.akl*f.bkl
- delta tensor and color structure constants can be evaluated numerically
- color_T(), color_d() and color_f() check their arguments
- added a couple of utility functions to idx.*
- simplify_indexed() doesn't crash any more when used on expressions containing
  noncommutative products

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.22 * indices. Spinor indices are hidden. */
35     class clifford : public indexed
36 cbauer 1.1 {
37 cbauer 1.22 GINAC_DECLARE_REGISTERED_CLASS(clifford, indexed)
38 cbauer 1.15
39 cbauer 1.12 // other constructors
40 cbauer 1.1 public:
41 cbauer 1.23 clifford(const ex & b);
42 cbauer 1.22 clifford(const ex & b, const ex & mu);
43    
44     // internal constructors
45     clifford(const exvector & v, bool discardable = false);
46     clifford(exvector * vp); // vp will be deleted
47 cbauer 1.1
48 cbauer 1.12 // functions overriding virtual functions from base classes
49 cbauer 1.1 protected:
50 cbauer 1.12 ex simplify_ncmul(const exvector & v) const;
51 cbauer 1.15 ex thisexprseq(const exvector & v) const;
52     ex thisexprseq(exvector * vp) const;
53 cbauer 1.22 unsigned return_type(void) const { return return_types::noncommutative; }
54     unsigned return_type_tinfo(void) const { return TINFO_clifford; }
55     };
56    
57 cbauer 1.1
58 cbauer 1.23 /** This class represents the Clifford algebra unity element. */
59     class diracone : public tensor
60     {
61     GINAC_DECLARE_REGISTERED_CLASS(diracone, tensor)
62    
63     // functions overriding virtual functions from bases classes
64     public:
65     void print(std::ostream & os, unsigned upper_precedence=0) const;
66     };
67    
68    
69 cbauer 1.22 /** This class represents the Dirac gamma Lorentz vector. */
70     class diracgamma : public tensor
71     {
72     GINAC_DECLARE_REGISTERED_CLASS(diracgamma, tensor)
73 cbauer 1.1
74 cbauer 1.22 // functions overriding virtual functions from bases classes
75     public:
76     void print(std::ostream & os, unsigned upper_precedence=0) const;
77 cbauer 1.23 bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
78 cbauer 1.1 };
79    
80 cbauer 1.22
81 cbauer 1.15 // global functions
82 cbauer 1.5 inline const clifford &ex_to_clifford(const ex &e)
83     {
84     return static_cast<const clifford &>(*e.bp);
85     }
86 cbauer 1.15
87 cbauer 1.23
88     /** Create a Clifford unity object.
89     *
90     * @return newly constructed object */
91     ex dirac_one(void);
92 cbauer 1.22
93     /** Create a Dirac gamma object.
94     *
95     * @param mu Index (must be of class varidx or a derived class)
96     * @return newly constructed gamma object */
97     ex dirac_gamma(const ex & mu);
98    
99 cbauer 1.1
100 cbauer 1.5 } // namespace GiNaC
101 cbauer 1.1
102 cbauer 1.2 #endif // ndef __GINAC_CLIFFORD_H__

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