GiNaC 1.8.8
color.cpp
Go to the documentation of this file.
1
5/*
6 * GiNaC Copyright (C) 1999-2025 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#include "color.h"
24#include "idx.h"
25#include "ncmul.h"
26#include "symmetry.h"
27#include "operators.h"
28#include "numeric.h"
29#include "mul.h"
30#include "power.h" // for sqrt()
31#include "symbol.h"
32#include "archive.h"
33#include "utils.h"
34
35#include <stdexcept>
36
37namespace GiNaC {
38
40
42 print_func<print_dflt>(&su3one::do_print).
43 print_func<print_latex>(&su3one::do_print_latex))
44
46 print_func<print_dflt>(&su3t::do_print).
47 print_func<print_latex>(&su3t::do_print))
48
50 print_func<print_dflt>(&su3f::do_print).
51 print_func<print_latex>(&su3f::do_print))
52
54 print_func<print_dflt>(&su3d::do_print).
55 print_func<print_latex>(&su3d::do_print))
56
58// default constructors
60
61color::color() : representation_label(0)
62{
63}
64
65DEFAULT_CTOR(su3one)
66DEFAULT_CTOR(su3t)
67DEFAULT_CTOR(su3f)
68DEFAULT_CTOR(su3d)
69
70
71// other constructors
73
77color::color(const ex & b, unsigned char rl) : inherited(b), representation_label(rl)
78{
79}
80
84color::color(const ex & b, const ex & i1, unsigned char rl) : inherited(b, i1), representation_label(rl)
85{
86}
87
88color::color(unsigned char rl, const exvector & v) : inherited(not_symmetric(), v), representation_label(rl)
89{
90}
91
92color::color(unsigned char rl, exvector && v) : inherited(not_symmetric(), std::move(v)), representation_label(rl)
93{
94}
95
97{
98 return make_return_type_t<color>(representation_label);
99}
100
102// archiving
104
105void color::read_archive(const archive_node& n, lst& sym_lst)
106{
107 inherited::read_archive(n, sym_lst);
108 unsigned rl;
109 n.find_unsigned("label", rl);
111}
112
114{
115 inherited::archive(n);
116 n.add_unsigned("label", representation_label);
117}
118
124
126// functions overriding virtual functions from base classes
128
129int color::compare_same_type(const basic & other) const
130{
131 GINAC_ASSERT(is_a<color>(other));
132 const color &o = static_cast<const color &>(other);
133
135 // different representation label
136 return representation_label < o.representation_label ? -1 : 1;
137 }
138
139 return inherited::compare_same_type(other);
140}
141
142bool color::match_same_type(const basic & other) const
143{
144 GINAC_ASSERT(is_a<color>(other));
145 const color &o = static_cast<const color &>(other);
146
148}
149
154
155DEFAULT_PRINT_LATEX(su3one, "ONE", "\\mathbb{1}")
159
162ex color::eval_ncmul(const exvector & v) const
163{
164 exvector s;
165 s.reserve(v.size());
166
167 // Remove superfluous ONEs
168 for (auto & it : v) {
169 if (!is_a<su3one>(it.op(0)))
170 s.push_back(it);
171 }
172
173 if (s.empty())
174 return color(su3one(), representation_label);
175 else
176 return hold_ncmul(s);
177}
178
180{
181 return color(representation_label, v);
182}
183
185{
186 return color(representation_label, std::move(v));
187}
188
197static ex permute_free_index_to_front(const exvector & iv3, const exvector & iv2, int & sig)
198{
199 GINAC_ASSERT(iv3.size() == 3);
200 GINAC_ASSERT(iv2.size() == 2);
201
202 sig = 1;
203
204#define TEST_PERMUTATION(A,B,C,P) \
205 if (iv3[B].is_equal(iv2[0]) && iv3[C].is_equal(iv2[1])) { \
206 sig = P; \
207 return iv3[A]; \
208 }
209
210 TEST_PERMUTATION(0,1,2, 1);
211 TEST_PERMUTATION(0,2,1, -1);
212 TEST_PERMUTATION(1,0,2, -1);
213 TEST_PERMUTATION(1,2,0, 1);
214 TEST_PERMUTATION(2,0,1, 1);
215 TEST_PERMUTATION(2,1,0, -1);
216
217 throw(std::logic_error("permute_free_index_to_front(): no valid permutation found"));
218}
219
222{
223 GINAC_ASSERT(is_a<indexed>(i));
224 GINAC_ASSERT(i.nops() == 4);
225 GINAC_ASSERT(is_a<su3d>(i.op(0)));
226
227 // Convolutions are zero
228 if (!(static_cast<const indexed &>(i).get_dummy_indices().empty()))
229 return _ex0;
230
231 // Numeric evaluation
232 if (static_cast<const indexed &>(i).all_index_values_are(info_flags::nonnegint)) {
233
234 // Sort indices
235 int v[3];
236 for (unsigned j=0; j<3; j++)
237 v[j] = ex_to<numeric>(ex_to<idx>(i.op(j + 1)).get_value()).to_int();
238 if (v[0] > v[1]) std::swap(v[0], v[1]);
239 if (v[0] > v[2]) std::swap(v[0], v[2]);
240 if (v[1] > v[2]) std::swap(v[1], v[2]);
241
242#define CMPINDICES(A,B,C) ((v[0] == (A)) && (v[1] == (B)) && (v[2] == (C)))
243
244 // Check for non-zero elements
245 if (CMPINDICES(1,4,6) || CMPINDICES(1,5,7) || CMPINDICES(2,5,6)
246 || CMPINDICES(3,4,4) || CMPINDICES(3,5,5))
247 return _ex1_2;
248 else if (CMPINDICES(2,4,7) || CMPINDICES(3,6,6) || CMPINDICES(3,7,7))
249 return _ex_1_2;
250 else if (CMPINDICES(1,1,8) || CMPINDICES(2,2,8) || CMPINDICES(3,3,8))
251 return sqrt(_ex3)*_ex1_3;
252 else if (CMPINDICES(8,8,8))
253 return sqrt(_ex3)*_ex_1_3;
254 else if (CMPINDICES(4,4,8) || CMPINDICES(5,5,8)
255 || CMPINDICES(6,6,8) || CMPINDICES(7,7,8))
256 return sqrt(_ex3)/_ex_6;
257 else
258 return _ex0;
259 }
260
261 // No further simplifications
262 return i.hold();
263}
264
267{
268 GINAC_ASSERT(is_a<indexed>(i));
269 GINAC_ASSERT(i.nops() == 4);
270 GINAC_ASSERT(is_a<su3f>(i.op(0)));
271
272 // Numeric evaluation
273 if (static_cast<const indexed &>(i).all_index_values_are(info_flags::nonnegint)) {
274
275 // Sort indices, remember permutation sign
276 int v[3];
277 for (unsigned j=0; j<3; j++)
278 v[j] = ex_to<numeric>(ex_to<idx>(i.op(j + 1)).get_value()).to_int();
279 int sign = 1;
280 if (v[0] > v[1]) { std::swap(v[0], v[1]); sign = -sign; }
281 if (v[0] > v[2]) { std::swap(v[0], v[2]); sign = -sign; }
282 if (v[1] > v[2]) { std::swap(v[1], v[2]); sign = -sign; }
283
284 // Check for non-zero elements
285 if (CMPINDICES(1,2,3))
286 return sign;
287 else if (CMPINDICES(1,4,7) || CMPINDICES(2,4,6)
288 || CMPINDICES(2,5,7) || CMPINDICES(3,4,5))
289 return _ex1_2 * sign;
290 else if (CMPINDICES(1,5,6) || CMPINDICES(3,6,7))
291 return _ex_1_2 * sign;
292 else if (CMPINDICES(4,5,8) || CMPINDICES(6,7,8))
293 return sqrt(_ex3)/2 * sign;
294 else
295 return _ex0;
296 }
297
298 // No further simplifications
299 return i.hold();
300}
301
302
304bool su3t::contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const
305{
306 GINAC_ASSERT(is_a<indexed>(*self));
307 GINAC_ASSERT(is_a<indexed>(*other));
308 GINAC_ASSERT(self->nops() == 2);
309 GINAC_ASSERT(is_a<su3t>(self->op(0)));
310 unsigned char rl = ex_to<color>(*self).get_representation_label();
311
312 if (is_exactly_a<su3t>(other->op(0))) {
313
314 // Contraction only makes sense if the representation labels are equal
315 GINAC_ASSERT(is_a<color>(*other));
316 if (ex_to<color>(*other).get_representation_label() != rl)
317 return false;
318
319 // T.a T.a = 4/3 ONE
320 if (other - self == 1) {
321 *self = numeric(4, 3);
322 *other = color_ONE(rl);
323 return true;
324
325 // T.a T.b T.a = -1/6 T.b
326 } else if (other - self == 2
327 && is_a<color>(self[1])) {
328 *self = numeric(-1, 6);
329 *other = _ex1;
330 return true;
331
332 // T.a S T.a = 1/2 Tr(S) - 1/6 S
333 } else {
334 auto it = self + 1;
335 while (it != other) {
336 if (!is_a<color>(*it)) {
337 return false;
338 }
339 it++;
340 }
341
342 it = self + 1;
343 ex S = _ex1;
344 while (it != other) {
345 S *= *it;
346 *it++ = _ex1;
347 }
348
349 *self = color_trace(S, rl) * color_ONE(rl) / 2 - S / 6;
350 *other = _ex1;
351 return true;
352 }
353 }
354
355 return false;
356}
357
359bool su3d::contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const
360{
361 GINAC_ASSERT(is_a<indexed>(*self));
362 GINAC_ASSERT(is_a<indexed>(*other));
363 GINAC_ASSERT(self->nops() == 4);
364 GINAC_ASSERT(is_a<su3d>(self->op(0)));
365
366 if (is_exactly_a<su3d>(other->op(0))) {
367
368 // Find the dummy indices of the contraction
369 exvector self_indices = ex_to<indexed>(*self).get_indices();
370 exvector other_indices = ex_to<indexed>(*other).get_indices();
371 exvector all_indices = self_indices;
372 all_indices.insert(all_indices.end(), other_indices.begin(), other_indices.end());
373 exvector free_indices, dummy_indices;
374 find_free_and_dummy(all_indices, free_indices, dummy_indices);
375
376 // d.abc d.abc = 40/3
377 if (dummy_indices.size() == 3) {
378 *self = numeric(40, 3);
379 *other = _ex1;
380 return true;
381
382 // d.akl d.bkl = 5/3 delta.ab
383 } else if (dummy_indices.size() == 2) {
384 exvector a;
385 std::back_insert_iterator<exvector> ita(a);
386 ita = set_difference(self_indices.begin(), self_indices.end(), dummy_indices.begin(), dummy_indices.end(), ita, ex_is_less());
387 ita = set_difference(other_indices.begin(), other_indices.end(), dummy_indices.begin(), dummy_indices.end(), ita, ex_is_less());
388 GINAC_ASSERT(a.size() == 2);
389 *self = numeric(5, 3) * delta_tensor(a[0], a[1]);
390 *other = _ex1;
391 return true;
392 }
393
394 } else if (is_exactly_a<su3t>(other->op(0))) {
395
396 // d.abc T.b T.c = 5/6 T.a
397 if (other+1 != v.end()
398 && is_exactly_a<su3t>(other[1].op(0))
399 && ex_to<indexed>(*self).has_dummy_index_for(other[1].op(1))) {
400
401 exvector self_indices = ex_to<indexed>(*self).get_indices();
402 exvector dummy_indices = {other[0].op(1), other[1].op(1)};
403 int sig;
404 ex a = permute_free_index_to_front(self_indices, dummy_indices, sig);
405 *self = numeric(5, 6);
406 other[0] = color_T(a, ex_to<color>(other[0]).get_representation_label());
407 other[1] = _ex1;
408 return true;
409 }
410 }
411
412 return false;
413}
414
416bool su3f::contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const
417{
418 GINAC_ASSERT(is_a<indexed>(*self));
419 GINAC_ASSERT(is_a<indexed>(*other));
420 GINAC_ASSERT(self->nops() == 4);
421 GINAC_ASSERT(is_a<su3f>(self->op(0)));
422
423 if (is_exactly_a<su3f>(other->op(0))) { // f*d is handled by su3d class
424
425 // Find the dummy indices of the contraction
426 exvector dummy_indices;
427 dummy_indices = ex_to<indexed>(*self).get_dummy_indices(ex_to<indexed>(*other));
428
429 // f.abc f.abc = 24
430 if (dummy_indices.size() == 3) {
431 *self = 24;
432 *other = _ex1;
433 return true;
434
435 // f.akl f.bkl = 3 delta.ab
436 } else if (dummy_indices.size() == 2) {
437 int sign1, sign2;
438 ex a = permute_free_index_to_front(ex_to<indexed>(*self).get_indices(), dummy_indices, sign1);
439 ex b = permute_free_index_to_front(ex_to<indexed>(*other).get_indices(), dummy_indices, sign2);
440 *self = sign1 * sign2 * 3 * delta_tensor(a, b);
441 *other = _ex1;
442 return true;
443 }
444
445 } else if (is_exactly_a<su3t>(other->op(0))) {
446
447 // f.abc T.b T.c = 3/2 I T.a
448 if (other+1 != v.end()
449 && is_exactly_a<su3t>(other[1].op(0))
450 && ex_to<indexed>(*self).has_dummy_index_for(other[1].op(1))) {
451
452 exvector self_indices = ex_to<indexed>(*self).get_indices();
453 exvector dummy_indices = {other[0].op(1), other[1].op(1)};
454 int sig;
455 ex a = permute_free_index_to_front(self_indices, dummy_indices, sig);
456 *self = numeric(3, 2) * sig * I;
457 other[0] = color_T(a, ex_to<color>(other[0]).get_representation_label());
458 other[1] = _ex1;
459 return true;
460 }
461 }
462
463 return false;
464}
465
467// global functions
469
470ex color_ONE(unsigned char rl)
471{
472 static ex ONE = dynallocate<su3one>();
473 return color(ONE, rl);
474}
475
476ex color_T(const ex & a, unsigned char rl)
477{
478 static ex t = dynallocate<su3t>();
479
480 if (!is_a<idx>(a))
481 throw(std::invalid_argument("indices of color_T must be of type idx"));
482 if (!ex_to<idx>(a).get_dim().is_equal(8))
483 throw(std::invalid_argument("index dimension for color_T must be 8"));
484
485 return color(t, a, rl);
486}
487
488ex color_f(const ex & a, const ex & b, const ex & c)
489{
490 static ex f = dynallocate<su3f>();
491
492 if (!is_a<idx>(a) || !is_a<idx>(b) || !is_a<idx>(c))
493 throw(std::invalid_argument("indices of color_f must be of type idx"));
494 if (!ex_to<idx>(a).get_dim().is_equal(8) || !ex_to<idx>(b).get_dim().is_equal(8) || !ex_to<idx>(c).get_dim().is_equal(8))
495 throw(std::invalid_argument("index dimension for color_f must be 8"));
496
497 return indexed(f, antisymmetric3(), a, b, c);
498}
499
500ex color_d(const ex & a, const ex & b, const ex & c)
501{
502 static ex d = dynallocate<su3d>();
503
504 if (!is_a<idx>(a) || !is_a<idx>(b) || !is_a<idx>(c))
505 throw(std::invalid_argument("indices of color_d must be of type idx"));
506 if (!ex_to<idx>(a).get_dim().is_equal(8) || !ex_to<idx>(b).get_dim().is_equal(8) || !ex_to<idx>(c).get_dim().is_equal(8))
507 throw(std::invalid_argument("index dimension for color_d must be 8"));
508
509 return indexed(d, symmetric3(), a, b, c);
510}
511
512ex color_h(const ex & a, const ex & b, const ex & c)
513{
514 return color_d(a, b, c) + I * color_f(a, b, c);
515}
516
519static bool is_color_tinfo(const return_type_t& ti)
520{
521 return *(ti.tinfo) == typeid(color);
522}
523
526static unsigned char get_representation_label(const return_type_t& ti)
527{
528 return (unsigned char)ti.rl;
529}
530
531ex color_trace(const ex & e, const std::set<unsigned char> & rls)
532{
533 if (is_a<color>(e)) {
534
535 unsigned char rl = ex_to<color>(e).get_representation_label();
536
537 // Are we taking the trace over this object's representation label?
538 if (rls.find(rl) == rls.end())
539 return e;
540
541 // Yes, all generators are traceless, except for color_ONE
542 if (is_a<su3one>(e.op(0)))
543 return _ex3;
544 else
545 return _ex0;
546
547 } else if (is_exactly_a<mul>(e)) {
548
549 // Trace of product: pull out non-color factors
550 ex prod = _ex1;
551 for (size_t i=0; i<e.nops(); i++) {
552 const ex &o = e.op(i);
554 prod *= color_trace(o, rls);
555 else
556 prod *= o;
557 }
558 return prod;
559
560 } else if (is_exactly_a<ncmul>(e)) {
561
562 unsigned char rl = get_representation_label(e.return_type_tinfo());
563
564 // Are we taking the trace over this string's representation label?
565 if (rls.find(rl) == rls.end())
566 return e;
567
568 // Yes, expand product if necessary
569 ex e_expanded = e.expand();
570 if (!is_a<ncmul>(e_expanded))
571 return color_trace(e_expanded, rls);
572
573 size_t num = e.nops();
574
575 if (num == 2) {
576
577 // Tr T_a T_b = 1/2 delta_a_b
578 return delta_tensor(e.op(0).op(1), e.op(1).op(1)) / 2;
579
580 } else if (num == 3) {
581
582 // Tr T_a T_b T_c = 1/4 h_a_b_c
583 return color_h(e.op(0).op(1), e.op(1).op(1), e.op(2).op(1)) / 4;
584
585 } else {
586
587 // Traces of 4 or more generators are computed recursively:
588 // Tr T_a1 .. T_an =
589 // 1/6 delta_a(n-1)_an Tr T_a1 .. T_a(n-2)
590 // + 1/2 h_a(n-1)_an_k Tr T_a1 .. T_a(n-2) T_k
591 const ex &last_index = e.op(num - 1).op(1);
592 const ex &next_to_last_index = e.op(num - 2).op(1);
593 idx summation_index(dynallocate<symbol>(), 8);
594
595 exvector v1;
596 v1.reserve(num - 2);
597 for (size_t i=0; i<num-2; i++)
598 v1.push_back(e.op(i));
599
600 exvector v2 = v1;
601 v2.push_back(color_T(summation_index, rl));
602
603 return delta_tensor(next_to_last_index, last_index) * color_trace(ncmul(v1), rl) / 6
604 + color_h(next_to_last_index, last_index, summation_index) * color_trace(ncmul(v2), rl) / 2;
605 }
606
607 } else if (e.nops() > 0) {
608
609 // Trace maps to all other container classes (this includes sums)
611 return e.map(fcn);
612
613 } else
614 return _ex0;
615}
616
617ex color_trace(const ex & e, const lst & rll)
618{
619 // Convert list to set
620 std::set<unsigned char> rls;
621 for (auto & it : rll) {
622 if (it.info(info_flags::nonnegint))
623 rls.insert(ex_to<numeric>(it).to_int());
624 }
625
626 return color_trace(e, rls);
627}
628
629ex color_trace(const ex & e, unsigned char rl)
630{
631 // Convert label to set
632 std::set<unsigned char> rls;
633 rls.insert(rl);
634
635 return color_trace(e, rls);
636}
637
638} // namespace GiNaC
Archiving of GiNaC expressions.
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
Definition assertion.h:33
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
virtual size_t nops() const
Number of operands/members.
Definition basic.cpp:229
virtual ex op(size_t i) const
Return operand/member at position i.
Definition basic.cpp:238
const basic & hold() const
Stop further evaluation.
Definition basic.cpp:887
virtual int compare_same_type(const basic &other) const
Returns order relation between two objects of same type.
Definition basic.cpp:719
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:96
unsigned char representation_label
Representation label to distinguish independent color matrices coming from separated fermion lines.
Definition color.h:69
void read_archive(const archive_node &n, lst &sym_lst) override
Load (deserialize) the object from an archive node.
Definition color.cpp:105
void archive(archive_node &n) const override
Save (serialize) the object into archive node.
Definition color.cpp:113
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:142
color(const ex &b, unsigned char rl=0)
Construct object without any color index.
Definition color.cpp:77
ex thiscontainer(const exvector &v) const override
Definition color.cpp:179
Wrapper template for making GiNaC classes out of STL containers.
Definition container.h:73
Lightweight wrapper for GiNaC's symbolic objects.
Definition ex.h:73
ex map(map_function &f) const
Definition ex.h:163
ex expand(unsigned options=0) const
Expand an expression.
Definition ex.cpp:74
return_type_t return_type_tinfo() const
Definition ex.h:232
size_t nops() const
Definition ex.h:136
ex op(size_t i) const
Definition ex.h:137
This class holds one index of an indexed object.
Definition idx.h:36
This class holds an indexed expression.
Definition indexed.h:40
Non-commutative product of expressions.
Definition ncmul.h:33
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
Definition numeric.h:82
Context for default (ginsh-parsable) output.
Definition print.h:114
Context for latex-parsable output.
Definition print.h:122
This class represents the tensor of symmetric su(3) structure constants.
Definition color.h:124
ex eval_indexed(const basic &i) const override
Automatic symbolic evaluation of indexed symmetric structure constant.
Definition color.cpp:221
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:359
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:266
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:416
This class represents the su(3) unity element.
Definition color.h:76
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:304
This class holds one of GiNaC's predefined special tensors such as the delta and the metric tensors.
Definition tensor.h:35
#define TEST_PERMUTATION(A, B, C, P)
#define CMPINDICES(A, B, C)
Interface to GiNaC's color (SU(3) Lie algebra) objects.
size_t n
Definition factor.cpp:1432
size_t c
Definition factor.cpp:757
Interface to GiNaC's indices.
Interface to GiNaC's products of expressions.
Definition add.cpp:36
const numeric I
Imaginary unit.
Definition numeric.cpp:1433
ex hold_ncmul(const exvector &v)
Definition ncmul.cpp:613
const ex _ex_1_2
Definition utils.cpp:356
const symmetry & symmetric3()
Definition symmetry.cpp:361
const symmetry & not_symmetric()
Definition symmetry.cpp:349
const ex _ex1_2
Definition utils.cpp:381
ex color_ONE(unsigned char rl)
Create the su(3) unity element.
Definition color.cpp:470
const symmetry & antisymmetric3()
Definition symmetry.cpp:379
const ex _ex1
Definition utils.cpp:385
static ex permute_free_index_to_front(const exvector &iv3, const exvector &iv2, int &sig)
Given a vector iv3 of three indices and a vector iv2 of two indices that is a subset of iv3,...
Definition color.cpp:197
const numeric sqrt(const numeric &x)
Numeric square root.
Definition numeric.cpp:2480
const ex _ex3
Definition utils.cpp:393
ex color_T(const ex &a, unsigned char rl)
Create an su(3) generator.
Definition color.cpp:476
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:531
ex color_f(const ex &a, const ex &b, const ex &c)
Create an su(3) antisymmetric structure constant.
Definition color.cpp:488
const ex _ex_6
Definition utils.cpp:332
static bool is_color_tinfo(const return_type_t &ti)
Check whether a given tinfo key (as returned by return_type_tinfo() is that of a color object (with a...
Definition color.cpp:519
ex delta_tensor(const ex &i1, const ex &i2)
Create a delta tensor with specified indices.
Definition tensor.cpp:576
static unsigned char get_representation_label(const return_type_t &ti)
Extract representation label from tinfo key (as returned by return_type_tinfo()).
Definition clifford.cpp:825
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:512
ex color_d(const ex &a, const ex &b, const ex &c)
Create an su(3) symmetric structure constant.
Definition color.cpp:500
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT_T(lst, basic, print_func< print_context >(&lst::do_print). print_func< print_tree >(&lst::do_print_tree)) template<> bool lst GINAC_BIND_UNARCHIVER(lst)
Specialization of container::info() for lst.
Definition lst.cpp:42
const ex _ex_1_3
Definition utils.cpp:360
const ex _ex0
Definition utils.cpp:369
void find_free_and_dummy(exvector::const_iterator it, exvector::const_iterator itend, exvector &out_free, exvector &out_dummy)
Given a vector of indices, split them into two vectors, one containing the free indices,...
Definition idx.cpp:520
std::vector< ex > exvector
Definition basic.h:48
const ex _ex1_3
Definition utils.cpp:377
Definition ex.h:988
void swap(GiNaC::ex &a, GiNaC::ex &b)
Specialization of std::swap() for ex objects.
Definition ex.h:992
Interface to GiNaC's non-commutative products of expressions.
Makes the interface to the underlying bignum package available.
Interface to GiNaC's overloaded operators.
Interface to GiNaC's symbolic exponentiation (basis^exponent).
#define GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(classname, supername, options)
Macro for inclusion in the implementation of each registered class.
Definition registrar.h:184
#define GINAC_IMPLEMENT_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the implementation of each registered class.
Definition registrar.h:179
To distinguish between different kinds of non-commutative objects.
Definition registrar.h:43
std::type_info const * tinfo
to distinguish between non-commutative objects of different type.
Definition registrar.h:45
unsigned rl
to distinguish between non-commutative objects of the same type.
Definition registrar.h:48
Interface to GiNaC's symbolic objects.
Interface to GiNaC's symmetry definitions.
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...
#define DEFAULT_PRINT_LATEX(classname, text, latex)
Definition utils.h:622
#define DEFAULT_PRINT(classname, text)
Definition utils.h:616
#define DEFAULT_CTOR(classname)
Definition utils.h:606
#define DEFAULT_COMPARE(classname)
Definition utils.h:609

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