If A, B are two lists with length n and M is a n*n Matrices, then I want to compute the inner product of them B.M.A. The result should be a scalar however, what I get is a matrix. Any one knows what happened here? Thanks!
My code is below
A = {Subscript[z, 0], Subscript[z, 1], Subscript[z, 2],
Subscript[z, 3], Subscript[z, 4]};
B = {Subscript[OverBar[z], 0], Subscript[OverBar[z], 1], Subscript[OverBar[z], 2],
Subscript[OverBar[z], 3], Subscript[OverBar[z], 4]};
M = Chop[{{0.9947525414706575`,
0.014318078739690324` +
0.012070727204725996` I, -0.022576963511297447` +
0.017365770023498133` I,
0.028293920126770736` + 0.0041202947110136594` I,
0.02281394023398197` -
0.0005272617323759155` I}, {0.014318078739690316` -
0.012070727204725998` I, 1.0089738927082252`,
0.02221807191535088` -
0.018113027609091715` I, -0.012682665041359427` -
0.010424540405231546` I, -0.055382503060447716` +
0.035624018712441564` I}, {-0.02257696351129744` -
0.017365770023498137` I,
0.022218071915350877` + 0.018113027609091715` I,
1.0204773571789212`, -0.0007522563609968502` +
0.026534550066808438` I,
0.0003575302509902032` -
0.0635032495006343` I}, {0.028293920126770733` -
0.00412029471101366` I, -0.012682665041359427` +
0.010424540405231544` I, -0.000752256360996853` -
0.026534550066808438` I, 1.0132613424630528`,
0.059304690914936876` -
0.01648460212183861` I}, {0.02281394023398197` +
0.0005272617323759158` I, -0.055382503060447716` -
0.035624018712441564` I,
0.0003575302509902011` + 0.06350324950063431` I,
0.059304690914936876` + 0.016484602121838613` I,
0.9911763824117488`}}]
In[31]:= Dimensions[B.M.A]
Out[31]= {5}
FullForm[A.M.B].Dimensionsis returning the dimensions of the head of the expression (Plus) which has5terms. – Edmund Oct 25 '18 at 21:56