Hey everyone:
For what I'm working on, I'm trying to take transform two variables over a matrix A, and then have the transformed variables plug into a function.
reset()
n = var("n")
x = var("x")
j = var("j")
k = var("k")
y = var('y')
z = var('z')
A = lambda n,j: (matrix([[cos(2*pi/n), -sin(2*pi/n)],[sin(2*pi/n), cos(2*pi/n)]]))^j
C = matrix([[2],[3]])
AC = A(3,2)*C
a = AC[0]
b = AC[1]
fx1y0 = lambda x,y: x + 11
fx1y1 = lambda x,y: x + y + 11
fx2y1 = lambda x,y: x^2 + y + 11
fx1y0(a,b)
The error I'm getting when I plug in a and b into fx1y0 is this:
TypeError: unsupported operand parent(s) for '+': 'Vector space of dimension 1 over Symbolic Ring' and 'Integer Ring'
I think the problem is that it is treating a and b as 1 dimensional vectors, when all I want is for a and b to contain the values at the location in the matrix that I specify. Basically, I think I want it to treat the matrix as an array, in terms of me getting values from it. Does anyone know how I could fix this?