# Difference between vector's Dimensions

What's the difference between

projection= Table[Conjugate[autoVett[[k]].someVector1], {k, 1, r}]
Dimensions[projection]


that gave me as results {12} which is ok.

Dimensions[baseComp]
{8}
Dimensions[Transpose[{baseVector}]]
{12,1}
startState =
KroneckerProduct[baseComp, Transpose[{baseVector}]] ;
Dimensions[startState]
{96,1}
scompoStartState =
Table[Conjugate[CCNOTHvec[[k]].startState], {k, 1,
Length[CCNOTHvec]}];
Dimensions[scompoStartState]
{96,1}


What's the difference between a {12} vector and a {96,1} vector? I need to have just 96-dimensional vector.

-
What's the difference between autoVett[[k]], someVector1, baseComp[[4]], and someVector2? – bill s Jun 17 '13 at 10:15
they are both {n} dimensional vector.. – asdf Jun 17 '13 at 10:54

The Kronecker product of two vectors of sizes $n$ and $m$ always gives a matrix of size $n$ by $m$. For example:

a = RandomReal[{-1, 1}, 4];
b = RandomReal[{-1, 1}, 5];
Dimensions[KroneckerProduct[a, b]]


In fact, the KroneckerProduct is just a rewriting of

Outer[Times, a, b]


and this same calculation can also be done with Table

Table[a[[i]] b[[j]], {i, 1, Length[a]}, {j, 1, Length[b]}]


all of which give the same $n=4$ by $m=5$ matrix. You can turn any of the above into a vector using Flatten. Hence

Flatten[Outer[Times,a,b]]


is a vector of size $4\times 5=20$ containing the same elements as the 4 by 5 matrix.

-
I know, but I want to have a 5*4 vector, not a matrix. eg: Command[{a,b},{c,d}] = {ac, ad, bc, bd} – asdf Jun 17 '13 at 11:44
See change... Flatten[Outer[Times, {a, b}, {c, d}]] gives what you ask for (make sure to Clear a,b,c,d so the values don't conflict.) – bill s Jun 17 '13 at 11:58
THANKS!!!! It works! :D – asdf Jun 17 '13 at 12:06