Ticket #6745 (closed enhancement: fixed)

Opened 13 months ago

Last modified 12 months ago

[with patch, positive review] quaternion algebras -- add computation of left and right orders associated to ideals

Reported by: was Owned by: tbd
Priority: major Milestone: sage-4.1.2
Component: algebra Keywords:
Cc: Author(s): William Stein
Report Upstream: Reviewer(s): Robert Bradshaw
Merged in: Sage 4.1.2.alpha0 Work issues:

Description (last modified by was) (diff)

A big gap in functionality for quaternion algebras right now is that one can't compute the left and right orders associated to ideals (the functions raise NotImplementedError?). I just designed a little algorithm and wrote code to do this for my research and will post a patch here soon.

Just in case I misplace it, some demo code that works is the following:

def left_order(I):
    Q = I.quaternion_algebra()
    M = [matrix([(a*b).coefficient_tuple() for a in Q.basis()]) for b in I.basis()]
    B = I.basis_matrix()
    invs = [(B*m^(-1)).row_module(ZZ) for m in M]
    IS = invs[0].intersection(invs[1]).intersection(invs[2]).intersection(invs[3])
    ISB = [Q(v) for v in IS.basis()]
    return Q.quaternion_order(ISB)

Attachments

trac_6745.patch Download (19.0 KB) - added by was 13 months ago.
trac_6745-part2.patch Download (1.5 KB) - added by was 12 months ago.
fix comments

Change History

Changed 13 months ago by was

  • description modified (diff)

Changed 13 months ago by was

  • summary changed from quaternion algebras -- add computation of left and right orders associated to ideals to [with patch; needs review] quaternion algebras -- add computation of left and right orders associated to ideals

Changed 13 months ago by was

Changed 13 months ago by robertwb

  • summary changed from [with patch; needs review] quaternion algebras -- add computation of left and right orders associated to ideals to [with patch; nearly positive review] quaternion algebras -- add computation of left and right orders associated to ideals

sage/algebras/quatalg/quaternion_algebra.py:1272

ALGORITHM: Let `b_1, b_2, b_3, b_3` be a basis for this 

(Typo, you want b_4).

TabularUnified? sage/matrix/matrix_integer_dense.pyx:2310

if max(self._nrows, self._ncols) <= 50: 

I think you intended to have an elif here.

Other than that, looks good to me. Also, while I was playing around with it trying it out, I found #6762 useful.

Changed 12 months ago by mvngu

William: any words on the typos reported by Robert?

Changed 12 months ago by was

Regarding Robert's comments:

* I posted a patch fixing the b_3 |--> b_4 typo.

* The matrix_integer_dense.pyx is *not* a typo. The issue is that I want to default to pari for small matrices, *unless* said small matrix has huge entries, so the logic is correct (i.e., if entries huge, still use padic). I've put in some spaces and an {{{# endif} comment to maybe make that seem more intentional.

So the attached patch changes no logic in the code, but changes/improves two comments.

Changed 12 months ago by was

fix comments

Changed 12 months ago by robertwb

  • summary changed from [with patch; nearly positive review] quaternion algebras -- add computation of left and right orders associated to ideals to [with patch; positive review] quaternion algebras -- add computation of left and right orders associated to ideals

Great. Positive review.

Changed 12 months ago by mvngu

  • status changed from new to closed
  • author set to William Stein
  • summary changed from [with patch; positive review] quaternion algebras -- add computation of left and right orders associated to ideals to [with patch, positive review] quaternion algebras -- add computation of left and right orders associated to ideals
  • reviewer set to Robert Bradshaw
  • resolution set to fixed
  • merged set to Sage 4.1.2.alpha0

Merged both patches.

Note: See TracTickets for help on using tickets.