# Saving Dot-ed eigenvectors in a special comparison [closed]

We have produced a 4*4 matrix in any iteration containing nx from 0 to 2 by steps of 0.5. and in any iteration we have saved sorted orthogonalized-eigenvectors based on their eigenvalues with this code to the storagematrix:

storagematrix = {};
Block[{nx = 2, intervals = 0.5, rank = 4},
storagematrix =Flatten[Last /@ SortBy[Transpose@ MapAt[Orthogonalize,
Eigensystem[(nx - #) RandomInteger[{-1, 1}, {rank, rank}]],2], First] & /@ Range[0, nx, intervals], 1]];

storagematrix//MatrixForm:


(We so much tried to clarify the problem I hope there is a guidance or help) In which, any color shows any ortho-eigenvectors of any iteration of nx. the number of eigenvectors is 4 and the number of iteration is 5.

Our desired case at the future is: a Dot production of any eigenvector in any iteration to others and a comparison operation as bellow:

The first eigenvector must be Dot-ed (Dot operation of two vectors) to the firstly two next eigenvectors (nx=0.5) if one of their Dot result is less than 0.01, this is the next eigenvector (suitable eigenvector as boxed in a red line) which must be saved to a list as: desiredeigens. This eigenvector must be selected to the next Dot to the other eigenvectors for this example nx=1, after selecting the suitable eigenvector (in condition of being less than 0.01) it will be chosen to the next and continue.

If a multiply (Dot) results less 0.01 for two eigenvectors the program must choose the first one and the first one will continue the process (as for nx=1.5). If the result of Dot, is not less than 0.01, one of eigenvectors must be chosen which is smaller than another product.

Things that are important to be obtained from this code are: 1-desiredeigens (list) [this desiredlist contains eigenvectors which multiplications are less than 0.01 or those which their Dot less than other (eigen, 0,01),(eigen,0.001),(eigen,0.006),(eigen,0.7) however 0.7 is larger than 0.01 but it is the smaller amount of production] 2-a list which shows (nx, the number of eigenvector suitable and if there is no eigenvector the number will be 0) [black written at the right of the figure]

This code maybe result but there are some faults (for example: it doesn't choose just two firstly eigenvectors and doesn't choose the lowest amount for not be in condition)

Norm /@ Flatten[ First[#1].Transpose[#2] & @@@ Partition[Partition[storagematrix, 4], 2, 1]] // Select[# < 0.0.01 &]

• You might want to use Chop, e.g., storagematrix // Chop // MatrixForm – Bob Hanlon Aug 3 '15 at 12:42
• Or put the Chop into the Block so that storagematrix is defined in the cleaner form. – Bob Hanlon Aug 3 '15 at 12:50
• @Bob, With your good comment, the above matrix will be presented cleaner, but the problem will be kept. Also, in any apply of the code, new matrix will be obtained because of existing random generation in creating the main matrix. – Unbelievable Aug 3 '15 at 14:43
• The comment wasn't intended to answer your question merely point out the value of Chop in cleaning up your matrices. Even with different random values it will still often be of use. – Bob Hanlon Aug 3 '15 at 15:07

You can use

list1 = {storagematrix[[i + 4]], storagematrix[[i + 5]]};
list2 = {a[[i]], a[[i + 1]]};
t=KroneckerProduct[list1, list2];


and Position[t,Min[t]]

can obtain the indices of what you want to know about what product is less than others.