#15976: IntegerLattice class
-------------------------------------+-------------------------------------
       Reporter:  malb               |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.2
      Component:  linear algebra     |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Martin Albrecht    |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/malb/15976_integer_lattice       |  a13b4aad3e9578866922d01932e6abac02687718
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by malb):

 Replying to [comment:6 SimonKing]:

 Hi Simon,

 thanks a lot for your comments!


 > If your lattices are supposed to be groups (in particular, sets), then
 the lattice should inherit from `Parent`, and you should implement
 elements as well, inheriting from `Element` (or rather `ModuleElement`,
 since you want to add elements). I guess it would be fine to import some
 implementation of integer vectors (I am sure those things exist somewhere
 in Sage), and assign it as a class attribute `IntegerLattice.Element`.
 >
 > Next, ''if'' you decide to inherit from `Parent` and assign `.Element`,
 you should do `self._init_category_(Groups())` (or a better category, if
 there is any) during initialisation of your lattice. This should be enough
 to enable element creation and let the test suites
 (`TestSuite(YourLattice).run()`) pass. If it isn't---well, then we'll take
 care of it later.

 I tried to go down this route: I inherited from `Parent` and set
 `self._init_category_(CommutativeAdditiveGroups())`. The
 `TestSuite(L).run()` now first complaints that there is no
 `_an_element_()` which is easily fixable. However, the next complaint is
 that elements created by `some_element()` do not live in the lattice but
 in '''Z'''^n^. I am not sure I want my lattice vectors to live in the
 lattice, but if I wanted to do that, I'd have to define my lattice as a
 proper submodule of '''Z'''^n^? I'd view the lattice somewhat analogously
 to an ideal in a multivariate ring, would we want our ideal elements to
 live anywhere but the ring?

 > On a different note: Would it make sense to use `UniqueRepresentation`
 or at least `CachedRepresentation` for lattices? It seems strange to me to
 have a function `Lattice` that does nothing more than hand the arguments
 to the `IntegerLattice` constructor and return the result.

 I don't want to cache my representations or make lattices unique. It is
 useful to have two objects representing the same lattice: one with a good
 basis and one with a bad basis (that's the secret and public key
 respectively in many crypto systems). I'd expect `Lattice` to grow when
 the need arises: lattices over '''Q''', over '''R''', over polynomial
 rings and stuff.

--
Ticket URL: <http://trac.sagemath.org/ticket/15976#comment:7>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to