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

Contents of /ginac/clifford.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.22 - (hide annotations)
Tue Mar 27 21:21:43 2001 UTC (12 years, 2 months ago) by cbauer
Branch: MAIN
Changes since 1.21: +30 -28 lines
File MIME type: text/plain
restored deleted files

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.22 clifford(const ex & b, const ex & mu);
42    
43     // internal constructors
44     clifford(const exvector & v, bool discardable = false);
45     clifford(exvector * vp); // vp will be deleted
46 cbauer 1.1
47 cbauer 1.12 // functions overriding virtual functions from base classes
48 cbauer 1.1 protected:
49 cbauer 1.12 ex simplify_ncmul(const exvector & v) const;
50 cbauer 1.15 ex thisexprseq(const exvector & v) const;
51     ex thisexprseq(exvector * vp) const;
52 cbauer 1.22 unsigned return_type(void) const { return return_types::noncommutative; }
53     unsigned return_type_tinfo(void) const { return TINFO_clifford; }
54     };
55    
56 cbauer 1.1
57 cbauer 1.22 /** This class represents the Dirac gamma Lorentz vector. */
58     class diracgamma : public tensor
59     {
60     GINAC_DECLARE_REGISTERED_CLASS(diracgamma, tensor)
61 cbauer 1.1
62 cbauer 1.22 // functions overriding virtual functions from bases classes
63     public:
64     void print(std::ostream & os, unsigned upper_precedence=0) const;
65 cbauer 1.1 };
66    
67 cbauer 1.22
68 cbauer 1.15 // global functions
69 cbauer 1.5 inline const clifford &ex_to_clifford(const ex &e)
70     {
71     return static_cast<const clifford &>(*e.bp);
72     }
73 cbauer 1.15
74 cbauer 1.22
75     /** Create a Dirac gamma object.
76     *
77     * @param mu Index (must be of class varidx or a derived class)
78     * @return newly constructed gamma object */
79     ex dirac_gamma(const ex & mu);
80    
81 cbauer 1.1
82 cbauer 1.5 } // namespace GiNaC
83 cbauer 1.1
84 cbauer 1.2 #endif // ndef __GINAC_CLIFFORD_H__

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