[Numpy-discussion] Can you help me find a dumb matrix multiply mistake
Fri Feb 26 18:43:04 CST 2010
Argh! I mixed up where the .H went!!
Thanks for pointing out the mistake. Thought it was something mindless.
On Fri, Feb 26, 2010 at 2:18 PM, <email@example.com> wrote:
> On Fri, Feb 26, 2010 at 4:01 PM, Rick Muller <firstname.lastname@example.org> wrote:
> > I'm making a mistake here, one that I suspect is a dumb error. I'm not as
> > familiar with the math of complex hermetian matrices as I am with real
> > symmetry matrices.
> > I want to diagonalize the matrix:
> > Y = matrix([[0,-1j],[1j,0]]) # this is the Y Pauli spin matrix
> > Ey,Uy = eigh(Y)
> > When I try to do:
> > print Uy.H * diag(Ey) * Uy
> > rather than getting Y back, I get:
> > [[ 0.+0.j -1.+0.j]
> > [-1.+0.j 0.+0.j]]
> to get Y back:
> >>> Uy * np.diag(Ey) * Uy.H
> matrix([[ 0.+0.j, 0.-1.j],
> [ 0.+1.j, 0.+0.j]])
> >>> Uy * np.diag(Ey) * Uy.H - Y
> matrix([[ 0. +0.00000000e+00j, 0. +2.22044605e-16j],
> [ 0. -2.22044605e-16j, 0. +0.00000000e+00j]])
> > I also tried
> > dot(Uy.H,dot(diag(Ey),Uy))
> > to make sure this isn't a matrix/array problem with the same result. Can
> > someone spot what I'm doing wrong?
> > --
> > Rick Muller
> > email@example.com
> > 505-750-7557
> > _______________________________________________
> > NumPy-Discussion mailing list
> > NumPy-Discussion@scipy.org
> > http://mail.scipy.org/mailman/listinfo/numpy-discussion
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion