#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 SimonKing):

 Replying to [comment:7 malb]:
 > 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^?

 There is something called "facade". I didn't try to fully understand it,
 but I think the idea is: If you have the set of prime numbers, then its
 elements are just natural numbers. That's to say, the parent of the
 elements of `Primes()` is `ZZ`, not `Primes()`:
 {{{
 sage: P = Primes()
 sage: p = P.an_element()
 sage: p
 43
 sage: p.parent()
 Integer Ring
 }}}
 This is done by telling that `Primes()` is a "facade set":
 {{{
 sage: P.category()
 Category of facade infinite enumerated sets
 }}}

 Your situation could be similar: You have a lattice `L` in 'RR^n`, and the
 parent of the elements of `L` wouldn't be `L` but `RR^n` (but please not
 `ZZ^n`, since you need the embedding!).

 So, could be that using
 {{{
 sage: Category.join([FacadeSets(),CommutativeAdditiveGroups()])
 Category of facade commutative additive groups
 }}}
 to initialise your lattice's category would suffice.

 > 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?

 No, see above. But for historical reasons, we have
 {{{
 sage: P.<x,y> = QQ[]
 sage: I = P*[x^2+y,y^2+x]
 sage: x^2 in I
 False
 sage: x^2+y in I
 True
 sage: I.category()
 Category of ring ideals in Multivariate Polynomial Ring in x, y over
 Rational Field
 }}}
 without facade. I think today it would be implemented using facades.

 > 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).

 That's why I suggested `CachedRepresentation` rather than
 `UniqueRepresentation`. If you use `CachedRepresentation` than starting
 twice with the same basis yields identical lattices, but starting with
 different bases will yield non-identical lattices that may still be equal.
 Only `UniqueRepresentation` would imply a "comparison by identity".

--
Ticket URL: <http://trac.sagemath.org/ticket/15976#comment:8>
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