#15325: Highly confusing behavior of RootSystem related objects (lattices and
ambient space)
-----------------------------+-------------------------------
   Reporter:  davidamadore   |            Owner:
       Type:  defect         |           Status:  new
   Priority:  minor          |        Milestone:  sage-5.13
  Component:  combinatorics  |         Keywords:  root-system
  Merged in:                 |          Authors:
  Reviewers:                 |  Report Upstream:  N/A
Work issues:                 |           Branch:
     Commit:                 |     Dependencies:
   Stopgaps:                 |
-----------------------------+-------------------------------
 I'm not sure to what extent the following behavior is deliberate or simply
 unavoidable, so maybe this bug report should be reclassified as bad
 documentation.  Also, I'm not sure whether I should be filing several
 different bug reports (but I do believe the issues I raise are very
 closely related).

 My main issue is that for mathematicians who are used to thinking of the
 weight lattice of a root system living inside of the root lattice, itself
 living inside some common euclidean ambient space (which, I think, is
 standard practice), Sage's behavior is mind-boggingly confusing, if not
 outright insane.

 Exhibit A (shows that elements of the root lattice and its ambient space,
 while comparing for equality, behave very differently when it comes to
 scalar product):

 {{{
 sage: rt = RootSystem(['E',8])
 sage: lat = rt.root_lattice()
 sage: spc = rt.ambient_space()
 sage: lat.simple_root(1) == spc.simple_root(1)
 True
 sage: lat.simple_coroot(2) == spc.simple_coroot(2)
 True
 sage: lat.simple_root(1).scalar(lat.simple_coroot(2))
 0
 sage: spc.simple_root(1).scalar(spc.simple_coroot(2))
 0
 sage: spc.simple_root(1).scalar(lat.simple_coroot(2))
 -1/2
 sage: lat.simple_root(1).scalar(spc.simple_coroot(2))
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-9-61492d33e12b> in <module>()
 ----> 1 lat.simple_root(Integer(1)).scalar(spc.simple_coroot(Integer(2)))

 /work/sage-5.12/local/lib/python2.7/site-
 packages/sage/combinat/root_system/root_space.pyc in scalar(self,
 lambdacheck)
     245         # Find some better test
     246         if not (lambdacheck in self.parent().coroot_lattice() or
 lambdacheck in self.parent().coroot_space()):
 --> 247             raise TypeError, "%s is not in a coroot
 lattice/space"%(lambdacheck)
     248         zero = self.parent().base_ring().zero()
     249         cartan_matrix = self.parent().dynkin_diagram()

 TypeError: (1, 1, 0, 0, 0, 0, 0, 0) is not in a coroot lattice/space
 }}}

 Exhibit B (shows that Sage does not consider the root lattice as living
 inside the weight lattice):

 {{{
 sage: rt = RootSystem(['E',8])
 sage: wlat = rt.weight_lattice()
 sage: lat = rt.root_lattice()
 sage: wlat.simple_root(1) == lat.simple_root(1)
 True
 sage: lat.simple_root(1) in lat
 True
 sage: wlat.simple_root(1) in lat
 False
 }}}

 Exhibit C (shows how confusing the embedding of the weight lattice in the
 ambient space is):

 {{{
 sage: rt = RootSystem(['A',2])
 sage: wlat = rt.weight_lattice()
 sage: lat = rt.root_lattice()
 sage: spc = rt.ambient_space()
 sage: lat.simple_root(2) == wlat.simple_root(2)
 True
 sage: spc.simple_root(2)
 (0, 1, -1)
 sage: spc(lat.simple_root(2))
 (0, 1, -1)
 sage: spc(wlat.simple_root(2))
 (1, 2, 0)
 }}}

 I'm not sure how all of this should be fixed, but certainly when x==y
 returns True then x and y should have a very similar behavior, and in
 particular x in y.parent() should also return True.

--
Ticket URL: <http://trac.sagemath.org/ticket/15325>
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/groups/opt_out.

Reply via email to