Some help needed with a doctest in geometry/cone.py

22 views
Skip to first unread message

Nathann Cohen

unread,
Dec 2, 2012, 7:53:30 AM12/2/12
to Sage devel
Helloooooooooo everybody !!!!

I am trying to write a patch (#13747) that changes the default nehaviour of Poset, and I usually do so by updating the code when it is possible. I am very lucky for the 99999 doctests which I broke with my patch could actually be fixed by removing a few things from the code ( replacing x.element by x, which is the most natural thing to do ), but I still have a problem with some doctests whose output changed.

In some cases I changed the doctests, for they returned a list of guys whose ordering changed in the new output (you can expect that too), but I am left with 4 broken doctests and no idea whether their output makes sense of not... That's why I would be glad if somebody could tell me whether there is a problem with the following :

(Before applying #13747)

sage: rho = Cone([(1,1,1,3),(1,-1,1,3),(-1,-1,1,3),(-1,1,1,3)])
sage: rho.orthogonal_sublattice()
Sublattice <M(0, 0, 3, -1)>
sage: sigma = rho.facets()[1]
sage: sigma.orthogonal_sublattice()
Sublattice <M(0, 1, 1, 0), M(0, 3, 0, 1)>
sage: sigma.is_face_of(rho)
True
sage: Q = sigma.relative_orthogonal_quotient(rho); Q                                                                                                 
1-d lattice, quotient
of Sublattice <M(0, 1, 1, 0), M(0, 3, 0, 1)>
by Sublattice <M(0, 0, 3, -1)>
sage: Q.gens()
(M[0, 1, 1, 0],)

(After applying #13747)

sage: rho = Cone([(1,1,1,3),(1,-1,1,3),(-1,-1,1,3),(-1,1,1,3)])
sage: rho.orthogonal_sublattice()
Sublattice <M(0, 0, 3, -1)>
sage: sigma = rho.facets()[1]
sage: sigma.orthogonal_sublattice()
Sublattice <M(-1, 0, 1, 0), M(-3, 0, 0, 1)>
sage: sigma.is_face_of(rho)
True
sage: Q = sigma.relative_orthogonal_quotient(rho); Q
1-d lattice, quotient of Sublattice <M(-1, 0, 1, 0), M(-3, 0, 0, 1)> by Sublattice <M(0, 0, 3, -1)>
sage: Q.gens()
(M[-1, 0, 1, 0],)

(it looks to me that whenever coordinates are given, the first two are inverted and the first one get negated)

Thank you for your help ! :-)

Nathann

Volker Braun

unread,
Dec 2, 2012, 8:37:18 AM12/2/12
to sage-...@googlegroups.com
I take it the order of facets charged in this call:

sage: sigma = rho.facets()[1]

The previous facet must be 0, 2, or 3. If you pick the right index then the remaining doctests should be unchanged.

Nathann Cohen

unread,
Dec 2, 2012, 8:41:07 AM12/2/12
to sage-...@googlegroups.com
> I take it the order of facets charged in this call:

Ahahahaahahah !! Stupid me. Yes, of course. I'll give it a try :-)

Nathann

Nathann Cohen

unread,
Dec 2, 2012, 8:48:11 AM12/2/12
to sage-...@googlegroups.com
Well, it was [2].

The patch is now ready for a review :-)

Thanks !

Nathann
Reply all
Reply to author
Forward
0 new messages