diff -r 02bd6ab343a2 sage/rings/polynomial/plural.pxd
--- a/sage/rings/polynomial/plural.pxd	Wed Jul 21 12:21:55 2010 +0200
+++ b/sage/rings/polynomial/plural.pxd	Wed Jul 21 17:34:06 2010 +0200
@@ -1,16 +1,21 @@
 include "../../libs/singular/singular-cdefs.pxi"
 
 from sage.rings.ring cimport Ring
-from sage.structure.element cimport RingElement
+from sage.structure.element cimport RingElement, Element
+from sage.structure.parent cimport Parent
 from sage.libs.singular.function cimport RingWrap
 from sage.rings.polynomial.multi_polynomial_libsingular cimport MPolynomialRing_libsingular 
 
 
 cdef class NCPolynomialRing_plural(Ring):
     cdef object __ngens
+    cdef object _c
+    cdef object _d
     cdef object __term_order
     cdef public object _has_singular
     cdef public object _magma_gens, _magma_cache
+#    cdef _richcmp_c_impl(left, Parent right, int op)
+    cdef int _cmp_c_impl(left, Parent right) except -2
     
     cdef ring *_ring
 #    cdef NCPolynomial_plural _one_element
diff -r 02bd6ab343a2 sage/rings/polynomial/plural.pyx
--- a/sage/rings/polynomial/plural.pyx	Wed Jul 21 12:21:55 2010 +0200
+++ b/sage/rings/polynomial/plural.pyx	Wed Jul 21 17:34:06 2010 +0200
@@ -33,6 +33,7 @@
 cdef class NCPolynomialRing_plural(Ring):
     def __init__(self, base_ring, n, names, c, d, order='degrevlex', check = True):
         order = TermOrder(order,n)
+        self._relations = None
         n = int(n)
         if n < 0:
             raise ValueError, "Multivariate Polynomial Rings must " + \
@@ -42,20 +43,21 @@
                 PolynomialRing
 
         P = PolynomialRing(base_ring, n, names, order)
-        c = c.change_ring(P)
-        d = d.change_ring(P)
+        self._c = c.change_ring(P)
+        self._d = d.change_ring(P)
 
-        #print "c:",c
-        #print "c.parent()",c.parent()
+        
+        #print "c:",self._c
+        #print "c.parent()",self._c.parent()
         #print "type(c):",type(c)
-        #print "d:",d
-        #print "d.parent()",d.parent()
+        #print "d:",self._d
+        #print "d.parent()",self._d.parent()
         #print "type(d):",type(d)
 
         from sage.libs.singular.function import singular_function
         ncalgebra = singular_function('nc_algebra')
 
-        cdef RingWrap rw = ncalgebra(c, d, ring = P)
+        cdef RingWrap rw = ncalgebra(self._c, self._d, ring = P)
         self._ring = rw._ring
         self._ring.ShortOut = 0
 
@@ -72,7 +74,6 @@
         self._one_element = new_NCP(self, p_ISet(1, self._ring))
         self._zero_element = new_NCP(self, NULL)
         
-        self._relations = self.relations()
 
         if check:
             import sage.libs.singular
@@ -183,7 +184,7 @@
             sage: P(0)
             0
         """
-        
+
         if element == 0:
             return self._zero_element
         if element == 1:
@@ -198,7 +199,13 @@
         base_ring = self.base_ring()
        
         if(_ring != currRing): rChangeCurrRing(_ring)
-
+        
+        if PY_TYPE_CHECK(element, NCPolynomial_plural):
+            if element.parent() is <object>self:
+                return element
+            elif element.parent() == self:
+                # is this safe?
+                _p = p_Copy((<NCPolynomial_plural>element)._poly, _ring)
 
         if PY_TYPE_CHECK(element, CommutativeRingElement):
             # base ring elements
@@ -289,147 +296,55 @@
        """
        return hash(self.__repr__())
 
-##     def _richcmp_(self, right, int op):
-##         return (<Parent>self)._richcmp_helper(right, op)
-      
+
+    def __cmp__(self, right):
+        r"""
+        Multivariate polynomial rings are said to be equal if:
         
-## ##     cdef int _cmp_c_impl(left, Parent right) except -2:
-## ##          return 0#cmp(type(left),type(right))
+        - their base rings match,
+        - their generator names match,
+        - their term orderings match, and
+        - their relations match.
 
-##     def __cmp__(self, x):
-##         """
-##         EXAMPLES::
 
-##         """
-##         if PY_TYPE_CHECK(x, NCPolynomialRing_plural):
-##             print "huhu"
-##             return 0
-##         print "hihi"
-##         return 0# return cmp(type(self), type(x))
-    
-##     def __richcmp__(self, right, int op):
-##         print "CMP"
-##         print "base", self.base_ring()
-##         print "gens"
-##         for elt in  self.gens():
-##             print elt
-##         print self.term_order()
-##         for elt in  self.relations():
-##             print elt
-##         print  PY_TYPE_CHECK(right, NCPolynomialRing_plural), "huhu"
+        EXAMPLES::
+           sage: A.<x,y,z> = FreeAlgebra(QQ, 3)
+           sage: P = A.g_algebra(relations={y*x:-x*y}, order = 'lex')
 
-##         print "base", right.base_ring()
-##         print "gens"
-##         for elt in  right.gens():
-##             print elt
-##         print right.term_order()
-##         for elt in  right.relations():
-##             print elt
-##         return False
-    
-##         print cmp(self.base_ring(), right.base_ring())
-##         print cmp( map(str, self.gens()),  map(str, right.gens()))
-##         print cmp( map(str, self.relations()),  map(str, right.relations()))
+           sage: P == P
+           True
+           sage: Q = A.g_algebra(relations={y*x:-x*y}, order = 'lex')
+           sage: Q == P
+           True
+                     
+           sage: from sage.matrix.constructor  import Matrix
+           sage: c = Matrix(3)
+           sage: c[0,1] = -1
+           sage: c[0,2] = 1
+           sage: c[1,2] = 1
+           sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural
+           sage: R.<x,y,z> = NCPolynomialRing_plural(QQ, 3, c = c, d = Matrix(3), order='lex')
+           sage: R == P
+           True
+           
+           sage: c[0,1] = -2
+           sage: R.<x,y,z> = NCPolynomialRing_plural(QQ, 3, c = c, d = Matrix(3), order='lex')
+           sage: P == R
+           False
+        """
 
-##         return False
-##         if PY_TYPE_CHECK(right, NCPolynomialRing_plural):
-##             return cmp( (self.base_ring(), map(str, self.gens()),
-##                          self.term_order(), map(str, self.relations())),
-##                         (right.base_ring(), map(str, right.gens()),
-##                          right.term_order(), map(str, right.relations()))
-##                         )
-##         else:
-##             return cmp(type(self),type(right))
+        if PY_TYPE_CHECK(right, NCPolynomialRing_plural):
 
-##     #       return False
- 
- #   def __richcmp__(left, right, int op):
- #       return (<ParentWithGens>left)._richcmp(right, op)    
- #       return False
-##         r"""
-##         Multivariate polynomial rings are said to be equal if:
-        
-##         - their base rings match,
-##         - their generator names match,
-##         - their term orderings match, and
-##         - their relations match.
+            return cmp( (self.base_ring(), map(str, self.gens()),
+                         self.term_order(), self._c, self._d),
+                        (right.base_ring(), map(str, right.gens()),
+                         right.term_order(),
+                         (<NCPolynomialRing_plural>right)._c,
+                         (<NCPolynomialRing_plural>right)._d)
+                        )
+        else:
+            return cmp(type(self),type(right))
 
-
-##         EXAMPLES::
-##            sage: A.<x,y,z> = FreeAlgebra(QQ, 3)
-##            sage: P = A.g_algebra(relations={y*x:-x*y}, order = 'lex')
-
-##            sage: P == P
-##            True
-##            sage: Q = copy(P)
-##            sage: Q == P
-##            True
-                     
-##            sage: from sage.matrix.constructor  import Matrix
-##            sage: c = Matrix(3)
-##            sage: c[0,1] = -1
-##            sage: c[0,2] = 1
-##            sage: c[1,2] = 1
-##            sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural
-##            sage: R.<x,y,z> = NCPolynomialRing_plural(QQ, 3, c = c, d = Matrix(3), order='lex')
-##            sage: R == P
-##            True
-           
-##            sage: c[0,1] = -2
-##            sage: R.<x,y,z> = NCPolynomialRing_plural(QQ, 3, c = c, d = Matrix(3), order='lex')
-##            sage: P == R
-##            False
-##         """
-###         return (<Parent>left)._richcmp(right, op)
-          ##return (<ParentWithGens>left)._richcmp(right, op)  
-##     cdef int _cmp_c_impl(left, Parent right) except -2:
-##         r"""
-##         Multivariate polynomial rings are said to be equal if:
-        
-##         - their base rings match,
-##         - their generator names match,
-##         - their term orderings match, and
-##         - their relations match.
-
-
-##         EXAMPLES::
-##            sage: A.<x,y,z> = FreeAlgebra(QQ, 3)
-##            sage: P = A.g_algebra(relations={y*x:-x*y}, order = 'lex')
-
-##            sage: P == P
-##            True
-##            sage: Q = copy(P)
-##            sage: Q == P
-##            True
-                     
-##            sage: from sage.matrix.constructor  import Matrix
-##            sage: c = Matrix(3)
-##            sage: c[0,1] = -1
-##            sage: c[0,2] = 1
-##            sage: c[1,2] = 1
-##            sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural
-##            sage: R.<x,y,z> = NCPolynomialRing_plural(QQ, 3, c = c, d = Matrix(3), order='lex')
-##            sage: R == P
-##            True
-           
-##            sage: c[0,1] = -2
-##            sage: R.<x,y,z> = NCPolynomialRing_plural(QQ, 3, c = c, d = Matrix(3), order='lex')
-##            sage: P == R
-##            False
-##         """       
-##         print "huhu", PY_TYPE_CHECK(right, NCPolynomialRing_plural)
-##         if PY_TYPE_CHECK(right, NCPolynomialRing_plural):
-##             return True
-##             return cmp( (left.base_ring(), map(str, left.gens()),
-##                          left.term_order(), map(str, left.relations())),
-##                         (right.base_ring(), map(str, right.gens()),
-##                          right.term_order(), map(str, right.relations()))
-##                         )
-##         else:
-##             return cmp(type(left),type(right))
-       
-
-   
     def __pow__(self, n, _):
         """
         Return the free module of rank `n` over this ring.
@@ -466,7 +381,7 @@
         """
 #TODO: print the relations
         varstr = ", ".join([ rRingVar(i,self._ring)  for i in range(self.__ngens) ])
-        return "Noncommutative Multivariate Polynomial Ring in %s over %s, nc-relations: %s"%(varstr,self.base_ring(),self._relations)
+        return "Noncommutative Multivariate Polynomial Ring in %s over %s, nc-relations: %s"%(varstr,self.base_ring(), self.relations())
 
 
     def _ringlist(self):
@@ -486,13 +401,8 @@
             sage: P # indirect doctest
             Noncommutative Multivariate Polynomial Ring in x, y over Rational Field, nc-relations: ...
         """
-#TODO: get the relations
-        L = self._ringlist()
-
-        assert( len(L) == 6 )
-
-        C = L[4]
-        D = L[5]
+        if self._relations is not None:
+            return self._relations
 
         from sage.algebras.free_algebra import FreeAlgebra
         A = FreeAlgebra( self.base_ring(), self.ngens(), self.gens() )
@@ -501,12 +411,12 @@
         n = self.ngens()
         for r in range(0, n-1, 1):
             for c in range(r+1, n, 1):
-                if  ((C[r, c] * self.gen(r) * self.gen(c) + D[r, c]) != self.gen(r) * self.gen(c)) or add_commutative:
-                    res[ A.gen(c) * A.gen(r) ] = C[r, c] * self.gen(r) * self.gen(c) + D[r, c]
+                if  (self.gen(c) * self.gen(r) != self.gen(r) * self.gen(c)) or add_commutative:
+                    res[ A.gen(c) * A.gen(r) ] = self.gen(c) * self.gen(r) # C[r, c] * P.gen(r) * P.gen(c) + D[r, c]
         
-        return res
-
-
+            
+        self._relations = res
+        return self._relations
 
     def ngens(self):
         """
