---------- Forwarded message ----------
From: aperry <ape...@math.harvard.edu>
Date: Fri, Mar 28, 2014 at 5:25 PM
Subject: sage bug
To: wst...@uw.edu


Hi,

I'd like to report a bug in sage. There seems to be a problem with the
functions that check whether two quadratic forms over Z are
equivalent.

Here is a sample of code that doesn't work correctly:

------------

Q1 = QuadraticForm(ZZ, 3, [-4,6*2,-2*2,-10,3*2,2])
Q2 = QuadraticForm(ZZ,3,[-14,9*2,34*2, -6, -21*2, -82])
Q3 = QuadraticForm(ZZ,3,[-14,9*2,34*2, -6, -21*2, -822])
[Q1.hasse_invariant(p) for p in prime_range(300)]
[Q2.hasse_invariant(p) for p in prime_range(300)]
[Q3.hasse_invariant(p) for p in prime_range(300)]
Q1.is_globally_equivalent__souvigner(Q2)
Q1.is_globally_equivalent__souvigner(Q3)
Q1.is_globally_equivalent_to(Q2)
Q1.is_globally_equivalent_to(Q3)

Output:
[-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
True
True

Error in lines 9-9
Traceback (most recent call last):
  File 
"/projects/2d4ad217-a078-4d67-9d8b-0bf2c928d95d/.sagemathcloud/sage_server.py",
line 733, in execute
    exec compile(block+'\n', '', 'single') in namespace, locals
  File "", line 1, in <module>
  File 
"/usr/local/sage/sage-6.2/local/lib/python2.7/site-packages/sage/quadratic_forms/quadratic_form__equivalence_testing.py",
line 177, in is_globally_equivalent_to
    raise ValueError, "not a definite form in
QuadraticForm.is_globally_equivalent_to()"
ValueError: not a definite form in QuadraticForm.is_globally_equivalent_to()

------------

Some comments:
1. As the computation of the Hasse invariants show, Q1 and Q2 are
equivalent over the rationals (you can check they have the same
signature too), but Q3 is not equivalent to Q1.

2. Yet is_globally_equivalent__souvigner says that all of the forms
are equivalent over Z, which is false. It seems that this function
always returns true.

3. is_globally_equivalent_to should work for indefinite forms (such as
Q1 and Q2), but it gives an error message saying something about the
forms not being definite.

4. What I originally wanted to compute with this was the actual matrix
conjugating Q1 to Q2 over Z (I do believe they are equivalent over Z).
Sage should return this matrix with say
Q1.is_globally_equivalent__souvigner(Q2, True), but this crashes.

Thanks for any help with this,
Alex


-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to