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

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