File: yrtrace.cdb

package info (click to toggle)
cadabra2 2.4.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,796 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (34 lines) | stat: -rw-r--r-- 922 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/local/bin/cadabra2

from cdb.utils.develop import test_algo


@test_algo($2 * Tr{A B C D}$)
def test01():
	Tr{#}::Trace.
	{A, B, C, D}::NonCommuting.
	ex := Tr{A B C D + C D A B + B C D A} - Tr{D A B C}.
	return young_reduce_trace(ex)
test01()

@test_algo($3 * tr(a^{\mu} b^{\nu} c^{\rho} a^{\mu} b^{\rho} c^{\nu}$)
def test02():
	{\mu,\nu,\rho}::Indices(vector).
	{a^{\mu},b^{\mu},c^{\mu}}::NonCommuting.
	tr{#}::Trace.
	ex := tr(a^{\mu} b^{\nu} c^{\rho} a^{\mu} b^{\rho} c^{\nu} + 
              b^{\mu} c^{\nu} a^{\rho} b^{\nu} c^{\mu} a^{\rho} + 
              c^{\mu} a^{\nu} b^{\mu} c^{\rho} a^{\nu} b^{\rho}).
	return young_reduce_trace(ex)
test02()

@test_algo($0$)
def test03():
	{\mu,\nu}::Indices(vector).
	u^{\mu}::ImplicitIndex.
	u^{\mu}::SelfNonCommuting.
	tr{#}::Trace.
	ex := tr{u^{\mu} u^{\mu} u^{\nu} u^{\nu}} - 
	      tr{u^{\mu} u^{\nu} u^{\nu} u^{\mu}}.
	return young_reduce_trace(ex)
test03()