Opened 9 years ago

Closed 9 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:

Status badges

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)

trac_12811_quatideal_norm.patch (2.8 KB) - added by daniels 9 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 follow-up: Changed 9 years ago by daniels

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.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 9 years ago by dkrenn

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 in reply to: ↑ 2 Changed 9 years ago by daniels

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 9 years ago by daniels

  • Status changed from new to needs_review

Changed 9 years ago by daniels

comment:5 Changed 9 years ago by aly.deines

  • Status changed from needs_review to positive_review

comment:6 Changed 9 years ago by jdemeyer

Please fill in your real name as Author.

comment:7 Changed 9 years ago by jdemeyer

Please fill in your real name as Reviewer.

comment:8 Changed 9 years ago by aly.deines

  • Reviewers set to Aly Deines

comment:9 Changed 9 years ago by daniels

  • Authors set to Daniel Smertnig

comment:10 Changed 9 years ago by jdemeyer

  • Merged in set to sage-5.3.beta1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.