Opened 2 years ago

Last modified 2 years ago

#28543 closed defect

Improve computation of connection coefficients — at Version 1

Reported by: egourgoulhon Owned by:
Priority: major Milestone: sage-9.0
Component: geometry Keywords: affine_connection, manifold
Cc: tscrim Merged in:
Authors: Eric Gourgoulhon Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by egourgoulhon)

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 pass 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

Change History (1)

comment:1 Changed 2 years ago by egourgoulhon

  • Description modified (diff)
Note: See TracTickets for help on using tickets.