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
|
import cdb.relativity.abstract as rel
def test01():
__cdbkernel__=create_scope()
\partial{#}::PartialDerivative;
ex = rel.riemann_from_christoffel($Q$, $\gamma$)
exl = lhs(ex)
exr = rhs(ex)
tstl := Q^{\rho}_{\sigma\mu\nu} - @(exl);
assert(tstl==0)
print("Test 01a passed")
tstr := \partial_{\mu}{\gamma^{\rho}_{\nu\sigma}} -\partial_{\nu}{\gamma^{\rho}_{\mu\sigma}} + \gamma^{\rho}_{\mu\lambda} \gamma^{\lambda}_{\nu\sigma} - \gamma^{\rho}_{\nu\lambda} \gamma^{\lambda}_{\mu\sigma} - @(exr);
assert(tstr==0)
print("Test 01b passed")
test01()
def test02():
__cdbkernel__=create_scope()
import cdb.core.manip as manip
{I,J}::Indices(position=fixed);
\delta{#}::Derivative;
ex:= A = B C;
lhs= manip.get_lhs(ex)
rhs= manip.get_rhs(ex)
ex2:= \delta_{I}{ @(lhs) } = \delta_{I}{ @(rhs) };
tst:= (\delta_{I}{A} = \delta_{I}{B C}) - @(ex2);
assert tst == $0=0$
print("Test 02 passed")
test02()
|