#9504: Add support for toric sublattices
----------------------------------+-----------------------------------------
Reporter: novoselt | Owner: mhampton
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.5.2
Component: geometry | Keywords:
Author: Andrey Novoseltsev | Upstream: N/A
Reviewer: | Merged:
Work_issues: quotient lattices |
----------------------------------+-----------------------------------------
Changes (by novoselt):
* status: needs_work => needs_review
Comment:
OK, after thinking some more and actually working on it, I decided to
stick with derivation from FGP_Module. The most important things for now
(i.e. for lattices associated to cones) are quotients of ambient toric
lattices by its saturated submodules and being able to get both lifts of
elements of the quotient to the ambient lattice and coordinates of these
elements in some fixed basis of the quotient. It is also important to fix
creation of quotients and their elements, to avoid code adjustments, and
text representations to avoid doctest adjustments. I hope that the new
patch does address these issues and if we want to add some functionality
or to change implementation later it should not be too difficult.
Creation of elements for free modules works (and does not work) like this:
{{{
sage: Q = ZZ^3 / span([vector([1,2,3])])
sage: Q
Finitely generated module V/W over Integer Ring with invariants (0, 0)
sage: Q(1,2)
TypeError: can't initialize vector from nonzero non-list
sage: Q(1,2,3)
TypeError: __call__() takes at most 3 arguments (4 given)
sage: Q([1,2,3])
TypeError: length of v must be at most the number of rows of self
sage: Q([1,2])
(1, 2)
sage: Q([1])
(1, 0)
sage: Q([])
(0, 0)
}}}
I find most of the above lines counter-intuitive. The same thing for
proposed toric quotients:
{{{
sage: N = ToricLattice(3)
sage: Q = N/N.submodule([N(1,2,3)])
sage: Q(1,2)
TypeError: x must be a list of the right length
sage: Q(1,2,3)
N[1, 2, 3]
sage: Q([1,2,3])
N[1, 2, 3]
sage: Q([1,2])
TypeError: x must be a list of the right length
sage: Q([1])
TypeError: x must be a list of the right length
sage: Q([])
TypeError: x must be a list of the right length
}}}
So, basically, to easily create an element of `Q` one needs to think in
terms of the original ambient lattice `N`. And elements print in terms of
`N` (with "[]" instead of "()"). It is still possible to operate with
generators of `Q` when necessary:
{{{
sage: Q.linear_combination_of_smith_form_gens([1,2])
N[0, 2, 1]
sage: Q(0,2,1)
N[0, 2, 1]
sage: Q(0,2,1).vector()
(1, 2)
}}}
(I don't quite like this `vector` name, but that's what is inherited.)
I have not done any work on dual lattices for sublattices and quotients,
nor on action on their elements. Is it required for #9296? If not, may be
we can proceed and worry about it later (I added it to my growing todo-
list ;-)) However we get for free support of torsion quotients and
iterated constructions:
{{{
sage: subQ = Q.submodule([(3,3,3)])
sage: subQ
1-d lattice, quotient of Sublattice <N(1, 2, 3), N(0, 3, 6)> by Sublattice
<N(1, 2, 3)>
sage: Q/subQ
Torsion quotient of 3-d lattice N by Sublattice <N(1, 2, 3), N(0, 3, 6)>
}}}
I made printing different for torsion and non-torsion quotients. Latexing
is the same, since it does not use words in any of our objects and I don't
see a good "wordless" way to indicate torsion presence.
Bottom line: I am marking this as "needs review" since I hope that patches
are correct and satisfactory for current needs and it is possible to build
missing features on top of them.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9504#comment:11>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.