Ask Your Question

# Error computing curvature of graph submanifold

The following appears to be a bug in sagemanifolds curvature. I see the error running it in cocalc.com. Other things like computing the induced_metric() and normal() and fine. Am I doing something wrong?

sage: P = Manifold(3, 'P', structure='Riemannian', metric_name='g', start_index=0)
sage: Q = Manifold(2, 'Q', ambient=P, structure='Riemannian', metric_name='k', start_index=1)

sage: CP.<x,y,z> = P.chart()
sage: CQ.<u,v> = Q.chart()

sage: g = P.metric()
sage: c = 2/(sum(y^2 for y in CP[1:]) + 1)
sage: g[0,0], g[1,1], g[2,2] = 1, c^2, c^2

sage: f = sum(CQ[:])
sage: f = u + v
sage: phi = Q.diff_map(P,{(CQ, CP):[f] + list(CQ[:])})
sage: phi_inv = P.diff_map(Q, {(CP, CQ) : list(CQ[:])})

sage: Q.set_embedding(phi, inverse=phi_inv)

sage: K = Q.extrinsic_curvature()


Error in lines 13-13

Traceback (most recent call last):

File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1188, in execute flags=compile_flags), namespace, locals)

File "", line 1, in <module>

File "/ext/sage/sage-8.8_1804/local/lib/python2.7/site-packages/sage/manifolds/differentiable/pseudo_riemannian_submanifold.py", line 1067, in second_fundamental_form range(self._dim + 1))

File "sage/matrix/matrix0.pyx", line 1424, in sage.matrix.matrix0.Matrix.__setitem__ (build/cythonized/sage/matrix/matrix0.c:8796) self.set_unsafe(row, col, self._coerce_element(value))

File "sage/matrix/matrix0.pyx", line 1529, in sage.matrix.matrix0.Matrix._coerce_element (build/cythonized/sage/matrix/matrix0.c:10273) return self._base_ring(x)

File "sage/structure/parent.pyx", line 900, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9197) return mor._call_(x)

File "sage/structure/coerce_maps.pyx", line 288, in sage.structure.coerce_maps.NamedConvertMap._call_ (build/cythonized/sage/structure/coerce_maps.c:5942) cdef Element e = method(C)

File "sage/symbolic/expression.pyx", line 1087, in sage.symbolic.expression.Expression._integer_ (build/cythonized/sage/symbolic/expression.cpp:8689) raise TypeError("unable to convert %r to an integer" % self)

TypeError: unable to convert 1/2sqrt(2)(u^4 + v^4 + 2(u^2 + 1)v^2 + 2u^2 + 1)y/(sqrt(u^4 + v^4 + 2(u^2 + 1)v^2 + 2u^2 + 3)(y^2 + z^2 + 1)) + 1/2sqrt(2)(u^4 + v^4 + 2(u^2 + 1)v^2 + 2u^2 + 1)z/(sqrt(u^4 + v^4 + 2(u^2 + 1)v^2 + 2u^2 + 3)(y^2 + z^2 + 1)) to an integer

edit retag close merge delete

## 1 Answer

Sort by » oldest newest most voted

Thanks for reporting this issue. This is a bug, which is now fixed in the ticket #28462. Hopefully, this ticket will be merged in Sage 8.9 (to come out soon).

With #28462, your code leads to

sage: K = Q.extrinsic_curvature()
sage: K.display_comp()
K_uu = -4*sqrt(u^4 + v^4 + 2*(u^2 + 1)*v^2 + 2*u^2 + 3)*(u - v)/(sqrt(2)*u^6 + sqrt(2)*v^6 + 3*(sqrt(2)*u^2 + sqrt(2))*v^4 + 3*sqrt(2)*u^4 + (3*sqrt(2)*u^4 + 6*sqrt(2)*u^2 + 5*sqrt(2))*v^2 + 5*sqrt(2)*u^2 + 3*sqrt(2))
K_uv = -4*sqrt(u^4 + v^4 + 2*(u^2 + 1)*v^2 + 2*u^2 + 3)*(u + v)/(sqrt(2)*u^6 + sqrt(2)*v^6 + 3*(sqrt(2)*u^2 + sqrt(2))*v^4 + 3*sqrt(2)*u^4 + (3*sqrt(2)*u^4 + 6*sqrt(2)*u^2 + 5*sqrt(2))*v^2 + 5*sqrt(2)*u^2 + 3*sqrt(2))
K_vu = -4*sqrt(u^4 + v^4 + 2*(u^2 + 1)*v^2 + 2*u^2 + 3)*(u + v)/(sqrt(2)*u^6 + sqrt(2)*v^6 + 3*(sqrt(2)*u^2 + sqrt(2))*v^4 + 3*sqrt(2)*u^4 + (3*sqrt(2)*u^4 + 6*sqrt(2)*u^2 + 5*sqrt(2))*v^2 + 5*sqrt(2)*u^2 + 3*sqrt(2))
K_vv = 4*sqrt(u^4 + v^4 + 2*(u^2 + 1)*v^2 + 2*u^2 + 3)*(u - v)/(sqrt(2)*u^6 + sqrt(2)*v^6 + 3*(sqrt(2)*u^2 + sqrt(2))*v^4 + 3*sqrt(2)*u^4 + (3*sqrt(2)*u^4 + 6*sqrt(2)*u^2 + 5*sqrt(2))*v^2 + 5*sqrt(2)*u^2 + 3*sqrt(2))


Side note: your declaration of phi_inv is not correct: with your code, we have

sage: phi_inv.display()
P --> Q
(x, y, z) |--> (u, v) = (u, v)


As you can see, the output is ill-formed, because (u, v) should be a function of (x, y, z).

The correct declaration should be

sage: phi_inv = P.diff_map(Q, {(CP, CQ) : list(CP[1:])})


which leads to

sage: phi_inv.display()
P --> Q
(x, y, z) |--> (u, v) = (y, z)


Forturnately, phi_inv plays no role in the computation of the extrinsic curvature.

EDIT (14 Sep. 2019): the fix introduced in #28462 has been merged in Sage 8.9.rc0, so the next stable release of Sage will be free from this bug.

more

## Comments

Awesome! Thanks for pointing out the error in my code too.

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2019-09-08 06:15:18 +0200

Seen: 69 times

Last updated: Sep 14 '19