-
-
Notifications
You must be signed in to change notification settings - Fork 660
Description
The coefficients of an affine connection D in a frame (ei) are computed according to the formula
Gammakij = (Dei)(fk , ej)
where (fk) stands for the coframe dual to (ei). In the current implementation, this is performed by a triple loop on k, i and j with a recomputation of Dei at each stage of the inner loop (!). This makes the whole computation terribly slow for manifold dimensions > 2. This ticket reorders the loops, factoring Dei. As a result, in Sage 8.9.rc1, we move from
sage -t --long src/sage/manifolds/differentiable/affine_connection.py
[441 tests, 132.77 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 132.9 seconds
cpu time: 152.0 seconds
cumulative wall time: 132.8 seconds
to
sage -t --long src/sage/manifolds/differentiable/affine_connection.py
[441 tests, 111.16 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 111.3 seconds
cpu time: 124.1 seconds
cumulative wall time: 111.2 seconds
In passing, additional factorizations have been performed in other loops (in methods connection_forms
, curvature_forms
, etc.), but they were less critical since they involve cached quantities.
CC: @tscrim
Component: geometry
Keywords: affine_connection
Author: Eric Gourgoulhon
Branch/Commit: 439162b
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/28543