]> www.ginac.de Git - ginac.git/blobdiff - ginac/color.h
- removed this file. it has become obsolete as of libtool-1.4. removing
[ginac.git] / ginac / color.h
index 04d7c5d9e88c106869d37c2e025c3b1fe5e7faa9..03b9d8d3ebd6164ea6664cc9d1aab2c3d488248f 100644 (file)
@@ -51,12 +51,17 @@ public:
 
        // functions overriding virtual functions from base classes
 protected:
+       bool match_same_type(const basic & other) const;
        ex simplify_ncmul(const exvector & v) const;
        ex thisexprseq(const exvector & v) const;
        ex thisexprseq(exvector * vp) const;
        unsigned return_type(void) const { return return_types::noncommutative; }
        unsigned return_type_tinfo(void) const { return TINFO_color + representation_label; }
 
+       // non-virtual functions in this class
+public:
+       unsigned char get_representation_label(void) const {return representation_label;}
+
        // member variables
 private:
        unsigned char representation_label; /**< Representation label to distinguish independent color matrices coming from separated fermion lines */
@@ -68,7 +73,7 @@ class su3one : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(su3one, tensor)
 
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
 };
@@ -78,9 +83,10 @@ class su3t : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(su3t, tensor)
 
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
+       bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
 };
 
 /** This class represents the tensor of antisymmetric su(3) structure
@@ -89,7 +95,7 @@ class su3f : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(su3f, tensor)
 
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
        ex eval_indexed(const basic & i) const;
@@ -101,7 +107,7 @@ class su3d : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(su3d, tensor)
 
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
        ex eval_indexed(const basic & i) const;
@@ -110,11 +116,19 @@ public:
 
 
 // global functions
+
+/** Return the color object handled by an ex.  Deprecated: use ex_to<color>().
+ *  This is unsafe: you need to check the type first. */
 inline const color &ex_to_color(const ex &e)
 {
        return static_cast<const color &>(*e.bp);
 }
 
+/** Specialization of is_exactly_a<color>(obj) for color objects. */
+template<> inline bool is_exactly_a<color>(const basic & obj)
+{
+       return obj.tinfo()==TINFO_color;
+}
 
 /** Create the su(3) unity element. This is an indexed object, although it
  *  has no indices.
@@ -149,6 +163,13 @@ ex color_d(const ex & a, const ex & b, const ex & c);
 /** This returns the linear combination d.a.b.c+I*f.a.b.c. */
 ex color_h(const ex & a, const ex & b, const ex & c);
 
+/** Calculate the trace of an expression containing color objects with a
+ *  specified representation label.
+ *
+ *  @param e Expression to take the trace of
+ *  @param rl Representation label */
+ex color_trace(const ex & e, unsigned char rl = 0);
+
 
 } // namespace GiNaC