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, 30 Apr 2024 00:58:00 +0200How to generate map in sagehttps://ask.sagemath.org/question/77153/how-to-generate-map-in-sage/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).
That was my old question and someone gave me a response and I updated my code. I don't get why my new code doesn't work. If anyone knows how to fix it, or tell me another way to this please let me know!
A = algebras.Free(QQ, list('XYZ'), degrees=(1,1,1))
Ahat = A.completion()
A.inject_variables()
# Define elements x, y, and z
a = Ahat(X)
b = Ahat(Y)
c = Ahat(Z)
# Define the mapping function
def mymap(vx, vy, vz):
return vx * vy * ~vx, vx * vz * ~vx, (vz * vy + 1) * ~vx
# Apply the mapping function with the generators X, Y, and Z
print(mymap(a, b, c))babyturtleTue, 30 Apr 2024 00:58:00 +0200https://ask.sagemath.org/question/77153/