Is there documentation that explains how Mathematica functions handle vectors and matrices. I assume there is some simple reasoning for when {a,b} is a column and when it’s a row that would allow me to avoid detouring through MatrixForm[] trial and error before using a matrix.
Well, short answer is “yes” there is lots of documentation on how MMA handles vectors and matrices, but without knowing what in particular you’re struggling with, it’s hard to point you in the right direction. Without any context, I think the only thing I can tell you is that it’s probably best to stop thinking in terms of rows and columns and start thinking in terms of indices.
But if you can give an example of something that’s giving you problems, I could provide more help.
Mathematica does not distinguish between row and column vectors. One would expect {a,b} to be a row vector. But for dot multiplication with matrices Mathematica will coerce it into a column vector if required for conformation. To create an explicit column vector you can construct it as a matrix with two rows and one column.
In the related post “row vs column vectors” below, @eric3 gives a very good explanation of this.
MatrixForm[] is only visual thing. The doc page linked below is useful. Quoting it:
It is important to realize that you can use “dot” for both left- and right-multiplication of vectors by matrices. The Wolfram Language makes no distinction between “row” and “column” vectors. Dot carries out whatever operation is possible. (In formal terms, a.b contracts the last index of the tensor a with the first index of b.)
If you really need a column vector, you can define it as list of lists:
col = {{a}, {b}}
% // MatrixForm
Then if you have a matrix
mat = Array[c, {2, 2}]
MatrixForm[mat]
the result of the multiplication will be a column vector too:
mat . col // MatrixForm