[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread leif
saad khalid wrote:
> Sorry! I hadn't seen that, that's great, thank you! The denominator is
> proving to be a bit tricky to deal with, mostly because I can't decide
> what I want to do with it. I did it though, but I'm not happy with it.
> I'm also an amatuer at regex(this is the first time I've used it, I
> figured it was about time I started learning now). But, I Think it
> should work? So, I made another method named sage_prodstring that does a
> similar job to sage_polystring. Here is the code for it:
> 
> |
> defsage_prodstring(self):
> """
> If this Macaulay2 element is a Product, return a string
> representation of this Product that is suitable for
> evaluation in Python. Needed internally for using to_sage on
> objects of class Divide.
> 
> EXAMPLES::
> 
> 
> """
> external_string =self.external_String()
> prod_String =re.findall("new Power from
> \{(.+?),(.+?)\}",external_string)
> final_Prod =""
> fori inrange(0,len(prod_String)):
> final_Prod +="("+prod_String[i][0]+")"+'^'+prod_String[i][1]+"*"
> final_Prod =final_Prod[:-1]
> returnfinal_Prod
> |

Side note:  Never use += on a string in a loop.  Here it's even worse,
since you are concatenating strings on the right hand side as well.

Hint:  "*".join(["alpha","beta","gamma"]) gives 'alpha*beta*gamma' for
example.

In your case the list to join is something like

  [ "(%s)^%s" % (f[0], f[1]) for f in prod_String ]

so you could replace the five last lines by

   return "*".join( [ "(%s)^%s" % (f[0], f[1]) for f in prod_String ] )


(Haven't tested that, your EXAMPLES or TESTS should do though...)


-leif


> I don't really know what to put in the Examples part. If you have any
> recommendations, I'd love to know. Also, I feel like this implementation
> is inneficient, since it first runs external_string, which is a Sage
> method that parses Macaulay's ascii art into a str, and then my method
> parses that str into something that you could actually use as python
> code. I feel like, ideally, I wouldn't need to run external_string, and
> could directly convert the ascii output from macaulay directly into the
> python code output I wanted, but i couldn't figure out exactly how to do
> that... I hope this is okay. I don't think i can test it yet until I
> fill in the spot for the Example though.
> 
> I then used this method in the to_sage() function for the denominator,
> as seen here:
> 
> |
> elifcls_str =="Divide":
> div_Numerator =self.numerator()
> div_Denominator =self.denominator()
> div_Numerator =div_Numerator.sage_polystring()
> div_Denominator =div_Denominator.sage_prodstring()
> sage_Div ="("+ div_Numerator ")"+"/"+"("+div_Denominator
> +")"
> returnsage_Div
> |
> 
> How does it look? Thanks for all the help thus far.


-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread saad khalid
So, after fixing a small typo, here is the output from an example:

sage: macaulay2.eval("""
: K = toField(QQ[zet]/(zet^8 - zet^7 +zet^5 - zet^4 +zet^3 -zet + 1))
: A=matrix{{zet^1,0},{0,zet^14}}
: needsPackage "InvariantRing"
: G=generateGroup({A},K)
: P = molienSeries G
:  """)

sage: macaulay2('P').to_sage()


'(1-T+T**2-T**3+T**4-T**5+T**6-T**7+T**8-T**9+T**10-T**11+T**12-T**13+T**14)/((1-T)^2*(1-T+T^3-T^4+T^5-T^7+T^8)^1*(1+T+T^2)^1*(1+T+T^2+T^3+T^4)^1)'


That's the output from the last command, anyways. Now, what I don't 
understand is how to make it into like... a function, or a Sage object or 
something like that. Like, I'd want to be able to compute its Taylor series 
just by doing something like "macaulay2('P').to_sage().taylor()" or 
something, but I'm not sure how to convert the string. 

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread saad khalid
So, after fixing a small typo, here is the output from an example:

sage: macaulay2.eval("""
: K = toField(QQ[zet]/(zet^8 - zet^7 +zet^5 - zet^4 +zet^3 -zet + 1))
: A=matrix{{zet^1,0},{0,zet^14}}
: needsPackage "InvariantRing"
: G=generateGroup({A},K)
: P = molienSeries G
:  """)
sage: macaulay2('P').to_sage()


'(1-T+T**2-T**3+T**4-T**5+T**6-T**7+T**8-T**9+T**10-T**11+T**12-T**13+T**14)/((1-T)^2*(1-T+T^3-T^4+T^5-T^7+T^8)^1*(1+T+T^2)^1*(1+T+T^2+T^3+T^4)^1)'


That's the output from the last command, anyways. 

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: make giac/giacpy a standard package

2016-07-03 Thread François Bissey

So I have been inspecting giac, as any discussion of making something
a standard package as an impact for sage-on-gentoo.
We have an old version in the science overlay so I am working on
upgrading it.

1) current 1.2.2-63 and a few earlier versions need the gui, compiling
with "--disable-gui" is broken.
2) the dependency on libao was making me curious so I investigated.
It is an "automagic" dependency. There is a line
AC_CHECK_LIB(ao, main)
in configure.in and the library can be used in src/maple.cc.
What this means is that if you build sage binary on a machine that
has libao, giac will be broken when the binary is installed on
machines without it. So this has to be fixed when giac becomes
standard.
3) lapack can be used but detection is strange and it could lead to
similar pitfalls than libao if the right files are present on the build 
system. It currently cannot pick up sage's lapack. It is a default

configure option.

I haven't gone through giacpy yet, but I don't like the fact there
is a sage specific version. Something could be done to only have one
source if my understanding of the issues and solution are correct.

Francois

--
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread saad khalid
Sorry! I hadn't seen that, that's great, thank you! The denominator is 
proving to be a bit tricky to deal with, mostly because I can't decide what 
I want to do with it. I did it though, but I'm not happy with it. I'm also 
an amatuer at regex(this is the first time I've used it, I figured it was 
about time I started learning now). But, I Think it should work? So, I made 
another method named sage_prodstring that does a similar job to 
sage_polystring. Here is the code for it:

def sage_prodstring(self):
"""
If this Macaulay2 element is a Product, return a string
representation of this Product that is suitable for
evaluation in Python. Needed internally for using to_sage on 
objects of class Divide. 

EXAMPLES::


"""
external_string = self.external_String()
prod_String = re.findall("new Power from \{(.+?),(.+?)\}", 
external_string)
final_Prod = ""
for i in range(0, len(prod_String)):
final_Prod += "(" + prod_String[i][0] + ")" + '^' + prod_String[i][1
] + "*"
final_Prod = final_Prod[:-1]
return final_Prod

I don't really know what to put in the Examples part. If you have any 
recommendations, I'd love to know. Also, I feel like this implementation is 
inneficient, since it first runs external_string, which is a Sage method 
that parses Macaulay's ascii art into a str, and then my method parses that 
str into something that you could actually use as python code. I feel like, 
ideally, I wouldn't need to run external_string, and could directly convert 
the ascii output from macaulay directly into the python code output I 
wanted, but i couldn't figure out exactly how to do that... I hope this is 
okay. I don't think i can test it yet until I fill in the spot for the 
Example though. 

I then used this method in the to_sage() function for the denominator, as 
seen here:

elif cls_str == "Divide":
div_Numerator = self.numerator()
div_Denominator = self.denominator()
div_Numerator = div_Numerator.sage_polystring()
div_Denominator = div_Denominator.sage_prodstring()
sage_Div = "(" +  div_Numerator ")" + "/" + "(" + 
div_Denominator + ")"
return sage_Div

How does it look? Thanks for all the help thus far.

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Dedicated group for SageMathCell

2016-07-03 Thread Andrey Novoseltsev
The group https://groups.google.com/forum/#!forum/sage-cell will now be 
used for important announcements regarding SageMathCell, issue reporting 
and any other relevant discussions. If you actively use SageMathCell and 
especially if you maintain web pages with embedded cells, please subscribe 
to it and detect/report regressions before your readers!

Thank you,
Andrey

P.S. I have already mentioned this group before, but it was rightly pointed 
out to me that the end of a long thread is not the best place for 
announcement.

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: make giac/giacpy a standard package

2016-07-03 Thread Han Frederic


Le samedi 2 juillet 2016 13:30:35 UTC+2, leif a écrit :
>
> leif wrote: 
> > Ralf Stephan wrote: 
> >> On Wednesday, June 1, 2016 at 10:00:34 AM UTC+2, Ralf Stephan wrote: 
> >> 
> >> The giac and giacpy packages are now one year optional (#12375). 
> Since 
> >> pynac-0.6.6 (#20742) has optional support for giac, and uses it to 
> >> fix a bug, 
> >> as well as a much faster GCD, I'm proposing to make the giac/giacpy 
> >> packages 
> >> a standard part of Sage. In a recent thread we could also read 
> about the 
> >> speed of its Gröbner basis implementation. 
> >> 
> >> 
> >> There were no negative arguments to this. Also meanwhile, a standard 
> >> installation 
> >> would ease Pynac's task of handling potentially different libgiac 
> versions 
> >> with different needs that may be installed system-wide. 
> >> 
> >> So what would be the next step in this procedure? 
> > 
> > Strip the latest version offered by Sage? ;-) 
> > 
> > 12Mgiac-1.2.0.19.tar.gz 
> > 44Mgiac-1.2.2.37.tar.gz 
> > 41Kgiacpy-0.5.6.tar.gz 
> > 
> > Haven't examined why it has grown by 300% in a minor version update 
> though. 
>
> There's at least 
>
> 28Mgiac-1.2.2.37/src/javagiac_linux32.tgz 
> 394Kgiac-1.2.2.37/src/javagiac_linux64.tgz 
> 28Mtotal 
>
> which we certainly don't have to ship, 
>

Yes these binaries were left in upstream 1.2.2-37 source tarball, but it is 
a mistake. I didn't notice this when I made the 1.2.2.37 spkg but the next 
spkg won't have this. I should update it soon.


For windows performance I can only test through virtual box, so it is not 
very significant. 

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: {trac,git}.sagemath.org downtime Wednesday 6/22

2016-07-03 Thread leif
Erik Bray wrote:
> git and trac should both be back up again.
> 
> [...]
> 
> Please let me know via e-mail, and also CC
> sagemath-adm...@googlegroups.com if you notice something amiss.

Not that important, so I'm posting here:

What happened to our Trac WikiProcessors [1] (aka syntax highlighting)?

I recall there was some issue displaying /git/ diffs which is fixed now,
but while '#!diff' works on trac pages, e.g. '#!sh' and '#!python' do no
longer work.


-leif

[1] https://trac.sagemath.org/wiki/WikiProcessors#AvailableProcessors


-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread Dima Pasechnik
as I just posted, you can apply M2 functions to self.
self is of M2 type Divide, and so you can do

self.numerator()

etc.

On Sunday, July 3, 2016 at 5:41:46 PM UTC+1, saad khalid wrote:
>
> Hmm, so I tried this instead but it also didn't work and gave a similar 
> error:
>
> elif cls_str == "Divide":
> div_Str = repr_str
> div_Numerator = macaulay2('numerator div_Str')
> div_Denominator = macaulay2('denominator div_Str')
> div_Numerator = div_Numerator.sage_polystring()
> div_Denominator = div_Denominator.sage_polystring()
> sage_Div = div_Numerator/div_Denominator
> return sage_Div
>
>
> I guess I don't understand what each of those variables contains... What 
> is self in this situation? I thought that self would be the Divide object, 
> since that is what's being passed to the to_sage function. But when that 
> didn't work, i assumed that repr_str would contain the string of the Divide 
> object, but that's also not working.
>

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread saad khalid
Hmm, so I tried this instead but it also didn't work and gave a similar 
error:

elif cls_str == "Divide":
div_Str = repr_str
div_Numerator = macaulay2('numerator div_Str')
div_Denominator = macaulay2('denominator div_Str')
div_Numerator = div_Numerator.sage_polystring()
div_Denominator = div_Denominator.sage_polystring()
sage_Div = div_Numerator/div_Denominator
return sage_Div


I guess I don't understand what each of those variables contains... What is 
self in this situation? I thought that self would be the Divide object, 
since that is what's being passed to the to_sage function. But when that 
didn't work, i assumed that repr_str would contain the string of the Divide 
object, but that's also not working.

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread Dima Pasechnik


On Sunday, July 3, 2016 at 11:05:06 AM UTC+1, Dima Pasechnik wrote:
>
>
>
> On Sunday, July 3, 2016 at 1:21:18 AM UTC+1, saad khalid wrote:
>>
>> Well, here's what i tried and it doesn't seem to work after I build sage 
>> again. I added this code to the to_sage() function, 
>> elif cls_str == "Divide":
>> self_Div = self
>> div_Numerator = macaulay2('numerator self_Div')
>> div_Denominator = macaulay2('denominator self_Div')
>> div_Numerator = div_Numerator.sage_polystring()
>> div_Denominator = div_Denominator.sage_polystring()
>> sage_Div = div_Numerator/div_Denominator
>> return sage_Div
>>
>>  
>>
> self_Div is not known to M2 in any way, yet you try calling in M2 
> 'numerator self_Div'.
> You need a way to get the counterpart of 'self' in M2 somehow.
>

Instead of

   self_Div = self
div_Numerator = macaulay2('numerator self_Div')
div_Denominator = macaulay2('denominator self_Div')
 
use

div_Numerator = self.numerator()
div_Denominator = self.denominator()

and it will be almost it (div_Denominator will be Product, and will need 
extra processing
because of this)
 

>
> I added this after the main else statement. The code looks like rubbish to 
>> me but I didn't know what else to do, so i thought I'd show something and 
>> ask for improvements, if that's okay... When running the following code now 
>> in Sage, here is my error message:
>>
>> sage: macaulay2.eval("""
>> : K = toField(QQ[zet]/(zet^8 - zet^7 +zet^5 - zet^4 +zet^3 -zet + 1))
>> : A=matrix{{zet^1,0},{0,zet^14}}
>> : needsPackage "InvariantRing"
>> : G=generateGroup({A},K)
>> : P = molienSeries G
>> :  """)
>> K
>>
>> PolynomialRing
>>
>> | zet 0|
>> | 0   -zet^7+zet^6-zet^4+zet^3-zet^2+1 |
>>
>> 2   2
>> Matrix K  <--- K
>>
>> InvariantRing
>>
>> Package
>>
>> {| 1 0 |, | -zet^7-zet^2 0 |, | zet^7 0 
>> |, | zet^7-zet^6-zet^3+zet^2-1 0 |, | -zet^7+zet^6-zet^4+zet^3-zet^2+
>> 1 0   |, | zet 0|, | -zet^6-zet 0 |, 
>> | zet^5 0|, | zet^2 0|, | zet^6 0   
>>   |, | zet^7-zet^5+zet^4-zet^3+zet-1 0 |, | zet^4 0 
>>  |, | -zet^7+zet^5-zet^4-zet+1 0 |, | zet^3 0|, | 
>> -zet^5-1 0 |}
>>  | 0 1 |  | 0zet^3 |  | 0 zet^7-zet^5+zet^4-zet^3+zet-1 | 
>>  | 0 zet^6 |  | 0   
>>  zet |  | 0   -zet^7+zet^6-zet^4+zet^3-zet^2+1 |  | 0  zet^4 |  | 
>> 0 -zet^5-1 |  | 0 -zet^7+zet^5-zet^4-zet+1 |  | 0 zet^7-zet^6
>> -zet^3+zet^2-1 |  | 0 zet^7 |  | 0 -zet^6
>> -zet |  | 0zet^2 |  | 0 -zet^7-zet^2 |  | 0 
>>zet^5 |
>>
>> List
>>
>>  2345678910111213
>> 14
>> 1 - T + T  - T  + T  - T  + T  - T  + T  - T  + T   - T   + T   - T   + T
>>
>> ---
>> 2  34578   2   23
>> 4
>>  (1 - T) (1 - T + T  - T  + T  - T  + T )(1 + T + T )(1 + T + T  + T  + 
>> T )
>>
>> Expression of class Divide
>>
>> sage: G = macaulay2('P').to_sage()
>>
>> ---
>> TypeError Traceback (most recent call 
>> last)
>> /home/saad/sage/local/lib/python2.7/site-packages/sage/all_cmdline.pyc in 
>> ()
>> > 1 G = macaulay2('P').to_sage()
>>
>> /home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/
>> macaulay2.pyc in to_sage(self)
>>1151 elif cls_str == "Divide":
>>1152 self_Div = self
>> -> 1153 div_Numerator = macaulay2('numerator self_Div')
>>1154 div_Denominator = macaulay2('denominator 
>> self_Div')
>>1155 div_Numerator = div_Numerator.sage_polystring()
>>
>> /home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/
>> interface.pyc in __call__(self, x, name)
>> 241 
>> 242 if isinstance(x, six.string_types):
>> --> 243 return cls(self, x, name=name)
>> 244 try:
>> 245 return self._coerce_from_special_method(x)
>>
>> /home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
>> in __init__(self, parent, value, is_name, name)
>>1379 except (RuntimeError, ValueError) as x:
>>1380 self._session_number = -1
>> -> 1381 raise_(TypeError, x, sys.exc_info()[2])
>>1382 except BaseException:
>>1383 self._session_number = -1
>>
>> 

[sage-devel] sage 7.7 on raspberry pi3 + pidrive.

2016-07-03 Thread Thierry Dumont

For the fun, I have installed Sage 7.2 on my Raspberry 3 (on the pidrive).
Everything went well, except that I was unable to use the 4 cores for
compilation: there was not enough memory at some point.

So, using 1 core, it took a bit more than 12 hours... :-) But eveything
seems ok (yes, I will do the tests).

I have redone all the benchmarks of
http://www.sagemath.org/tour-benchmarks.html

You can find the results (both on a core I5 and on the Rpi3 ) here:
http://math.univ-lyon1.fr/homes-www/tdumont/benchs/i5vsrpi3/bench.pdf

The benchmarks results of http://www.sagemath.org/tour-benchmarks.html
are a bit outdated...

Depending on the benchmark, the Pi3 is 11 to 72 times slower than the
Core I5

yours
t.d.

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
<>

[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread Dima Pasechnik


On Sunday, July 3, 2016 at 1:21:18 AM UTC+1, saad khalid wrote:
>
> Well, here's what i tried and it doesn't seem to work after I build sage 
> again. I added this code to the to_sage() function, 
> elif cls_str == "Divide":
> self_Div = self
> div_Numerator = macaulay2('numerator self_Div')
> div_Denominator = macaulay2('denominator self_Div')
> div_Numerator = div_Numerator.sage_polystring()
> div_Denominator = div_Denominator.sage_polystring()
> sage_Div = div_Numerator/div_Denominator
> return sage_Div
>
>  
>
self_Div is not known to M2 in any way, yet you try calling in M2 
'numerator self_Div'.
You need a way to get the counterpart of 'self' in M2 somehow.

I added this after the main else statement. The code looks like rubbish to 
> me but I didn't know what else to do, so i thought I'd show something and 
> ask for improvements, if that's okay... When running the following code now 
> in Sage, here is my error message:
>
> sage: macaulay2.eval("""
> : K = toField(QQ[zet]/(zet^8 - zet^7 +zet^5 - zet^4 +zet^3 -zet + 1))
> : A=matrix{{zet^1,0},{0,zet^14}}
> : needsPackage "InvariantRing"
> : G=generateGroup({A},K)
> : P = molienSeries G
> :  """)
> K
>
> PolynomialRing
>
> | zet 0|
> | 0   -zet^7+zet^6-zet^4+zet^3-zet^2+1 |
>
> 2   2
> Matrix K  <--- K
>
> InvariantRing
>
> Package
>
> {| 1 0 |, | -zet^7-zet^2 0 |, | zet^7 0 |, 
> | zet^7-zet^6-zet^3+zet^2-1 0 |, | -zet^7+zet^6-zet^4+zet^3-zet^2+1 0 
>   |, | zet 0|, | -zet^6-zet 0 |, | zet
> ^5 0|, | zet^2 0|, | zet^6 0 
> |, | zet^7-zet^5+zet^4-zet^3+zet-1 0 |, | zet^4 0 
>  |, | -zet^7+zet^5-zet^4-zet+1 0 |, | zet^3 0|, | -zet^5-1 
> 0 |}
>  | 0 1 |  | 0zet^3 |  | 0 zet^7-zet^5+zet^4-zet^3+zet-1 | 
>  | 0 zet^6 |  | 0   
>  zet |  | 0   -zet^7+zet^6-zet^4+zet^3-zet^2+1 |  | 0  zet^4 |  | 
> 0 -zet^5-1 |  | 0 -zet^7+zet^5-zet^4-zet+1 |  | 0 zet^7-zet^6-
> zet^3+zet^2-1 |  | 0 zet^7 |  | 0 -zet^6-zet 
> |  | 0zet^2 |  | 0 -zet^7-zet^2 |  | 0   
>  zet^5 |
>
> List
>
>  2345678910111213
> 14
> 1 - T + T  - T  + T  - T  + T  - T  + T  - T  + T   - T   + T   - T   + T
> ---
> 2  34578   2   234
>  (1 - T) (1 - T + T  - T  + T  - T  + T )(1 + T + T )(1 + T + T  + T  + T 
> )
>
> Expression of class Divide
>
> sage: G = macaulay2('P').to_sage()
> ---
> TypeError Traceback (most recent call last
> )
> /home/saad/sage/local/lib/python2.7/site-packages/sage/all_cmdline.pyc in 
> ()
> > 1 G = macaulay2('P').to_sage()
>
> /home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/
> macaulay2.pyc in to_sage(self)
>1151 elif cls_str == "Divide":
>1152 self_Div = self
> -> 1153 div_Numerator = macaulay2('numerator self_Div')
>1154 div_Denominator = macaulay2('denominator self_Div'
> )
>1155 div_Numerator = div_Numerator.sage_polystring()
>
> /home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/
> interface.pyc in __call__(self, x, name)
> 241 
> 242 if isinstance(x, six.string_types):
> --> 243 return cls(self, x, name=name)
> 244 try:
> 245 return self._coerce_from_special_method(x)
>
> /home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
> in __init__(self, parent, value, is_name, name)
>1379 except (RuntimeError, ValueError) as x:
>1380 self._session_number = -1
> -> 1381 raise_(TypeError, x, sys.exc_info()[2])
>1382 except BaseException:
>1383 self._session_number = -1
>
> /home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
> in __init__(self, parent, value, is_name, name)
>1374 else:
>1375 try:
> -> 1376 self._name = parent._create(value, name=name)
>1377 # Convert ValueError and RuntimeError to TypeError for
>1378 # coercion to work properly.
>
> /home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/
> interface.pyc in _create(self, value, name)
> 431 def _create(self, value, name=None):
> 432 name = self._next_var_name() if name is None else name
> --> 433