#10793: FanMorphism defined by matrices are dangerous
----------------------------------+-----------------------------------------
Reporter: vbraun | Owner: AlexGhitza
Type: PLEASE CHANGE | Status: new
Priority: major | Milestone: sage-4.6.2
Component: algebraic geometry | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
----------------------------------+-----------------------------------------
Here I use a projection matrix to map a 3d cone to a 2d cone:
{{{
sage: projection = matrix(ZZ,[[1,0,0],[0,1,0]])
sage: projection
[1 0 0]
[0 1 0]
sage: cone3d = Cone([(1,0,0),(0,1,0)])
sage: cone2d = Cone([ projection*r for r in cone3d.rays() ])
sage: cone2d.rays()
(N(0, 1), N(1, 0))
}}}
If you use the same matrix in `FanMorphism`, you get an unexpected result:
{{{
sage: FanMorphism( projection, Fan([cone3d]), Fan([cone2d]) )
Fan morphism defined by the matrix
[1 0]
[0 0]
[1 0]
Domain fan: Rational polyhedral fan in 3-d lattice N
Codomain fan: Rational polyhedral fan in 2-d lattice N
}}}
Sharp eyes reveal that the matrix is not the one I wanted; I understand
that Sage expects a left matrix action. But having gotten a matrix of the
wrong shape, no error is produced. Only a nonsensical output? Expected
behavior would be an error, stating that the matrix dimensions do not
match.
For reference, the correct way to construct the morphism is with the
transposed matrix.
{{{
sage: FanMorphism( projection.transpose(), Fan([cone3d]), Fan([cone2d]) )
Fan morphism defined by the matrix
[1 0]
[0 1]
[0 0]
Domain fan: Rational polyhedral fan in 3-d lattice N
Codomain fan: Rational polyhedral fan in 2-d lattice N
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10793>
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.