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.Tue, 26 Mar 2024 04:07:33 +0100How to generate this map in sagehttps://ask.sagemath.org/question/76649/how-to-generate-this-map-in-sage/Okay this is my code so far.
F.<x,y,z> = FreeGroup()
A = F.algebra(QQ)
Y = A(y)
Yinv = A(y^-1)
Z = A(z)
Z2 = A(Z)
X = A(x)
X2 = A(X)
X2inv = A(X^-1)
Xinv = A(x^-1)
Y2 = A(Y)
def functionMap(X,Y,Z,Xinv):
X = A(X2 * Y2 * X2inv)
Y = A(X2 * Z2 * X2inv)
Z = A((Z2 * Y2 + 1)*X2inv)
print(X)
print(Y)
print(Z)
X2 = A(X)
X2inv = A(X2^-1)
Y2 = A(Y)
Z2 = A(Z)
for i in range(6):
functionMap(X,Y,Z,Xinv)
As you can see, I'm trying to repeatedly take the map x,y,z to xyx^-1, xzx^-1, (zy+1)x^-1 repeatedly. I'm getting a lot of errors though. Does anyone know how to fix my code? I think It might have something to do with the multiple variables calling the symbol 'x' but idk how else to not cause issues when I'm doing the three different parts of my map (like if I change X then the middle part has the wrong iteration of x)babyturtleTue, 26 Mar 2024 04:07:33 +0100https://ask.sagemath.org/question/76649/How to simplify non-commutative expressionshttps://ask.sagemath.org/question/76591/how-to-simplify-non-commutative-expressions/ So I want to somehow simplify terms like y(y+1)y^-1. These symbols are not commutative so this is a special case where when you expand the y and y^-1 cancel and you are left with (y+1). How do I do this kind of simplification for much larger and uglier expressions. Specifically, I'm trying to simplify stuff from the map x,y,z to xyx^-1, yzy^-1, yz(y+1) repeated over and over again.babyturtleWed, 20 Mar 2024 17:09:49 +0100https://ask.sagemath.org/question/76591/Generating a certain list of non-commuting polynomials with Sagehttps://ask.sagemath.org/question/73873/generating-a-certain-list-of-non-commuting-polynomials-with-sage/I have a set of variables $x_1,...,x_n$ and $y_1,...,y_m$ for $n,m >=1$.
Now I can build all quadratic monomials of the form $x_i y_j$ and $y_j x_i$ (but we do not have $x_i y_j= y_j x_i$ as we calcualte in the non-commutative polynomial ring). But something like $x_i x_j$ is not allowed as after an $x_i$ there must come an $y_j$ and after an $y_i$ there must come an $x_i$.
Now I want with Sage the list of all possible relations of the form $w_1 \pm w_2 \pm w_3 \cdots$ such that all $w_i$ are different quadratic relations that all start either with a $x_i$ or a $y_j$.
For example for $n=2$ and $m=1$, possible relations are (I hope I did not forget any relation) :
$x_1 y_1, x_1 y_1-x_2 y_2, x_1 y_2 + x_2 y_2 , x_2 y_1,y_1 x_1, y_1 x_2, y_1 x_1 - y_1 x_2 , y_1x_1+y_1 x_2$.
I am not sure how to do this in an easy way with Sage, but maybe someone knows a simple trick.
Thanks for any help.klaaaFri, 13 Oct 2023 00:14:20 +0200https://ask.sagemath.org/question/73873/Regular Languages in Sage?https://ask.sagemath.org/question/57460/regular-languages-in-sage/I see there's a package for [automata](https://doc.sagemath.org/html/en/reference/combinat/sage/combinat/finite_state_machine.html), but is there a way to work directly with regular languages? For instance, is there an option for seeing which strings are carved out by (ac+b)\*c? What about finding a machine associated to that regular expression? Is there a way to work with [rational series](https://perso.telecom-paristech.fr/jsaka/ENSG/MPRI/Files/References/JS-HWA.pdf)? I would love to be able to expand out something like (ac+b)\*c as a rational function (in noncommuting variables) (1 - (ac+b))^(-1)c, then take a series expansion, but I can't find any documentation on noncommuting power series (though I did find something on [noncommuting polynomials](https://doc.sagemath.org/html/en/reference/noncommutative_polynomial_rings/sage/rings/polynomial/plural.html), which I could probably leverage by expanding out kleene stars far enough by hand).
I feel like regular languages are such a fundamental topic in CS, and a lot of computational results are known, that some of it *must* be implemented already. Any advice would be fantastic!
Thanks in advance ^_^.dispoFri, 04 Jun 2021 20:08:54 +0200https://ask.sagemath.org/question/57460/