I have a N x N complex NumPy array U_0 and I have to do manipulation with it :
First, how can I increase the array with zero efficiently ? I can simply copy it into an np.zeros((2N-1, 2N-1)) but maybe you guys know a better method. Thanks to Alexander Riedel for answer this question with the solution of numpy.pad
Second, I tried with
b = np.array([1,2,3])
I saw on previous post to transpose a 1D vector you can do
b_T = b[..., None]
# or
b_T = np.atleast_2d(b).T
but when I try b_T.dot(b)
I get shapes (3,1) and (3,) not aligned: 1 (dim 1) != 3 (dim 0)
. I don't know how to get b into a shape of (1,3) instead of (3,).
Thanks