123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441 |
- REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
- % test of DUMMY package version 1.0 running in REDUCE 3.5
- % DATE: 15 February 1994
- % Authors: A. Dresse <adresse@ulb.ac.be>
- % H. Caprasse <caprasse@vm1.ulg.ac.be>
- %
- % Case of commuting operator:
- %
- operator co1,co2;
- % declare dummy indices
- % first syntax : base <name>
- %
- dummy_base dv;
- dv
- % dummy indices are dv1, dv2, dv3, ...
- exp := co2(dv2)*co2(dv2)$
- c_exp := canonical(exp);
- 2
- c_exp := co2(dv1)
- exp := dv2*co2(dv2)*co2(dv2)$
- c_exp := canonical(exp);
- 2
- c_exp := co2(dv1) *dv1
- exp := c_exp * co1(dv3);
- 2
- exp := co1(dv3)*co2(dv1) *dv1
- c_exp := canonical(exp);
- 2
- c_exp := co1(dv2)*co2(dv1) *dv1
- % aliases for dummy indices
- %
- dummy_names i,j,k;
- t
- canonical(c_exp);
- 2
- co1(j)*co2(i) *i
- % remove dummy_names
- clear_dummy_names;
- t
- % Case of anticommuting operators
- %
- operator ao1, ao2;
- anticom ao1, ao2;
- % product of anticommuting operators with FREE indices
- a_exp := ao1(s1)*ao1(s2) - ao1(s2)*ao1(s1);
- a_exp := ao1(s1)*ao1(s2) - ao1(s2)*ao1(s1)
- a_exp := canonical(a_exp);
- a_exp := 2*ao1(s1)*ao1(s2)
- % the indices are summed upon, i.e. are DUMMY indices
- a_exp := ao1(dv1)*ao1(dv2)$
- canonical(a_exp);
- 0
- a_exp := ao1(dv1)*ao1(dv2) - ao1(dv2)*ao1(dv1);
- a_exp := ao1(dv1)*ao1(dv2) - ao1(dv2)*ao1(dv1)
- a_exp := canonical(a_exp);
- a_exp := 0
- a_exp := ao1(dv2,dv3)*ao2(dv1,dv2)$
- a_exp := canonical(a_exp);
- a_exp := ao1(dv2,dv1)*ao2(dv1,dv3)
- a_exp := ao1(dv1)*ao1(dv3)*ao2(dv3)*ao2(dv1)$
- a_exp := canonical(a_exp);
- a_exp := - ao1(dv1)*ao1(dv2)*ao2(dv1)*ao2(dv2)
- % Case of non commuting operators
- %
- operator no1, no2, no3;
- noncom no1, no2, no3;
- n_exp := no3(dv2)*no2(dv3)*no1(dv1) + no3(dv3)*no2(dv1)*no1(dv2)
- + no3(dv1)*no2(dv2)*no1(dv3);
- n_exp := no3(dv1)*no2(dv2)*no1(dv3) + no3(dv2)*no2(dv3)*no1(dv1)
- + no3(dv3)*no2(dv1)*no1(dv2)
- n_exp:=canonical n_exp;
- n_exp := 3*no3(dv3)*no2(dv2)*no1(dv1)
- % Case of mixed commutation properties
- % ***
- % The example below displays a restriction of the package i.e
- % The non commuting operators are ASSUMED to COMMUTE with the
- % anticommuting operators.
- % ***
- exp := co1(dv1)*ao1(dv2,dv1,dv4)*no1(dv1,dv5)*co2(dv3)*ao1(dv1,dv3);
- exp := co1(dv1)*co2(dv3)*(ao1(dv2,dv1,dv4)*no1(dv1,dv5)*ao1(dv1,dv3))
- canonical(exp);
- - co1(dv1)*co2(dv2)*ao1(dv2,dv1)*ao1(dv4,dv1,dv3)*no1(dv5,dv1)
- exp := c_exp * a_exp * no3(dv2)*no2(dv3)*no1(dv1);
- 2
- exp := - co1(dv2)*co2(dv1) *dv1*ao1(dv1)*ao1(dv2)*ao2(dv1)*ao2(dv2)*no3(dv2)
- *no2(dv3)*no1(dv1)
- can_exp := canonical(exp);
- 2
- can_exp := - co1(dv2)*co2(dv1) *dv1*ao1(dv1)*ao1(dv2)*ao2(dv1)*ao2(dv2)
- *no3(dv2)*no2(dv3)*no1(dv1)
- % Case of internal symmetries of operators
- %
- operator as1, as2;
- antisymmetric as1, as2;
- clear_dummy_base ;
- t
- dummy_base s;
- s
- % First a non trivial expression:
- asc_exp:=as1(s1,s2)*as1(s1,s3)*as1(s3,s4)*co1(s3)*co1(s4)+
- 2*as1(s1,s2)*as1(s1,s3)*as1(s3,s4)*co1(s2)*co1(s4)$
- canonical asc_exp;
- - as1(s1,s2)*as1(s1,s3)*as1(s3,s4)*co1(s3)*co1(s4)
- % Second simple illustrative examples:
- clear_dummy_base;
- t
- dummy_base dv;
- dv
- exp1 := ao1(dv1)*ao1(dv2)$
- canonical(exp1);
- 0
- exp2 := as1(dv1,dv2)$
- canonical(exp2);
- 0
- canonical(exp1*exp2);
- - as1(dv1,dv2)*ao1(dv1)*ao1(dv2)
- canonical(as1(dv1,dv2)*as2(dv2,dv1));
- - as1(dv1,dv2)*as2(dv1,dv2)
- operator ss1, ss2;
- symmetric ss1, ss2;
- exp := ss1(dv1,dv2)*ss2(dv1,dv2) - ss1(dv2,dv3)*ss2(dv2,dv3);
- exp := ss1(dv1,dv2)*ss2(dv1,dv2) - ss1(dv2,dv3)*ss2(dv2,dv3)
- canonical(exp);
- 0
- exp := as1(dv1,dv2)*as1(dv3,dv4)*as1(dv1,dv4);
- exp := as1(dv1,dv2)*as1(dv1,dv4)*as1(dv3,dv4)
- canonical(exp);
- 0
- % Indeed the result is equal to half the sum given below:
- %
- exp + sub(dv2 = dv3, dv3 = dv2, dv1 = dv4, dv4 = dv1, exp);
- 0
- exp1 := as2(dv3,dv2)*as1(dv3,dv4)*as1(dv1,dv2)*as1(dv1,dv4);
- exp1 := - as1(dv1,dv2)*as1(dv1,dv4)*as1(dv3,dv4)*as2(dv2,dv3)
- canonical(exp1);
- as1(dv1,dv2)*as1(dv1,dv3)*as1(dv3,dv4)*as2(dv2,dv4)
- exp2 := as2(dv1,dv4)*as1(dv1,dv3)*as1(dv2,dv4)*as1(dv2,dv3);
- exp2 := as1(dv1,dv3)*as1(dv2,dv3)*as1(dv2,dv4)*as2(dv1,dv4)
- canonical(exp2);
- as1(dv1,dv2)*as1(dv1,dv3)*as1(dv3,dv4)*as2(dv2,dv4)
- canonical(exp1-exp2);
- 0
- % Indeed:
- %
- exp2 - sub(dv1 = dv3, dv2 = dv1, dv3 = dv4, dv4 = dv2, exp1);
- 0
- % Declare the internal symmetry properties of the Riemann tensor
- %
- operator r;
- symtree (r, {!+, {!-, 1, 2}, {!-, 3, 4}});
- canonical( r(x,y,z,t) );
- - r(t,z,x,y)
- canonical( r(x,y,t,z) );
- r(t,z,x,y)
- canonical( r(t,z,y,x) );
- - r(t,z,x,y)
- exp := r(dv1, dv2, dv3, dv4) * r(dv2, dv1, dv4, dv3)$
- canonical(exp);
- 2
- r(dv4,dv3,dv2,dv1)
- exp := r(dv1, dv2, dv3, dv4) * r(dv1, dv3, dv2, dv4)$
- canonical(exp);
- r(dv4,dv2,dv3,dv1)*r(dv4,dv3,dv2,dv1)
- dummy_names i,j,k,l;
- t
- canonical(exp);
- r(l,j,k,i)*r(l,k,j,i)
- exp := r(i,j,k,l)*ao1(i,j)*ao1(k,l);
- exp := r(i,j,k,l)*ao1(i,j)*ao1(k,l)
- canonical(exp);
- 0
- exp := r(k,i,l,j)*as1(k,i)*as1(k,j);
- exp := as1(i,k)*as1(j,k)*r(k,i,l,j)
- canonical(exp);
- - as1(i,j)*as1(i,k)*r(l,j,k,i)
- clear_dummy_names;
- t
- clear_dummy_base;
- t
- exp := co1(dv3)$
- c_exp := canonical(exp);
- c_exp := co1(dv3)
- end;
- (TIME: dummy 420 420)
|