Opened 11 years ago
Closed 10 years ago
#12811 closed defect (fixed)
(reduced) norm of quaternion ideals is broken
Reported by: | daniels | Owned by: | AlexGhitza |
---|---|---|---|
Priority: | major | Milestone: | sage-5.3 |
Component: | algebra | Keywords: | quaternion, ideal |
Cc: | Merged in: | sage-5.3.beta1 | |
Authors: | Daniel Smertnig | Reviewers: | Aly Deines |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
1.) The norm of an ideal in quaternion algebra is off by a factor of 2
sage: A.<i,j,k> = QuaternionAlgebra(-1,-1) sage: I = A.ideal([i,j,k,1/2 + 1/2*i + 1/2*j + 1/2*k]) # this is actually an order, so has reduced norm 1 sage: I.left_order() sage: I.norm() 2
The reason is that the norm is computed from d(I)=n(I)2 d(R) where R is the left- or right-order of I and d(I) = \sqrt{ abs{det(tr(x_i \conj{x_j}))} } for a ZZ-basis (x_i) of I. But the matrix returned by gram_matrix() that is actually used in the computation has as entries 2*tr(x_i \conj{x_j}), thus the determinant is off by a factor of 16 and the resulting reduced norm off by a factor of 2
2.) Omitting the line 'I.left_order()' in the previous example gives a RuntimeError?:
sage: A.<i,j,k> = QuaternionAlgebra(-1,-1) sage: I = A.ideal([i,j,k,1/2 + 1/2*i + 1/2*j + 1/2*k]) sage: I.norm() --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) /home/daniel/<ipython console> in <module>() /opt/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/python2.6/site-packages/sage/algebras/quatalg/quaternion_algebra.pyc in norm(self) 1973 assert r.is_square(), "first is bad!" 1974 r = r.sqrt() -> 1975 r/= self.quaternion_order().discriminant() 1976 assert r.is_square(), "second is bad!" 1977 return r.sqrt() /opt/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/python2.6/site-packages/sage/algebras/quatalg/quaternion_algebra.pyc in quaternion_order(self) 1692 A = self.__right_order 1693 else: -> 1694 raise RuntimeError, "unable to determine quaternion order of ideal without known order" 1695 self.__quaternion_order = A 1696 return A RuntimeError: unable to determine quaternion order of ideal without known order
This is because neither the left- nor the right-order of I have been computed at this point. There is however no mathematical reason why this should fail.
Attachments (1)
Change History (11)
comment:1 follow-up: 2 Changed 11 years ago by
comment:2 follow-up: 3 Changed 11 years ago by
Replying to daniels:
[...] I changed them and cross-checked with Magma that the ideals appearing in the doctests indeed have the new values as reduced norms.
You could add an additonal doc-test with " # optional - magma" as comment, so that the mentioned cross-check is also included.
comment:3 Changed 11 years ago by
Replying to dkrenn:
You could add an additonal doc-test with " # optional - magma" as comment, so that the mentioned cross-check is also included.
I updated the patch to do this for the first doctest.
I also noticed that the other 'optional - magma' doctests fail on my Version of Magma (V2.18-4) because the output format has slightly changed from what Sage expects, but I suppose the fix for that should not be mixed with this ticket.
comment:4 Changed 11 years ago by
Status: | new → needs_review |
---|
Changed 11 years ago by
Attachment: | trac_12811_quatideal_norm.patch added |
---|
comment:5 Changed 11 years ago by
Status: | needs_review → positive_review |
---|
comment:8 Changed 11 years ago by
Reviewers: | → Aly Deines |
---|
comment:9 Changed 11 years ago by
Authors: | → Daniel Smertnig |
---|
comment:10 Changed 10 years ago by
Merged in: | → sage-5.3.beta1 |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
The patch corrects both mentioned problems, and adds a doctest to test for this.
Some of the old doctests seem to have wrong values for the norm (which is why they passed). I changed them and cross-checked with Magma that the ideals appearing in the doctests indeed have the new values as reduced norms.