Getting an error with .g_algebra() when trying to build a Weyl algebra

20 views
Skip to first unread message

Douglas Weathers

unread,
Feb 17, 2014, 10:34:53 AM2/17/14
to sage-s...@googlegroups.com
The rabbit hole led me to this discussion

https://groups.google.com/forum/#!topic/sage-devel/QoboPuLUmw8

from a couple of years ago, and I see that the ticket

http://trac.sagemath.org/ticket/4539#no1

has been merged into SAGE 5 (I have 6.0). So when I try the example in the Google group I get the following error:

---

sage: F.<x,y,z,dx,dy,dz> = FreeAlgebra(QQ,6)
sage: G = F.g_algebra({dx*x: x*dx + 1, dy*y: y*dy + 1, dz*z: z*dz + 1})
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-10-6517c692228f> in <module>()
----> 1 G = F.g_algebra({dx*x: x*dx + Integer(1), dy*y: y*dy + Integer(1), dz*z: z*dz + Integer(1)})

/opt/sage-6.0-i686-Linux/local/lib/python2.7/site-packages/sage/algebras/free_algebra.pyc in g_algebra(self, relations, names, order, check)
917 base_ring=self.base_ring()
918 n=self.ngens()
--> 919 cmat=Matrix(base_ring,n)
920 dmat=Matrix(self,n)
921 for i in xrange(n):

/opt/sage-6.0-i686-Linux/local/lib/python2.7/site-packages/sage/matrix/constructor.pyc in _matrix_constructor(*args, **kwds)
558 # check to see if the number of rows is specified
559 try:
--> 560 import numpy
561 if isinstance(args[0], numpy.ndarray):
562 raise TypeError

/opt/sage-6.0-i686-Linux/local/lib/python2.7/site-packages/numpy/__init__.py in <module>()
135 return loader(*packages, **options)
136
--> 137 import add_newdocs
138 __all__ = ['add_newdocs']
139

/opt/sage-6.0-i686-Linux/local/lib/python2.7/site-packages/numpy/add_newdocs.py in <module>()
7 # core/fromnumeric.py, core/defmatrix.py up-to-date.
8
----> 9 from numpy.lib import add_newdoc
10
11 ###############################################################################

/opt/sage-6.0-i686-Linux/local/lib/python2.7/site-packages/numpy/lib/__init__.py in <module>()
11
12 import scimath as emath
---> 13 from polynomial import *
14 #import convertcode
15 from utils import *

/opt/sage-6.0-i686-Linux/local/lib/python2.7/site-packages/numpy/lib/polynomial.py in <module>()
9 import re
10 import warnings
---> 11 import numpy.core.numeric as NX
12
13 from numpy.core import isscalar, abs, finfo, atleast_1d, hstack, dot

AttributeError: 'module' object has no attribute 'core'

---

How do I fix this? Thanks!

Dima Pasechnik

unread,
Feb 17, 2014, 4:02:49 PM2/17/14
to sage-s...@googlegroups.com
On 2014-02-17, Douglas Weathers <wdwea...@gmail.com> wrote:
> The rabbit hole led me to this discussion
>
> https://groups.google.com/forum/#!topic/sage-devel/QoboPuLUmw8
>
> from a couple of years ago, and I see that the ticket
>
> http://trac.sagemath.org/ticket/4539#no1
>
> has been merged into SAGE 5 (I have 6.0). So when I try the example in the Google group I get the following error:
>
> ---
>
> sage: F.<x,y,z,dx,dy,dz> = FreeAlgebra(QQ,6)
> sage: G = F.g_algebra({dx*x: x*dx + 1, dy*y: y*dy + 1, dz*z: z*dz + 1})

works for me in Sage 6.1.1


Douglas Weathers

unread,
Feb 18, 2014, 10:36:59 AM2/18/14
to sage-s...@googlegroups.com
Sure does. Thanks!
Reply all
Reply to author
Forward
0 new messages