Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions galgebra/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import List, Optional

from sympy import (
diff, trigsimp, Matrix, Rational,
cancel, diff, trigsimp, Matrix, Rational,
sqf_list, sqrt, eye, S, expand, Mul,
Add, simplify, Expr, Abs, Function, MatrixSymbol
)
Expand Down Expand Up @@ -609,9 +609,9 @@ def normalize_metric(self):
# Normalize derivatives of basis vectors
for x_i in self.n_range:
for jb in self.n_range:
self.de[x_i][jb] = Simp.apply((((self.de[x_i][jb].subs(renorm)
self.de[x_i][jb] = Simp.apply(cancel((self.de[x_i][jb].subs(renorm)
- diff(self.e_norm[jb], self.coords[x_i]) *
self.basis[jb]) / self.e_norm[jb])))
self.basis[jb]) / self.e_norm[jb]))
if self.debug:
printer.oprint('e^{i}->e^{i}/|e_{i}|', renorm)
for x_i in self.n_range:
Expand All @@ -621,7 +621,7 @@ def normalize_metric(self):
# Normalize metric tensor
for ib in self.n_range:
for jb in self.n_range:
self.g[ib, jb] = Simp.apply(self.g[ib, jb] / (self.e_norm[ib] * self.e_norm[jb]))
self.g[ib, jb] = Simp.apply(cancel(self.g[ib, jb] / (self.e_norm[ib] * self.e_norm[jb])))

if self.debug:
printer.oprint('renorm(g)', self.g)
Expand Down
Loading