I guess that since the bug in the tutte_polynomial method for Graph will be 
fixed in sage 6.7, I don't need to use the Matroid version anyway.


On Thursday, May 14, 2015 at 1:16:03 PM UTC-7, David Perkinson wrote:
>
> After putting 
>
> import sage.matroids.matroid
>
> in sandpile.py and running sage -br, I get the following:
>
> sage: f = Sandpile(graphs.CycleGraph(4),0)
> sage: f.tutte_polynomial()
> ---------------------------------------------------------------------------
> NameError
>                                  Traceback (most recent call last)
> <ipython-input-4-b3a9f7e45f84> in <module>()
> ----> 1 f.tutte_polynomial()
>  
>
> /projects/17e92ec6-3946-4bb0-b10a-44dc6297a1de/sage-6.7.beta4-x86_64-Linux/local/lib/python2.7/site-packages/sag
> e/sandpiles/sandpile.pyc in tutte_polynomial(self)
>    1428         """
>    1429         if self.is_undirected():
> -> 1430             return Matroid(Graph(self)).tutte_polynomial()
>    1431         else:
>    1432             raise UserWarning
> ("The underlying graph must be undirected.")
>  
> NameError: global name 'Matroid' is not defined
>
>
> In the error message you can see the code for the new method I've added to 
> Sandpile.
>
>
> On Thursday, May 14, 2015 at 12:22:32 PM UTC-7, Dima Pasechnik wrote:
>>
>>
>>
>> On Thursday, 14 May 2015 19:32:48 UTC+1, David Perkinson wrote:
>>>
>>> I am working on sandpile.py and would like to use tutte_polynomial from 
>>> sage/matroids/matroid.pyx.  Could someone tell me the correct import 
>>> statement put in sandpile.py?
>>>
>>
>> If you import sage.matroids.matroid you can create a matroid and call its 
>> member function tutt_polynomial? Or do you mean some other use?
>>
>> Dima
>>
>>
>>
>>> Thanks.
>>>
>>

-- 
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/d/optout.

Reply via email to