nilpotent adjacency matrix
i wish to define a nilpotent adjacency matrix.
example vertex adjacency matrix of a graph (K4 minus an edge) is
A=
[0 1 1 0]
[1 0 1 1]
[1 1 0 1]
[0 1 1 0]
where N=4 vertices
so for all entries Aij i wish to define a function to replace the 1's by bj
so for the example above i get a nilpotent matrix
B=
[0 b2 b3 0]
[b1 0 b3 b4]
[b1 b2 0 1]
[0 b2 b3 0]
where the bj where i,j∈{1,2,3,4} obey the following rules of multiplication:
bjbi=bibj and b2j=0 (so i also need to define a function for these rules)
so for the nilpotent adjacency matrix i can define matrix multiplication using the above rules for its entries i.e. BN
i'd like the function to be something like nil(B,k) and for it to print the trace of Bk
e.g. nil(B,2)=2b1b2+2b1b3+2b2b3+2b2b4+2b3b4
i'll try to work on this myself too in the meantime, but this is probably the most complicated function i've had to do.. mainly due to redefining the adjacency matrix