# Tangent vector field

Hello over there.

I'm trying to calculate the norm, or the norm squared, of a vector field tangent to a curve over a manifold. The examples on Curves in Manifold and Vector Fields from the documentation work fine, but when I try a tangent to a curve I get the error ValueError: the two subsets do not belong to the same manifold.

Here is my minimal example:

N = Manifold(2, 'N', latex_name=r'\mathcal{N}',structure='Lorentzian')
var('u v')
chart_N.<u,v> = N.chart()
R.<t> = RealLine()
beta = N.curve({chart_N: [t, sech(t)]}, (t,0, oo), latex_name=r'\beta')
vbeta = beta.tangent_vector_field()
g=N.metric(name='g', latex_name=r'g_{\mathcal{N}}')
g[0,0]=-1
g[1,1]=cosh(u)**2


Everything is fine until here. I got the error when I tried

g(vbeta,vbeta)


or

vbeta.norm(metric=g)


What I'm missing?

edit retag close merge delete

Sort by » oldest newest most voted

You should use

g.along(beta)(vbeta, vbeta)


See the documentation of the method along().

sage: v2 = g.along(beta)(vbeta, vbeta); v2
Scalar field on the Real interval (0, +Infinity)
sage: v2.display()
(0, +Infinity) --> R
t |--> -1/cosh(t)^2
sage: v2.expr()
-1/cosh(t)^2


In SageMath 9.2, which should be released within a few weeks, you will be able to use directly vbeta.dot(vbeta) or vbeta.norm(), cf. the 9.2 release tour.

more