Based on the answer to this question, I've written a macro that returns a dot product with the top of the column array lined up properly with the top of the row array.
\documentclass{amsart}
\newcommand{\myDotProduct}[3]{
\begin{array}{@{}c@{}}
\begin{bmatrix}
#1
\end{bmatrix} #3
\end{array}
\begin{bmatrix}
#2
\end{bmatrix}
\mathstrut
}
\begin{document}
\begin{align*}
\myDotProduct{a & b}{z_1 \\ z_2}{\\ \\}
\end{align*}
\end{document}
It would be much more satisfactory if I could eliminate the third argument, by counting the number of \\'s that appear in the second argument, then using \expr to add one to this count, and then inserting the required number of \\'s in the appropriate place. But
I don't know how to count the number of occurrences of
\\in the second argumentI don't know how to implement the concept: output
nreplicas of\\
If there's no answer to (1) but an answer to (2), then a second best solution would be to replace the third argument {\\ \\} in the above macro with {2}, then use the answer to (2) to do the rest.

