id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
18430 Bug in is_hyperbolic pkoprowski "The method is_hyperbolic in the class of quadratic form returns incorrect results over the field QQ_2. Here is an explicit example:
{{{#!python
q = DiagonalQuadraticForm(QQ, [1,1,-1,-1])
print q.is_hyperbolic(2)
}}}
The form <1,1,-1,-1> is clearly hyperbolic - by definition. It is a sum of two hyperbolic planes. Nevertheless Sage returns `False` here.
The reason is as follows. In the file `quadratic_forms/quadratic_form__local_field_invariants.py` in function `is_hyperbolic` the actual code is
{{{#!python
elif p == 2:
return QQ(self.det() * (-1)**m).is_padic_square(p) and (self.hasse_invariant(p) == (-1)**m) ## Actually, this -1 is the Hilbert symbol (-1,-1)_p
}}}
while it should be
{{{#!python
elif p == 2:
return QQ(self.det() * (-1)**m).is_padic_square(p) and (self.hasse_invariant(p) == (-1)**(m*(m-1)/2)) ## Actually, this -1 is the Hilbert symbol (-1,-1)_p
}}}
For mathematical explanation see e.g. T.Y. Lam ""Introduction to Quadratic Forms over Field"", Proposition V.3.25
I'm not sure how to formally patch the code, so I'm posting it this way.
" defect closed major sage-8.0 quadratic forms fixed Malcolm Rupert Frédéric Chapoton, Travis Scrimshaw N/A f99393fc110ed6c5f59136717d5fbf1c69c6c7bd f99393fc110ed6c5f59136717d5fbf1c69c6c7bd