I then get:

<repr(<sage.matroids.matroid.Matroid at 0x7f414ee8c940>) failed: 
NotImplementedError: subclasses need to impleme
nt this.>

However, as I mentioned above, it makes more sense to use tutte_polynomial 
from Graph in my situation (given that its bug has been fixed).  So my 
problem no longer really exists.

Thanks for the help!


On Thursday, May 14, 2015 at 1:29:36 PM UTC-7, Dima Pasechnik wrote:
>
>
>
> On Thursday, 14 May 2015 21:16:03 UTC+1, David Perkinson wrote:
>>
>> After putting 
>>
>> import sage.matroids.matroid
>>
>
> how about 
>
> from sage.matroids.matroid import 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