ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 02 Jan 2022 17:22:35 +0100Constructing a non-commutative algebra over Z[q, q^-1] given some relationshttps://ask.sagemath.org/question/60516/constructing-a-non-commutative-algebra-over-zq-q-1-given-some-relations/
I would like to construct a non-commutative alegebra over Z[q, q^-1] generated by the variables u1, u2, u3 with the relations:
u2*u1 = q*u1*u2
u3*u2 = (q^2)*u2*u3
u3*u1 = u1*u3
but I am having some trouble getting this to work. I have primarily been trying to do this using the FreeAlgebra structure. Here is what I have tried:
----------
Zq.<q> = LaurentPolynomialRing(ZZ)
A.<u1,u2, u3> = FreeAlgebra(Zq, 3)
G = A.g_algebra({u2*u1: q*u1*u2, u3*u2: (q**2)*u2*u3})
G
but I get the errors:
AttributeError: 'FreeAlgebra_generic_with_category.element_class' object has no attribute 'lift'
TypeError: unable to coerce <class 'sage.algebras.free_algebra.FreeAlgebra_generic_with_category.element_class'> to `an integer`
----------
Zqring.<q, qinv> = ZZ[]
qideal = Zqring.ideal(q*qinv - 1)
Zq.<q, qinv> = Zqring.quotient(qideal)
A.<u1,u2,u3> = FreeAlgebra(Zq, 3)
I = A.ideal(u2*u1-q*u1*u2, u3*u2-(q**2)*u2*u3, side = "twosided")
W.<u1, u2, u3> = quotient(A,I)
u2*u1-q*u1*u2
but this outputs "(-q)*u1*u2 + u2*u1" and not "0"
----------
Zqring.<q, qinv> = ZZ[]
qideal = Zqring.ideal(q*qinv - 1)
Zq.<q, qinv> = Zqring.quotient(qideal)
A.<u1,u2,u3> = FreeAlgebra(Zq, 3)
I = A*[u2*u1-q*u1*u2]*A
W.<u1,u2,u3> = A.quo(I)
W(u2*u1-q*u1*u2)
and, again, the output is not "0".
Is there a better way I can construct such a non-commutative algebra?
Thanks!kAllenMathSun, 02 Jan 2022 17:22:35 +0100https://ask.sagemath.org/question/60516/Creating an object of the Magmatic Algebras categoryhttps://ask.sagemath.org/question/48953/creating-an-object-of-the-magmatic-algebras-category/ For the moment being, the category of Sage for nonassociative algebras is called MagmaticAlgebras. I want to know which methods are available in this category, and specifically how to create an object (i.e., a nonassociative algebra). In particular, what I want is to get the free nonassociative algebra in four variables (a,b,c,d) over the rational field. The MagmaticAlgebras reference page is of no use to me. Thank you!Jose BroxThu, 05 Dec 2019 18:36:44 +0100https://ask.sagemath.org/question/48953/substitution of ideal generators of a free algebrahttps://ask.sagemath.org/question/43903/substitution-of-ideal-generators-of-a-free-algebra/I'm trying to map the generators of an ideal $I$ of a free $k$-algebra $A = k \\{ x, y \\}$ to a different free $k$-algebra $B = k \\{ u, v \\}$ (really I'm trying something more complicated, but the failure occurs in even this simplified example). I was attempting to do this via `subs` by creating a dictionary taking $x$ to $u$ and $y$ to $v$, but this is not working.
sage: A.<x, y> = FreeAlgebra(QQ, 2)
sage: I = A*[x*y - y*x - 1]*A
sage: B.<u, v> = FreeAlgebra(QQ, 2)
sage: genMap = {'x':'u', 'y':'v'}
sage: I.gen(0).subs(genMap)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-9d969fff6a4a> in <module>()
----> 1 I.gen(Integer(0)).subs(genMap)
sage/structure/element.pyx in sage.structure.element.Element.subs (build/cythonized/sage/structure/element.c:7572)()
/usr/lib/python2.7/dist-packages/sage/algebras/free_algebra_element.pyc in __call__(self, *x, **kwds)
176 for m, c in six.iteritems(self._monomial_coefficients):
177 if result is None:
--> 178 result = c*m(x)
179 else:
180 result += c*m(x)
sage/rings/rational.pyx in sage.rings.rational.Rational.__mul__ (build/cythonized/sage/rings/rational.c:21325)()
sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op (build/cythonized/sage/structure/coerce.c:10686)()
TypeError: unsupported operand parent(s) for *: 'Rational Field' and 'Free monoid on 2 generators (x, y)'
This error seems strange to me; is it not understanding elements of $\mathbb{Q}$ and $\\{ x, y \\}$ as elements of $\mathbb{Q} \\{ x, y \\}$? I also tried to do this via a homomorphism $A \to B$ but I could not get this to work, as it seems they are not fully implemented yet for free algebras, from what I could tell. Any help or alternatives would be very appreciated.
**EDIT**: I got a slight work-around, by converting the elements to strings, replacing the variables as characters, and the evaluating the string in the target. However, I feel like this is way more costly than a substitution would be, so I am still interested in a solution.rhoadskjWed, 10 Oct 2018 17:04:18 +0200https://ask.sagemath.org/question/43903/How to implement the free nonassociative algebra?https://ask.sagemath.org/question/42867/how-to-implement-the-free-nonassociative-algebra/ How can I work with nonassociative and noncommutative polynomials over a field (in some prefixed number of variables)? The function FreeAlgebra produces a free associative algebra.Jose BroxMon, 09 Jul 2018 08:28:38 +0200https://ask.sagemath.org/question/42867/Free algebra with involutionhttps://ask.sagemath.org/question/42253/free-algebra-with-involution/ I'd like to implement an involution over a free (associative noncommutative) algebra, i.e., an antiautomorphism of order 2 (linear map such that $f(ab)=f(b)f(a)$ and $f(f(a))=a$), but I don't know where to start. Perhaps we could define the algebra with a double number of generators, every generator x having its involution x1, and then define f from this by correspondence of generators (but I have no knowledge to do this).
More precisely, what I actually want to do is to take the product of the algebra as starting point to define a new product of the form
$$a*b:=af(b).$$Jose BroxFri, 04 May 2018 00:30:23 +0200https://ask.sagemath.org/question/42253/Calculations in quotient of a free algebrahttps://ask.sagemath.org/question/41219/calculations-in-quotient-of-a-free-algebra/I want to define (the algebra part of) Sweedler's four-dimensional Hopf algebra, which is freely generated by $x,y$ and subject to the relations
$$
x^2 = 1, \qquad y^2 = 0, \qquad x\cdot y = - y\cdot x~ ,
$$
but I don't see how to do it.
I have tried the following:
sage: A.<x,y> = FreeAlgebra(QQbar)
sage: I = A*[x*x - 1, y*y, x*y + y*x]*A
sage: H.<x,y> = A.quo(I)
sage: H
Quotient of Free Algebra on 2 generators (x, y) over Algebraic Field by the ideal (-1 + x^2, y^2, x*y + y*x)
But then I get
sage: H.one() == H(x*x)
False
So is this currently possibly using a different method?
ThanksJo BeWed, 21 Feb 2018 14:44:18 +0100https://ask.sagemath.org/question/41219/