Ask Your Question
1

Orthonormal frame in SageManifolds without specifying coordinates

asked 2026-07-02 21:32:15 +0200

Alex Pawelko gravatar image

Hello,

In SageManifolds, I am trying to do computations in an arbitrary orthonormal frame (we may assume the manifold is parallelizable, so the frame can be global without worrying about locality or anything) without specifying coordinates.

It seems that the objects work symbolically fine, but things do not print well, as it seems the library assumes there must be a default chart. I am running SageMath version 10.9.

Example code:

M = Manifold(7, 'M', start_index=1)
e = M.vector_frame('e')
M.set_default_frame(e)
g = M.riemannian_metric('g')
g[e, :] = diagonal_matrix([1, 1, 1, 1, 1, 1, 1])
coe = e.coframe()
print(sum(coe[i] * coe[i] for i in range(1, 8)) == g) # outputs True, so g exists properly
print(g.display())

with the final line outputting the error

    ValueError                                Traceback (most recent call last)
Cell In[10], line 1
----> 1 print(g.display())

File ~/miniforge3/envs/sage/lib/python3.12/site-packages/sage/tensor/modules/free_module_tensor.py:690, in FreeModuleTensor.display(self, basis, format_spec)
    688 for ind in comp.index_generator():
    689     ind_arg = ind + (format_spec,)
--> 690     coef = comp[ind_arg]
    691     # Check whether the coefficient is zero, preferably via
    692     # the fast method is_trivial_zero():
    693     if hasattr(coef, 'is_trivial_zero'):

File ~/miniforge3/envs/sage/lib/python3.12/site-packages/sage/tensor/modules/comp.py:4828, in CompFullySym.__getitem__(self, args)
   4826         return self._comp[ind]
   4827     if format_type is None:
-> 4828         return self._output_formatter(self._comp[ind])
   4829     return self._output_formatter(self._comp[ind], format_type)
   4831 # the value is zero

File ~/miniforge3/envs/sage/lib/python3.12/site-packages/sage/manifolds/scalarfield.py:1782, in ScalarField.coord_function(self, chart, from_chart)
   1780             break
   1781     if not found:
-> 1782         raise ValueError("no starting chart could be found to " +
   1783                          "compute the expression in the {}".format(chart))
   1784 change = self._domain._coord_changes[(chart, from_chart)]
   1785 # old coordinates expressed in terms of the new ones:

ValueError: no starting chart could be found to compute the expression in the None
enter code here

If there is no way around it, I would be happy if someone pointed me to the relevant source in the library for me to write a fix, as being able to only work in a frame and not a chart is critical for my project.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2026-07-06 19:16:49 +0200

Alex Pawelko gravatar image

The answer (currently) is that this is impossible to do. To display anything, SageManifolds inherently wants to pass to a corodinate chart to have explicit expressions for the coordinate functions and is unable to treat the component functions of something expressed in a frame symbolically.

I am currently writing a patch to fix this.

edit flag offensive delete link more

Comments

Indeed, the current implementation of manifolds in Sage is based on coordinate charts and atlases.

eric_g gravatar imageeric_g ( 2026-07-15 17:54:35 +0200 )edit

Good to hear that you are writing a patch on this. I am curious: if you use symbolic functions for tensor components, computations may add up to yield complicated expressions involving these symbolic functions...

eric_g gravatar imageeric_g ( 2026-07-15 19:28:38 +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

Stats

Asked: 2026-07-02 21:32:15 +0200

Seen: 155 times

Last updated: Jul 06