First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

When one writes dθ * dφ + dφ * dθ, Sage first computes a = dθ * dφ and b = dφ * dθ; it then performs a + b and, at this stage, there is no way to detect (without any extra computation) that the output must be symmetric. The only case where the symmetry is set automatically is for expressions like dθ * dθ. So you should initialize the metric as

g = M.metric('g')
g.set((dθ * dφ + dφ * dθ).symmetrize())

An equivalent way, which avoids to introduce explicitly the 1-forms and , is

g = M.metric('g')
g[2,3] = 1