Hello.(adsbygoogle = window.adsbygoogle || []).push({});

I'm trying to consider a matrix A and looking at A^{k}and (A^{k})^{T}A^{k}, where T is the usual transpose.

This is no big deal. But I'd rather not look at them one at a time--I want to consider some powers k from 1 through as high as I want them. When I try

it gives me this giant matrix of each matrix I want, sure, but the matrices are all broken up into column vectors. How can I fix this so I can get a good table of separated matrices (changing MatrixForm to TableForm gives me the view I want, but the matrix brackets are gone so it's just a generic tableau).Code (Text):Table[MatrixPower[A, k],{k,5}]//MatrixForm

Now that's the first issue. My next issue is I would like to take every nonzero element in each matrix and turn it into the value 1.

For just one matrix, I have this

Which gives me what I want (the matrix ACode (Text):For[i = 1, i < n + 1, i++,

For[j = 1, j < n + 1, j++,

If[MatrixPower[A, k][[i, j]] == 0, AAl[i, j] := 0,

AAl[i, j] := 1]]];^{k}will have nonnegative integers for what I'm dealing with, so I can just look for the 0s of my A^{k}and force every other element = 1). But I'd like to incorporate that into my table of all matrices so I can compute this for all powers simultaneously (it doesn't matter if, say, A^{k}'s values are 0s and 1s and then the next A^{k+1}is computed from the modified A^{k}instead of from the original A^{k}).

Finally, I'd like to turn all these into adjacency graphs and thus see how the adjacency graph changes with each power. From the above, I simply do

to create the matrix from the values of the for loop and then finallyCode (Text):AA := Table[AAl[i, j], {i, n}, {j, n}];

to see the adjacency graph, and obviously this only works for one matrix power at a time.Code (Text):AdjacencyGraph[AA, VertexLabels -> "Name", ImagePadding -> 10]

Any help would be appreciated. And if there is a better way of dealing with this (I just assume I HAVE to convert my nonzero values to 1 for Mathematica to spit out any adjacency matrix), that would be appreciated.

For reference, I'm looking at Wielandt matrices of order n (which I fix, and I will look at one order at a time), and I'm trying to look at the pattern of the adjacency graphs for finding minimal scrambling and regularity indices (which are the exponents k).

Thanks!

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica 8.0 - Generating List of Powers of Matrices/Graphs

**Physics Forums | Science Articles, Homework Help, Discussion**