- # TODO: don't invert, there are better ways to get the C*E^(-1)
- # that we need.
- E_inverse = E.inverse()
+ # We don't actually need the inverse of E, what we really need
+ # is C*E.inverse(), and that can be found by setting
+ #
+ # C*E.inverse() == X <====> XE == C.
+ #
+ # The latter can be found much more easily by solving a system.
+ # Note: I do not actually know that sage solves the system more
+ # intelligently, but this is still The Right Thing To Do.
+ CE_inverse = E.solve_left(C)