I have this simple example in which I am trying to write a column vector (ket vector) and then I want to normalize it. It seems that ther is something wrong, leading to an error message
"The first argument is not a number or a vector,... "
myVec = {{1}, {2}};
Normalize[myVec]
How can one fix this. What is the best way of writing a ket vector and bra vector in Mathematica?
Edit: Related to some comments below, I want to added the following:
mat1 = {{1}, {2}};
Dimensions[mat1](*(2,1)*)
mat2 = {{1, 2}};
Dimensions[mat2](*(1,2)*)
mat3 = {1, 2};
Dimensions[mat3](*(2)*)
myVec = {1, 2}
$\endgroup$Normalize
accepts a vector, in Wolfram language, which means aList
with anArrayDepth
1; a row/column vector is represented by a matrix (aList
ofList
s) with anArrayDepth
2, unacceptable. $\endgroup$