Skip to content

Commit

Permalink
sagemathgh-38805: use specialized 2-dimensional .log() method in .mat…
Browse files Browse the repository at this point in the history
…rix_on_subgroup()

    
This should be equivalent but faster (see sagemath#38347).

```sage
sage: E = EllipticCurve(GF((2^77-33, 2)), [1,0])
....: P, Q = E.gens()
....: pi = E.automorphisms()[-1]
....: %time pi.matrix_on_subgroup([P, Q])
```

Sage 10.5.beta7:
```
CPU times: user 13.8 s, sys: 32.5 ms, total: 13.8 s
```

This branch:
```
CPU times: user 48.1 ms, sys: 64 µs, total: 48.2 ms
```
    
URL: sagemath#38805
Reported by: Lorenz Panny
Reviewer(s): grhkm21
  • Loading branch information
Release Manager committed Oct 19, 2024
2 parents d5ccbf5 + fc05e23 commit b342274
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sage/schemes/elliptic_curves/hom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,10 +1118,8 @@ def matrix_on_subgroup(self, domain_gens, codomain_gens=None):
imP = self._eval(P)
imQ = self._eval(Q)

from sage.groups.additive_abelian.additive_abelian_wrapper import AdditiveAbelianGroupWrapper
H = AdditiveAbelianGroupWrapper(R.parent(), [R,S], [n,n])
vecP = H.discrete_log(imP)
vecQ = H.discrete_log(imQ)
vecP = imP.log([R, S])
vecQ = imQ.log([R, S])

from sage.matrix.constructor import matrix
from sage.rings.finite_rings.integer_mod_ring import Zmod
Expand Down

0 comments on commit b342274

Please sign in to comment.