我正在尝试使用度量 g 的符号表达式来确定黎曼曲率张量。我已经预先计算了指标。笛卡尔坐标给出为
- x = x(eta,theta,psi) = a*sinh(eta)*cos(psi)/(cosh(eta) - cos(theta))
- y = y(eta,theta,psi) = a*sinh(eta)*sin(psi)/(cosh(eta) - cos(theta))
- z = z(eta,theta,psi) = a*sin(theta))/(cosh(eta) - cos(theta))
该度量是通过从笛卡尔 (x,y,z) 到环形坐标 (eta,theta,psi) 的转换找到的。使用符号包SymPy,如下脚本
from sympy.diffgeom import Manifold, Patch, CoordSystem, TensorProduct
from sympy.abc import theta, eta, psi
import sympy as sym
x,y,z,a = sym.symbols("x y z a")
m = Manifold("M",3)
patch = Patch("P",m)
cartesian = CoordSystem("cartesian",patch)
toroidal = CoordSystem("toroidal",patch)
from sympy import sin,cos,sinh,cosh
toroidal.connect_to(cartesian,[eta,theta,psi],
[(a*sinh(eta)*cos(psi))/(cosh(eta) - cos(theta)),
(a*sinh(eta)*sin(psi))/(cosh(eta) - cos(theta)),
(a*sin(theta))/(cosh(eta) - cos(theta))],inverse=False)
g = sym.Matrix([[a**2/(cos(theta) - cosh(eta))**2, 0, 0],
[0, a**2/(cos(theta) - cosh(eta)), 0],
[0, 0, a**2*sinh(eta)**2/(cos(theta) - cosh(eta))**2]])
diff_forms = toroidal.base_oneforms()
metric_diff_form = sum([TensorProduct(di, dj)*g[i, j] for i, di in enumerate(diff_forms) for j, dj in enumerate(diff_forms)])
from sympy.diffgeom import metric_to_Riemann_components
metric_to_Riemann_components(metric_diff_form)
产生结果
((((0, 0, 0), (0, 0, 0), (0, 0, 0)),
((0, 0, 0), (0, 0, 0), (0, 0, 0)),
((0, 0, 0), (0, 0, 0), (0, 0, 0))),
(((0, 0, 0), (0, 0, 0), (0, 0, 0)),
((0, 0, 0), (0, 0, 0), (0, 0, 0)),
((0, 0, 0), (0, 0, 0), (0, 0, 0))),
(((0, 0, 0), (0, 0, 0), (0, 0, 0)),
((0, 0, 0), (0, 0, 0), (0, 0, 0)),
((0, 0, 0), (0, 0, 0), (0, 0, 0))))
对于给定的指标 g,结果不正确。结果应该是不平凡的。
我是一名优秀的程序员,十分优秀!