Ask Your Question

mrambaud's profile - activity

2018-01-15 17:00:25 +0200 received badge  Famous Question (source)
2015-01-13 18:06:44 +0200 received badge  Popular Question (source)
2015-01-13 18:06:44 +0200 received badge  Notable Question (source)
2014-07-20 06:06:39 +0200 received badge  Nice Question (source)
2014-07-18 01:37:24 +0200 received badge  Student (source)
2014-07-17 19:20:25 +0200 received badge  Editor (source)
2014-07-17 19:16:06 +0200 asked a question Cimporting Sage classes with the new Sage IPython notebook

Sage Version 6.2, Release Date: 2014-05-06, Unbuntu 12.04, 64 bit version

Hello,

I am using the new Sage IPython notebook and would like to cimport the class "Matrix_mod2e_dense" in a cython cell.

(1) Here is a minimum working example in the Sage IPython command line (also works on a SageMathCloud terminal), and that I would like to transpose in the Ipython notebook :

 from sage.all import *
 cython("#clang C++\n from sage.matrix.matrix_mod2_dense cimport Matrix_mod2_dense")

(A similar statement works in the old Sage notebook, and also on the SageMathCloud notebook).

(2) And here is a (nearly) minimum non working example in the Sage IPython notebook, nor on a SageMathCloud IPython notebook :

  from sage.all import *
  %load_ext sage
  %load_ext cythonmagic

    %%cython
    #clang C++
    from sage.all import *
    cimport numpy as np
    #It is worth noting that the *cimport numpy* works. But when I add this last statement:
    from sage.matrix.matrix_mod2e_dense cimport Matrix_mod2e_dense

It then says :

.cache/ipython/cython/_cython_magic_9842ede087c20823a43baddf277ba52c.pyx:6:0: 'Matrix_mod2e_dense.pxd' not found

3) So everything leads me to think that it is the cimport command that is badly interpreted by the Ipython Notebook. Does someone has a solution to make (1) work in the Sage Ipython Notebook ? (For instance, what should I add/remove in the cythonmagic.py file ? I couldn't attach mine to this post, but could publish/send in a way or another if this might help)

Finaly, I mention similar posts, but not exactly on the same issue, so which could not help me : http://ask.sagemath.org/question/2575... --- http://ask.sagemath.org/question/2766... --- http://ask.sagemath.org/question/2322... --- http://stackoverflow.com/questions/24...

Thank you for your help !

Matthieu

2014-07-17 19:13:24 +0200 received badge  Teacher (source)
2014-07-17 18:33:12 +0200 answered a question Relations in a polynomial ring

Hello,

One has to come back in the category of schemes :

rays = [(0,0,1),(1,0,-2),(0,1,-2),(-1,0,-2),(0,-1,-2)]
cones = [(1,2,3,4)]
Delta = Fan(cones,rays)
T = ToricVariety(Delta)
R = T.affine_patch(0).Spec().coordinate_ring()

Then, to answer your initial point about retrieving a list of relations :

R.defining_ideal().gens()

(By the way I also tried cohomology ring : it is not implemented for this toric variety, only for orbifold toric varieties so far.)

Matthieu

2014-05-23 16:15:22 +0200 received badge  Supporter (source)