Skip to content

Commit 56d4074

Browse files
committed
Fixed Trace
1 parent f0e4597 commit 56d4074

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

core/SympyCdb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ void sympy::trace(const Kernel& kernel, Ex& ex, Ex& rules, const Ex& tocompute)
208208

209209
auto top=matrix.begin();
210210
std::vector<std::string> wrap;
211-
sympy::apply(kernel, matrix, top, wrap, std::vector<std::string>(), ".tr()");
211+
sympy::apply(kernel, matrix, top, wrap, std::vector<std::string>(), ".trace()");
212212

213213
Ex rule("\\equals");
214214
rule.append_child(rule.begin(), tocompute.begin());

tests/components.cdb

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -738,22 +738,24 @@ def test36():
738738
test36()
739739

740740
def test37():
741-
{r,t,\phi,\theta}::Coordinate.
742-
{\mu,\nu,\rho,\sigma,\lambda,\kappa,\gamma,\chi}::Indices(values={t,r,\phi,\theta}, position=fixed).
743-
\partial{#}::PartialDerivative.
744-
g_{\mu\nu}::Metric.
745-
g^{\mu\nu}::InverseMetric.
746-
g::Determinant(g_{\mu\nu}).
747-
gt::Trace(g_{\mu\nu}).
748-
ss:= { g_{t t} = -(1-2 M/r), g_{r r} = 1/(1-2 M/r),
749-
g_{\theta\theta} = r**2, g_{\phi\phi}=r**2 \sin(\theta)**2 };
750-
complete(ss, $g$)
751-
#complete(ss, $gt$)
741+
{r,t,\phi,\theta}::Coordinate.
742+
{\mu,\nu,\rho,\sigma,\lambda,\kappa,\gamma,\chi}::Indices(values={t,r,\phi,\theta}, position=fixed).
743+
\partial{#}::PartialDerivative.
744+
g_{\mu\nu}::Metric.
745+
g^{\mu\nu}::InverseMetric.
746+
g::Determinant(g_{\mu\nu}).
747+
gt::Trace(g_{\mu\nu}).
748+
ss:= { g_{t t} = -(1-2 M/r), g_{r r} = 1/(1-2 M/r),
749+
g_{\theta\theta} = r**2, g_{\phi\phi}=r**2 \sin(\theta)**2 };
750+
complete(ss, $g$)
751+
complete(ss, $gt$)
752752
ex:= g;
753753
substitute(ex, ss);
754754
tst:= -r**4 \sin(\theta)**2 - @(ex);
755755
assert(tst==0)
756756
print("Test 37 passed")
757+
ex:= gt;
758+
substitute(ex, ss);
757759

758760
\tau::Coordinate;
759761
{X,Y}::Depends(\tau);

0 commit comments

Comments
 (0)