Hi Simon,
I am not sure this is the smallest example, but I get some error messages when
playing with the quotients:
sage: n=3
sage: F = FreeAlgebra(ZZ,n,'x',implementation='letterplace')
sage: x = F.gens()
sage: rel = [x[(i+1)%n]*x[i]*x[i]-x[i]*x[(i+1)%n]*x[i] for i in range(n)]
sage: rel += [x[(i+1)%n]*x[(i+1)%n]*x[i]-x[(i+1)%n]*x[i]*x[(i+1)%n] for i in
range(n)]
sage: rel
[-x0*x1*x0 + x1*x0*x0, -x1*x2*x1 + x2*x1*x1, x0*x2*x2 - x2*x0*x2, -x1*x0*x1 +
x1*x1*x0, -x2*x1*x2 + x2*x2*x1, x0*x0*x2 - x0*x2*x0]
sage: I = F*rel*F
sage: Q = F.quo(I, names='a')
sage: a = Q.gens()
sage: a[1]**3
a1*a1*a1
sage: a[1]**4
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (304, 0))
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/Users/anne/Documents/Sage/<ipython console> in <module>()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/element.so
in sage.structure.element.RingElement.__pow__ (sage/structure/element.c:11817)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/element.so
in sage.structure.element.generic_power_c (sage/structure/element.c:21115)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/element.so
in sage.structure.element.RingElement.__mul__ (sage/structure/element.c:11377)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/element.so
in sage.structure.element.RingElement._mul_ (sage/structure/element.c:11495)()
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/quotient_ring_element.pyc
in _mul_(self, right)
268 -b^2
269 """
--> 270 return self.parent()(self.__rep * right.__rep)
271
272 def _div_(self, right):
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:6676)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so
in sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3119)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/coerce_maps.so
in sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3022)()
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/quotient_ring.pyc
in _element_constructor_(self, x, coerce)
771 R = self.cover_ring()
772 x = R(x)
--> 773 return quotient_ring_element.QuotientRingElement(self, x)
774
775 def _coerce_map_from_(self, R):
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/quotient_ring_element.pyc
in __init__(self, parent, rep, reduce)
102 self.__rep = rep
103 if reduce:
--> 104 self._reduce_()
105
106 def _reduce_(self):
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/quotient_ring_element.pyc
in _reduce_(self)
121 """
122 I = self.parent().defining_ideal()
--> 123 self.__rep = I.reduce(self.__rep)
124
125 def lift(self):
/Applications/sage/local/lib/python2.6/site-packages/sage/algebras/letterplace/letterplace_ideal.so in sage.algebras.letterplace.letterplace_ideal.LetterplaceIdeal.reduce
(sage/algebras/letterplace/letterplace_ideal.cpp:3285)()
/Applications/sage/local/lib/python2.6/site-packages/sage/algebras/letterplace/free_algebra_element_letterplace.so in
sage.algebras.letterplace.free_algebra_element_letterplace.FreeAlgebraElement_letterplace.normal_form (sage/algebras/letterplace/free_algebra_element_letterplace.cpp:6257)()
/Applications/sage/local/lib/python2.6/site-packages/sage/algebras/letterplace/letterplace_ideal.so in sage.algebras.letterplace.letterplace_ideal.LetterplaceIdeal.groebner_basis
(sage/algebras/letterplace/letterplace_ideal.cpp:2750)()
/Applications/sage/local/lib/python2.6/site-packages/sage/libs/singular/function.so
in sage.libs.singular.function.SingularFunction.__call__
(sage/libs/singular/function.cpp:9666)()
RuntimeError:
Best wishes,
Anne
On 3/24/11 9:36 AM, Simon King wrote:
Hi Anne,
On 24 Mrz., 10:53, Anne Schilling<a...@math.ucdavis.edu> wrote:
...
Ok, this should not be a problem since in the application I have in mind
the relations are homogeneous and hence only terms in homogeneous terms
will cancel.
Therefore, in my to-be-submitted-as-soon-as-the-damned-documentation-
correctly-builds patch, it is excluded to even *create* an
inhomogeneous element. Probably that will be allowed as soon as the
next Singular version is in Sage.
Ok, let me know when your patch is available! I would be super happy to try it
out.
The patch is submitted -- see #7797.
Here are some examples, also addressed to people who might be
interested in reviewing.
1. The arithmetic is fairly quick (but mind that it is restricted to
homogeneous elements, and so it can currently not be the default
implementation):
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')
sage: F
Free Associative Unital Algebra on 3 generators ('x', 'y', 'z') over
Rational Field
sage: F_old.<a,b,c> = FreeAlgebra(QQ)
sage: timeit('t=(x+y)^15')
5 loops, best of 3: 27.7 ms per loop
sage: %time t=(a+b)^15
CPU times: user 4.51 s, sys: 0.09 s, total: 4.60 s
Wall time: 6.46 s
sage: 4510/27.7
162.815884476534
sage: timeit('t=(x+y)^15')
25 loops, best of 3: 19.7 ms per loop
sage: %time t=(a+b)^15
CPU times: user 2.70 s, sys: 0.02 s, total: 2.72 s
Wall time: 2.73 s
sage: 2700/19.7
137.055837563452
3. We have Groebner bases and normal forms wrt. twosided homogeneous
ideals, and we can even construct the quotient ring:
sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*F
sage: I.groebner_basis(degbound=3)
Twosided Ideal (y*y*y - y*y*z + y*z*y - y*z*z, y*y*x + y*y*z + y*z*x +
y*z*z, x*y + y*z, x*x - y*x - y*y - y*z) of Free Associative Unital
Algebra on 3 generators ('x', 'y', 'z') over Rational Field
sage: (x*y*z*y*x).normal_form(I)
y*z*z*y*z + y*z*z*z*x + y*z*z*z*z
sage: x*y*z*y*x - (x*y*z*y*x).normal_form(I) in I
True
sage: x*I.0-I.1*y+I.0*y in I
True
sage: 1 in I
False
sage: Q.<a,b,c> = F.quo(I); Q
Quotient of Free Associative Unital Algebra on 3 generators ('x', 'y',
'z') over Rational Field by the ideal (x*y + y*z, x*x + x*y - y*x -
y*y)
sage: a*b
-b*c
sage: a^3
-b*c*a - b*c*b - b*c*c
A quotient ring of a quotient ring works as well.
sage: J = Q*[a^3-b^3]*Q
sage: R.<i,j,k> = Q.quo(J); R
Quotient of Free Associative Unital Algebra on 3 generators ('x', 'y',
'z') over Rational Field by the ideal (-y*y*z - y*z*x - 2*y*z*z, x*y +
y*z, x*x + x*y - y*x - y*y)
sage: i^3
-j*k*i - j*k*j - j*k*k
sage: j^3
-j*k*i - j*k*j - j*k*k
Best regards,
Simon
--
You received this message because you are subscribed to the Google Groups
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sage-combinat-devel?hl=en.