Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elliptic curves: basis_matrix command totally broken #4388

Closed
williamstein opened this issue Oct 30, 2008 · 10 comments
Closed

elliptic curves: basis_matrix command totally broken #4388

williamstein opened this issue Oct 30, 2008 · 10 comments

Comments

@williamstein
Copy link
Contributor

sage: EllipticCurve('11a').period_lattice().basis_matrix()
Traceback (most recent call last):
...
TypeError: Unable to coerce 0.634604652139777 + 1.45881661693850*I (<type 'sage.rings.complex_number.ComplexNumber'>) to Rational

Component: number theory

Author: John Cremona

Reviewer: David Loeffler

Merged: 3.2.alpha3

Issue created by migration from https://trac.sagemath.org/ticket/4388

@williamstein williamstein added this to the sage-3.2 milestone Oct 30, 2008
@williamstein williamstein self-assigned this Oct 30, 2008
@JohnCremona
Copy link
Member

comment:1

Comment: I noticed this when I reworked the whole of period_lattice.py recently. But the function basis_matrix only exists because PeriodLattice_ell derives from PeriodLattice and hence from FreeModule_generic_pid. But I don't think it makes a lot of sense to ask for a basis matrix in a case like this, when the thing is a Z-module but it does not sit in an ambient Q-vector space.

If people agree, we should at least add the function but have it raise a sensible error.

@williamstein
Copy link
Contributor Author

comment:2

But I really wanted basis_matrix(), since I wanted to compute the determinant of the basis matrix in order to find the volume of the period lattice.

There is no volume method. That would also be nice.

I think at least mathematically the idea of "basis matrix" makes sense, and I was happy it was there (except that it is broken).

@JohnCremona
Copy link
Member

comment:3

Replying to @williamstein:

But I really wanted basis_matrix(), since I wanted to compute the determinant of the basis matrix in order to find the volume of the period lattice.

There is no volume method. That would also be nice.

It _is_ there: complex_area() (not my choice of name)!

I think at least mathematically the idea of "basis matrix" makes sense, and I was happy it was there (except that it is broken).

You'll have to explain it to me. Do you want the 2x2 matrix of reals consisting of the real and imaginary parts of the period basis? That would be easy to add, like this:

sage: E = EllipticCurve('389a1')
sage: L = E.period_lattice()
sage: M = Matrix([[CC(w).real(), CC(w).imag()] for w in L.basis()]); M

[ 2.49021256085505 0.000000000000000]
[0.000000000000000  1.97173770155165]
sage: M.det()
4.91004599111539
sage: L.complex_area()
4.91004599111539

and

sage: E = EllipticCurve('11a1')
sage: L = E.period_lattice()
sage: M = Matrix([[CC(w).real(), CC(w).imag()] for w in L.basis()]); M

[ 1.26920930427955 0.000000000000000]
[0.634604652139777  1.45881661693850]
sage: M.det()
1.85154362345596
sage: L.complex_area()
1.85154362345596

@JohnCremona
Copy link
Member

Attachment: sage-trac4388.patch.gz

@JohnCremona
Copy link
Member

comment:4

Patch sage-trac4388.patch attached (based on 3.2.alpha1).

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Nov 3, 2008

comment:5

Looks good to me. I agree with was's statement that the concept of a basis matrix makes sense here, and that basis_matrix() should return this rather than an error; patch applies fine in 3.2.alpha1; and all doctests in sage/schemes/elliptic_curves pass.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 4, 2008

comment:6

Merged in Sage 3.2.alpha3

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Nov 4, 2008
@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Jun 7, 2009

Merged: 3.2.alpha3

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Jun 7, 2009

Reviewer: David Loeffler

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Jun 7, 2009

Author: John Cremona

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants