Ask Your Question

When affine_connection is empty

asked 2020-08-25 22:25:12 +0200

danielvolinski gravatar image

Hi All,

I'm using SageMath 9.1 on Windows Native.

When affine_connection has no content and I display it, I get a ValueError that stops the computation.

M = Manifold(3, 'M', start_index=1)
c_xyz.<x,y,z> = M.chart()
nab = M.affine_connection('nabla', r'\nabla')

IMO it should display something like 'Empty' or 'Null' or '{}' but not an error.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-08-28 11:26:26 +0200

eric_g gravatar image

I would say that an error message is appropriate here, because the affine connection has been declared as a Python object, but not defined as a mathematical object: no connection coefficients have been initialized and no computation can be performed with an affine connection in such a state. In particular, there is no mathematical meaning of an "empty connection". The error message thrown by nab.display() could be improved though. In the current case, it is

ValueError: no common frame found for the computation

because Sage tries to evaluate the connection coefficients in the manifold's default frame for the display. A more explanatory message, like "undefined affine connection", could be more appropriate in the present case.

Note that the same feature occurs when attempting to display undefined tensor fields:

sage: v = M.vector_field()                                                      
sage: v.display()                                                               
ValueError: no basis could be found for computing the components in the Coordinate frame (M, (d/dx,d/dy,d/dz))
edit flag offensive delete link more



I would go for something more suave, some kind of error that would not stop the calculation of further cells in the notebook, after all, it is not an error that can cause other errors, you just have to give some content to the affine connection (or the tensor field) and everything should be all right.

danielvolinski gravatar imagedanielvolinski ( 2020-08-29 10:34:23 +0200 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2020-08-25 22:25:12 +0200

Seen: 244 times

Last updated: Aug 28 '20