On Thursday, June 23, 2016 at 5:27:30 PM UTC+1, saad khalid wrote:
>
> This is on the same subject, so I thought I'd ask:
>
> I was trying to use the Sage/M2 interface that Dima had been using, but I 
> couldn't quite get it to work for me. Here is what I was trying to convert 
> to sage:
> macaulay2.eval("""
> K = toField(QQ[zet]/(zet^6 + zet^5 + zet^4 + zet^3 + zet^2 + zet + 1))
> A=matrix{{zet,0,0},{0,zet^3,0},{0,0,zet^2}}
> needsPackage "InvariantRing"
> G=generateGroup({A},K)
> P = molienSeries G
>  """)
>
>
> this works for me.
 

>
> I tried doing 
> G=macaulay2('G').to_sage(); G
>
> A=macaulay2('A').to_sage(); A
>
> P=macaulay2('P').to_sage(); P
>
> Though, I ran them all separately. They all gave me error messages. The 
> last one is the most important to me, just for ease of use(typing out long 
> equations and picking out typos seems to take up a large portion of my 
> time...), and the error I get is that I can not convert Divide to a sage 
> object. 
>

note that you can do this computation (computing Molien series of an 
ordinary representation of a finite group)
using GAP. This would work much faster (in particular in M2's package 
InvariantRing, the generateGroup is extermely inefficiently implemented). 
Although if you are after the ring of invariants itself, then
indeed this would be  the way to go, using M2.

The root of the error you are stuck with seems to be here:

sage: m1=macaulay2('ring numerator P')
sage: m1
ZZ[T, Degrees => {{}}, MonomialOrder => {MonomialSize => 32}, DegreeRank => 
0, Inverses => true, Global => false]
                                        {Weights => {-1}   }
                                        {GroupLex => 1     }
                                        {Position => Up    }
sage: m1.to_sage()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-15-ba2795ae293a> in <module>()
----> 1 m1.to_sage()

/home/dima/software/sage/local/lib/python2.7/site-packages/sage/interfaces/macaulay2.pyc
 
in to_sage(self)
   1101                 # Check that we are dealing with default degrees, 
i.e. 1's.
   1102                 if self.degrees().any("x -> x != {1}").to_sage():
-> 1103                     raise ValueError("cannot convert Macaulay2 
polynomial ring with non-default degrees to Sage")
   1104                 #Handle the term order
   1105                 external_string = self.external_string()

ValueError: cannot convert Macaulay2 polynomial ring with non-default 
degrees to Sage
sage:

probably not so hard to fix. 


> Also, it seems to be that most of the functionality of M2 is not 
> integrated into Sage, in the sense that, to use these functions, you have 
> to run M2 within a sage cell, and then you have to use a function to 
> convert it to a sage object. What is preventing us from just fully 
> integrating all the M2 functions into Sage? Obviously still using M2 as a 
> backend, but just to make the interface between the two cleaner. Is there 
> an actual technical issue in the way, or has no one wanted to do it? 
>

I recently discussed  M2/sage things with M2  devs, in particular with 
Anton Leykin, and this seems to be
doable to use M2  to provide an alternative (to Singular) commutative 
algebra backend.

You can also think about implementing more conversions between M2 and Sage 
objects. Indeed, it's just sheer lack of resources for such a project that 
prevents it from going forward.

Dima


 

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

Reply via email to