1
$\begingroup$

I have a very little knowledge about Sage and this may be a dumb question, but I could not find anything about this.

Is there any way to define a sage function of several variables whose arguments are matrices (e.g. automorphy factor of Siegel modular group)? In other words, can we define a function of matrix variables whose entries are variables.

I have no experience whatsoever in sage and I am sorry if this sounds silly.

$\endgroup$
2
  • 1
    $\begingroup$ You can define variables using vars = var('x11 x12 x21 x22') (using loops to build the string with variable names), then operate in MatrixSpace(SR,m,n) = $m\times n$ matrix ring over the 'symbolic ring' (it includes all variables you defined). What kind of function do you want? $\endgroup$ Commented Oct 18, 2024 at 20:50
  • $\begingroup$ Sorry for the late reply. I want a function which maps $M_n(Z)\times \mathbb C^n$ to $\mathbb C^n$ which explicitly depends on the entries of the matrices. i.e., if given any pair of symbolic matrices, it returns the image as a symbolic vector. $\endgroup$ Commented Oct 24, 2024 at 15:46

1 Answer 1

1
$\begingroup$

(can't post multiline code in comments)

What should it compute? Here's a mathematically nonsensical example (I hope I captured the general idea of your question):

n = 4 # even dimension MS = MatrixSpace(SR,n,n) # define the matrix space # Define the 2D list (a list of lists) that's about to become # a matrix with named variables (matrices in SageMath are immutable): ml = [ [0]*n for i in range(n)] # Generate the named variables and add them to the list in the usual order: for i in range(n): # 0...n-1 for j in range(n): # This injects the variable name into the SR: ml[i][j] = var('m'+str(i)+str(j)) M = MS(ml) # make the 2D list a matrix # Generate the vector (0,1,2,...,n-1): v = VectorSpace(SR,n)(list(range(n))) # The function. def f(m, t): # Split the vector in half: v0 = t[:n//2]; v1 = t[n//2:] # Split the matrix into 4 blocks: m.subdivide([n//2], [n//2]) # Take the lower two ones: C = m.subdivision(1,0); D = m.subdivision(1,1) # Multiply the half-vectors by inverses of half-matrices, # reconstruct the long vector and operate upon it too: return m*vector(list(C^-1*v0) + list(D^-1*v1)) f(M,v) # evaluate the example 

Please ask any questions on notation, or post the formula you want to adjust the above computation to.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.