# Dimension of a certain subspace of a matrix space

Si scriva una procedura in Sage che calcoli al variare dell'intero n>=2 la dimensione del sottospazio vettoriale W di End(Mn(R)) costituito da tutte e sole le applicazioni lineari F(A;B) : Mn(R) --> Mn(R) del tipo F(A;B) : X |----> AX + XB al variare di A e B in Mn(R).

Edit: translation contributed by @daniele:

Write a function in Sage that computes the dimension of the vector subspace $W \subseteq \mathrm{End}(M_n(\mathbb{R}))$ constructed as following: $W$ consists of linear maps $F(A;B) \colon M_n(\mathbb{R}) \to M_n(\mathbb{R})$ such that $F(A;B) : \colon X \mapsto AX + XB$ with $A$, $B$ in $M_n(\mathbb{R})$. Here, $n\geq 2$.

edit retag close merge delete

Google translate from Italian gives this very bad rendering, but maybe it will help someone help this person: "Is written to a procedure in which Sage calculations to vary the entire n> = 2, the dimension of the vector subspace W of End (Mn (R)) consisting of all and only the linear applications F (A; B): Mn (R) -> Mn (R) of the type F (A; B): X | ----> AX + XB to vary by A and B in Mn (R)."

( 2016-01-20 16:47:51 +0200 )edit

I don't know whether we have arbitrary endomorphism rings implemented, but I would guess that if you could write it as a matrix space you should be able to implement this. It's probably not built-in.

( 2016-01-20 16:48:15 +0200 )edit
1

I can not edit, still. Here below a translation:

Write a function in Sage, with the aim to compute the dimension of the vector subspace $W \subseteq \mathrm{End}(M_n(\mathbb{R}))$ constructed as following: W consists of linear maps $F(A;B) \colon M_n(\mathbb{R}) \to M_n(\mathbb{R})$ such that $F(A;B) \colon X \mapsto AX + XB$ with $A$, $B$ in $M_n(\mathbb{R})$. Here, $n\geq 2$.

( 2016-01-21 18:42:05 +0200 )edit

Sort by ยป oldest newest most voted

It is arguable, that

lambda n:    2*n^2-1    # if n in ZZ and n > 0 else None


is the solution getting the full score in an exam. (But this is always a good test for the sense of humor of the examiner. And for the own courage in real life.)

Instead, we may translate as follows from the Italian:

Write a function in Sage that computes the matrix of the linear map $F$, written in suitable bases,

• from the space $V_A\times V_B$, where $V_A=V_A(n)$, $V_B=V_B(n)$ are two copies of $M_n(R)$

• to the space $W=W(n)$ of endomorphisms of $M_n(R)$,

constructed as follows: For $A\in V_A$ and $B\in V_B$ we associate $F(A,B) = F(A,0)+F(0,B)$ which acts on a matrix $X$ as follows: $F(A,B)(X)=AX+XB$.

Then compute the rank for some small values of n.

My choice of the bases is as follows. Let $E_A(j,k)$ be the standard generators of $V_A$. And $E_B(j,k)$ be the standard generators of $V_B$. It is clear that the family of $2n^2$ endomorphisms in $W$ of the shape $F(\ E_A(j,k), 0\ )$ and $F(\ 0,E_B(j,k)\ )$ generate the image of $F$. We associate the matrix for them and the standard generators of $W$, which are the homomorphisms $E(\ (s,t)\to(u,v)\ )$ mapping all standard generators to zero, except for $E(s,t)$, which is mapped to $E(u,v)$.

It is clear now, that a non-trivial liniar combination leads to an equation of the shape $AX+XB\equiv 0$, an identity in $X$. ($A$ and $B$ come by assembling the coefficients in the non-trivial linear combination.) This is the case only for $A=-B$ a diagonal matrix, moreover a scalar times unit matrix. (This was exactly my first exercise in von Neuman algebras.) So the dimension of the kernel is one. The following lines compute the matrix explicitly, and the rank is as expected. The programmer has no problems with the linear algebra, but rather with the reshaping of a matrix as a vector.

def FMatrix( n ):
R = range(n)
A = matrix( QQ, n^4, n^2+n^2 )
count_columns = 0
for j, k in cartesian_product( [R, R] ):
# the elementary matrix (j,k) acts on the vector of morphisms ( (s,t) -> (u,v) )
# first of all from the left, then from the right,

# from the left
count_rows = 0
for s, t, u, v in cartesian_product( [R,R,R,R] ):
# is (j,k) o (s,t) = (u,v) ?
if j == u and k == s and t == v:
A[ count_rows, count_columns ] = 1
count_rows += 1
count_columns += 1

# from the right
count_rows = 0
for s, t, u, v in cartesian_product( [R,R,R,R] ):
# is (s,t) o (j,k) = (u,v) ?
if s == u and t == j and k == v:
A[ count_rows, count_columns ] = 1
count_rows += 1
count_columns += 1

return A

for n in [1..4]:
print "Dimension of W(%s) is: %s" % ( n, FMatrix(n).rank() )


And after a short thrill:

Dimension of W(1) is: 1
Dimension of W(2) is: 7
Dimension of W(3) is: 17
Dimension of W(4) is: 31

more