Re: [Numpy-discussion] help with applying a transform

2009-04-18 Thread Gary Ruben
I think I've answered my own question - I remembered tensordot, and the following seems to work: def transform(tx_matrix, psi1, psi2): psi = np.tensordot(tx_matrix, np.concatenate((psi1[newaxis],psi2[newaxis])),axes=1)) return psi[0], psi[1] sorry for the noise, Gary Gary R

[Numpy-discussion] help with applying a transform

2009-04-18 Thread Gary Ruben
I'm trying to work out how to apply a 2x2 transform matrix to a spinor, e.g. [psi1'] [a b][psi1] [ ] = [][] [psi2'] [c d][psi2] where [[a,b],[c,d]] is a transform matrix and psi1 and psi2 are i x j x k complex arrays representing complex scalar field data. I worked that one way