# manifolds : ricci_scalar() has no attribute 'at' [closed]

gP3.ricci_scalar().at(p) does not produce value of ricci_scalar at point p. (gP3 is my metric). whilst ricci().at(p) is working. Error message : AttributeError: 'DiffScalarFieldAlgebra_with_category.element_class' object has no attribute 'at'

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by LPsFR close date 2020-05-21 04:41:47.627017

Sort by » oldest newest most voted

To get the value of a scalar field at a point, simply use the call method, i.e. the parenthesis operator. In your case:

gP3.ricci_scalar()(p)


Actually, at() is reserved to tensor fields of valence $>0$, since for them the call method has a different meaning. For instance, if g is the metric tensor and u and v are two vector fields, the call method of g is used to denote the bilinear form action of g on the pair (u,v) as g(u,v). The following identity, which involves the various call methods and at(), holds:

g.at(p)(u.at(p), v.at(p)) == g(u, v)(p)


Here is a full example:

sage: E.<x,y> = EuclideanSpace()
sage: g = E.metric()
sage: g.display()
g = dx*dx + dy*dy
sage: u = E.vector_field(-y, x)
sage: v = E.vector_field(x+y, x-y)
sage: p = E((2, 3)); p
Point on the Euclidean plane E^2
sage: bool( g.at(p)(u.at(p), v.at(p)) == g(u, v)(p) )
True

more