File: numerical.cdb

package info (click to toggle)
cadabra 1.46-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,244 kB
  • sloc: cpp: 33,188; ansic: 2,724; makefile: 329; yacc: 180; sh: 157; python: 45; lex: 38; lisp: 19
file content (24 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Various tests with numerical pre-factors.

a:= (1/5)*b-(1/5)*q;
c:= d-(5/6)*@(a);

d:= b/4*a;

e:= a*(-3);

obj1:= -1/36*A-1/9*B;
tst1:= @(obj1)+1/36*A+1/9*B;
@collect_terms!(%);
@assert(tst1);

# Test 2: NumericalFlat property
#

@reset.
\partial{#}::PartialDerivative.
obj2:= 3 a b \partial_{m n}( 5 c d );
@numerical_flatten!!(%);
tst2:= 15 a b \partial_{m n}( c d ) - @(obj2);
@collect_terms!(%);
@assert(tst2);