#17425: Rational isometry test for quadratic forms over number fields
-------------------------------------+-------------------------------------
Reporter: annahaensch | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.9
Component: quadratic forms | Resolution:
Keywords: | Merged in:
Authors: Anna Haensch | Reviewers: Vincent Delecroix
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/annahaensch/ticket/17425 | 91c47046f8c18487b8e76469ece0618b868df1ef
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Instead of doing {{{L=L1+L2}}} you can do {{{L=set().union(L1,L2)}}}. That
way you will remove duplicates as in
{{{
sage: V = DiagonalQuadraticForm(K,[-1,a,-2*a])
sage: W = DiagonalQuadraticForm(K,[-1,-a,2*a])
sage: L1 = V.Gram_det().support()
sage: L1
[Fractional ideal (a + 1), Fractional ideal (a)]
sage: L 2 =W.Gram_det().support()
sage: L2
[Fractional ideal (a + 1), Fractional ideal (a)]
sage: L1+L2
[Fractional ideal (a + 1),
Fractional ideal (a),
Fractional ideal (a + 1),
Fractional ideal (a)]
sage: set().union(L1,L2)
{Fractional ideal (a + 1), Fractional ideal (a)}
}}}
And there is no need to declare `L` (but you might find it simpler) by
doing
{{{
for p in set().union(L1,L2):
...
}}}
`M` and `N` are computed early but not used early. It would make sense to
move there declarations since if the dimension differ (the first test)
then there is no need to compute them. You can move them after the `else`
in the case that the base ring is not `QQ`. You can also move the
declaration of `L1` and `L2`.
Could you add some tests for all the cases (starting from the Gram
determinant being 0)?
More interesting: is there a way to return the transformation in case they
are equivalent?
--
Ticket URL: <http://trac.sagemath.org/ticket/17425#comment:12>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.