On Mon, Jul 25, 2011 at 7:09 PM, Mel <chemmyg...@gmail.com> wrote:

> Perhaps I should clarify a couple more things:
>
> I have figured out how to do simple Macaulay 2 commands inside a sage
> script as follows:
>
> macaulay2("S = ZZ/101[t_1 .. t_9, u_1 .. u_9]")
>
> However, many of my commands are not working.


Use the following:

macaulay2.eval("""
    arbitrary block of code
""")

Alternatively, in Sage mode you can put

%macaulay2

at the top of a cell, and the rest of the cell is evaluated in Macaulay2.
It's actually equivalent to just doing macaulay2.eval.


> The code in Macaulay2
> which I would like to execute from sage looks like this:
>
> mult = I -> (
> minPrimes := minimalPrimes I;
> monomialFreeMinPrimes := select(minPrimes, P -> saturate(P, product
> gens S) =!= ideal (1_(ring(I))));
> sum apply(monomialFreeMinPrimes, P -> degree(I : saturate(I,P)))
> )
>
> S = QQ[x,y,z]
> I = ideal(y-x^2, y^2-x*z)
> mult(I)
>
>
> When I try to define the mult function using the macaulay2() command,
> I get a syntax error because of the arrow (->).
>
> macaulay2( mult = I -> ( minPrimes := minimalPrimes I;
> monomialFreeMinPrimes := select(minPrimes, P -> saturate(P, product
> gens S) =!= ideal (1_(ring(I)))); sum apply(monomialFreeMinPrimes, P -
> > degree(I : saturate(I,P))) )
>
> Also, when I type
>
> I=macaulay2(ideal(x^2+y))
>
> I get "error: syntax error at 'of' "
>
>
> Anyway, I know this is a lot of things to ask about, but any help
> would be appreciated.  Thanks!
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to