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.

Reply via email to