On Monday, July 15, 2013 3:09:29 PM UTC-7, Volker Braun wrote:
>
> That is correct. The change_ring() methods in Sage return a new object and 
> do _not_ modify the original object:


Fair enough.  I think we have found a true coercion problem involving 
finite fields & toric varieties, though.  This one arises when constructing 
anticanonical hypersurfaces in a Fano toric variety with coefficients in a 
finite field.

Let's make a smooth Fano toric variety over a finite field of non-prime 
order:

o = lattice_polytope.octahedron(3)
cube = o.polar()
VRes = CPRFanoToricVariety(Delta_polar=cube, coordinate_points="all")
field = GF(5^2, 'a')
X=VRes.change_ring(field)

Then let's define a hypersurface with coefficients specified by a list of 
elements in our field:

hyp = X.anticanonical_hypersurface(monomial_points="vertices+origin", 
coefficients=[field(1),field(1),field(1),field(1),field(1),field(1),field(3)])

This raises a type error:

Error in lines 6-6 Traceback (most recent call last): File 
"/mnt/home/7tQIE6sJ/.sagemathcloud/sage_server.py", line 494, in execute 
exec compile(block+'\n', '', 'single') in namespace, locals File "", line 
1, in <module> File 
"/mnt/home/7tQIE6sJ/sage-5.10-linux-64bit-ubuntu_12.04.2_lts-x86_64-Linux/local/lib/python2.7/site-packages/sage/schemes/toric/fano_variety.py",
 
line 905, in anticanonical_hypersurface return 
AnticanonicalHypersurface(self, **kwds) File 
"/mnt/home/7tQIE6sJ/sage-5.10-linux-64bit-ubuntu_12.04.2_lts-x86_64-Linux/local/lib/python2.7/site-packages/sage/schemes/toric/fano_variety.py",
 
line 1438, in __init__ for m, coef in zip(monomial_points, coefficients)) 
File 
"/mnt/home/7tQIE6sJ/sage-5.10-linux-64bit-ubuntu_12.04.2_lts-x86_64-Linux/local/lib/python2.7/site-packages/sage/schemes/toric/fano_variety.py",
 
line 1432, in <genexpr> coefficients = (F(SR(coef)) for coef in 
coefficients) File "parent.pyx", line 961, in 
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:8136) File 
"coerce_maps.pyx", line 82, in 
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
(sage/structure/coerce_maps.c:3856) File "coerce_maps.pyx", line 77, in 
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
(sage/structure/coerce_maps.c:3757) File 
"/mnt/home/7tQIE6sJ/sage-5.10-linux-64bit-ubuntu_12.04.2_lts-x86_64-Linux/local/lib/python2.7/site-packages/sage/rings/finite_rings/finite_field_givaro.py",
 
line 362, in _element_constructor_ return self._cache.element_from_data(e) 
File "element_givaro.pyx", line 377, in 
sage.rings.finite_rings.element_givaro.Cache_givaro.element_from_data 
(sage/rings/finite_rings/element_givaro.cpp:6428) File 
"element_givaro.pyx", line 490, in 
sage.rings.finite_rings.element_givaro.Cache_givaro.element_from_data 
(sage/rings/finite_rings/element_givaro.cpp:6126) TypeError: unable to 
coerce

We suspect the problematic coercion comes from this line in the 
AnticanonicalHypersurface class:

# Direct conversion "a/b" to F does not work in Sage-4.6.alpha3,
# so we go through SR, even though it is quite slow.
coefficients = (F(SR(coef)) for coef in coefficients)

--Ursula.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to