#12860: Incorrect computation of maximal orders in quaternion algebras
---------------------------+------------------------------------------------
Reporter: daniels | Owner: daniels
Type: defect | Status: new
Priority: major | Milestone: sage-5.1
Component: algebra | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------+------------------------------------------------
Old description:
> The maximal_order function of QuaternionOrder can produce incorrect
> results.
> It is implemented by means of an explicit formula, which expects not just
> the algebra to be ramified precisely at one finite prime p and infinity,
> but also expect the invariants a=i^2 and b=j^2 to have a special form.
> Not all the necessary conditions are checked by the code.
>
> E.g. the following is obviously not an order since it contains non-
> integral elements:
>
> {{{
> sage: A.<i,j,k> = QuaternionAlgebra(17)
> sage: print A.invariants()
> (-3, -17)
> sage: R = A.maximal_order()
> sage: b = R.basis()
> sage: print b
> (1/2 + 1/2*j, 1/2*i + 1/2*k, -1/3*j - 1/3*k, k)
> sage: b[0]*b[1]
> 9/2*i
> sage: (b[0]*b[1]).reduced_norm()
> 243/4
> }}}
>
> But this is ok, because now the invariants are as in Pizer's paper:
>
> {{{
> sage: A.<i,j,k> = QuaternionAlgebra(-17,-3)
> sage: print A.maximal_order().basis()
> (1/2 + 1/2*j, 1/2*i + 1/2*k, -1/3*j - 1/3*k, k)
> }}}
>
> This could be fixed by simply swapping (i,j) in the formula depending on
> the invariants, but the invariants can deviate from the required form in
> more than one way, again possibly resulting in failure of the formula:
>
> {{{
> sage: A.<i,j,k> = QuaternionAlgebra(-17*9,-3)
> sage: print A.maximal_order().basis()
> (1/2 + 1/2*j, 1/2*i + 1/2*k, -1/3*j - 1/3*k, k)
> sage: print (-1/3*j - 1/3*k).reduced_norm()
> 154/3
> }}}
>
> (#11464 is related)
>
> **Patch follows.**
New description:
The maximal_order function of QuaternionOrder can produce incorrect
results.
It is implemented by means of an explicit formula, which expects not just
the algebra to be ramified precisely at one finite prime p and infinity,
but also expect the invariants a=i^2^ and b=j^2^ to have a special form.
Not all the necessary conditions are checked by the code.
E.g. the following is obviously not an order since it contains non-
integral elements:
{{{
sage: A.<i,j,k> = QuaternionAlgebra(17)
sage: print A.invariants()
(-3, -17)
sage: R = A.maximal_order()
sage: b = R.basis()
sage: print b
(1/2 + 1/2*j, 1/2*i + 1/2*k, -1/3*j - 1/3*k, k)
sage: b[0]*b[1]
9/2*i
sage: (b[0]*b[1]).reduced_norm()
243/4
}}}
But this is ok, because now the invariants are as in Pizer's paper:
{{{
sage: A.<i,j,k> = QuaternionAlgebra(-17,-3)
sage: print A.maximal_order().basis()
(1/2 + 1/2*j, 1/2*i + 1/2*k, -1/3*j - 1/3*k, k)
}}}
This could be fixed by simply swapping (i,j) in the formula depending on
the invariants, but the invariants can deviate from the required form in
more than one way, again possibly resulting in failure of the formula:
{{{
sage: A.<i,j,k> = QuaternionAlgebra(-17*9,-3)
sage: print A.maximal_order().basis()
(1/2 + 1/2*j, 1/2*i + 1/2*k, -1/3*j - 1/3*k, k)
sage: print (-1/3*j - 1/3*k).reduced_norm()
154/3
}}}
(#11464 is related)
--
Comment (by daniels):
The patch does the following:
* Move `maximal_order` from `brandt.py` to `quaternion_algebra.py`.
* Fix `maximal_order` to raise a NotImplementedError if the invariants are
not of the expected form
* Add checks in `''__init__''` of QuaternionOrder to verify if the given
basis actually is the basis of an order (this would have catched the bug
earlier).
* Fix all the doctests that were expecting the mathematically incorrect
results.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12860#comment:1>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.