"Exercise 1. Verify spin operators for two spins." sigmax = ((0,1),(1,0)) sigmay = ((0,-i),(i,0)) sigmaz = ((1,0),(0,-1)) I = ((1,0),(0,1)) S1x = 1/2 hbar kronecker(sigmax,I) S1y = 1/2 hbar kronecker(sigmay,I) S1z = 1/2 hbar kronecker(sigmaz,I) S2x = 1/2 hbar kronecker(I,sigmax) S2y = 1/2 hbar kronecker(I,sigmay) S2z = 1/2 hbar kronecker(I,sigmaz) check(S1x == 1/2 hbar ((0,0,1,0),(0,0,0,1),(1,0,0,0),(0,1,0,0))) check(S1y == 1/2 hbar ((0,0,-i,0),(0,0,0,-i),(i,0,0,0),(0,i,0,0))) check(S1z == 1/2 hbar ((1,0,0,0),(0,1,0,0),(0,0,-1,0),(0,0,0,-1))) check(S2x == 1/2 hbar ((0,1,0,0),(1,0,0,0),(0,0,0,1),(0,0,1,0))) check(S2y == 1/2 hbar ((0,-i,0,0),(i,0,0,0),(0,0,0,-i),(0,0,i,0))) check(S2z == 1/2 hbar ((1,0,0,0),(0,-1,0,0),(0,0,1,0),(0,0,0,-1))) -- total spin Sx = S1x + S2x Sy = S1y + S2y Sz = S1z + S2z S2 = dot(Sx,Sx) + dot(Sy,Sy) + dot(Sz,Sz) check(S2 == hbar^2 ((2,0,0,0),(0,1,1,0),(0,1,1,0),(0,0,0,2))) "ok" "Exercise 2. Verify expectation values for two spins." clear S1x = 1/2 hbar ((0,0,1,0),(0,0,0,1),(1,0,0,0),(0,1,0,0)) S1y = 1/2 hbar ((0,0,-i,0),(0,0,0,-i),(i,0,0,0),(0,i,0,0)) S1z = 1/2 hbar ((1,0,0,0),(0,1,0,0),(0,0,-1,0),(0,0,0,-1)) S2x = 1/2 hbar ((0,1,0,0),(1,0,0,0),(0,0,0,1),(0,0,1,0)) S2y = 1/2 hbar ((0,-i,0,0),(i,0,0,0),(0,0,0,-i),(0,0,i,0)) S2z = 1/2 hbar ((1,0,0,0),(0,-1,0,0),(0,0,1,0),(0,0,0,-1)) cpp = xpp + i ypp cpm = xpm + i ypm cmp = xmp + i ymp cmm = xmm + i ymm s = (cpp,cpm,cmp,cmm) check(dot(conj(s),S1x,s) == 1/2 hbar (cpp conj(cmp) + conj(cpp) cmp + cpm conj(cmm) + conj(cpm) cmm)) check(dot(conj(s),S1y,s) == 1/2 i hbar (cpp conj(cmp) - conj(cpp) cmp + cpm conj(cmm) - conj(cpm) cmm)) check(dot(conj(s),S1z,s) == 1/2 hbar (cpp conj(cpp) + cpm conj(cpm) - cmp conj(cmp) - cmm conj(cmm))) check(dot(conj(s),S2x,s) == 1/2 hbar (cpp conj(cpm) + conj(cpp) cpm + cmp conj(cmm) + conj(cmp) cmm)) check(dot(conj(s),S2y,s) == 1/2 i hbar (cpp conj(cpm) - conj(cpp) cpm + cmp conj(cmm) - conj(cmp) cmm)) check(dot(conj(s),S2z,s) == 1/2 hbar (cpp conj(cpp) - cpm conj(cpm) + cmp conj(cmp) - cmm conj(cmm))) -- total spin Sx = S1x + S2x Sy = S1y + S2y Sz = S1z + S2z S2 = dot(Sx,Sx) + dot(Sy,Sy) + dot(Sz,Sz) check(dot(conj(s),S2,s) == hbar^2 (2 cpp conj(cpp) + (cpm + cmp) conj(cpm + cmp) + 2 cmm conj(cmm))) "ok" "Exercise 3. Verify angle formula for two spins." clear s1 = (cos(theta1/2), sin(theta1/2) exp(i phi1)) s2 = (cos(theta2/2), sin(theta2/2) exp(i phi2)) s = kronecker(s1,s2) S1x = 1/2 hbar ((0,0,1,0),(0,0,0,1),(1,0,0,0),(0,1,0,0)) S1y = 1/2 hbar ((0,0,-i,0),(0,0,0,-i),(i,0,0,0),(0,i,0,0)) S1z = 1/2 hbar ((1,0,0,0),(0,1,0,0),(0,0,-1,0),(0,0,0,-1)) S2x = 1/2 hbar ((0,1,0,0),(1,0,0,0),(0,0,0,1),(0,0,1,0)) S2y = 1/2 hbar ((0,-i,0,0),(i,0,0,0),(0,0,0,-i),(0,0,i,0)) S2z = 1/2 hbar ((1,0,0,0),(0,-1,0,0),(0,0,1,0),(0,0,0,-1)) check(dot(conj(s),S1x,s) == 1/2 hbar sin(theta1) cos(phi1)) check(dot(conj(s),S1y,s) == 1/2 hbar sin(theta1) sin(phi1)) check(dot(conj(s),S1z,s) == 1/2 hbar cos(theta1)) check(dot(conj(s),S2x,s) == 1/2 hbar sin(theta2) cos(phi2)) check(dot(conj(s),S2y,s) == 1/2 hbar sin(theta2) sin(phi2)) check(dot(conj(s),S2z,s) == 1/2 hbar cos(theta2)) "ok" "Exercise 4. Verify expectation values for a product state." clear sigmax = ((0,1),(1,0)) sigmay = ((0,-i),(i,0)) sigmaz = ((1,0),(0,-1)) I = ((1,0),(0,1)) S1x = 1/2 hbar kronecker(sigmax,I) S1y = 1/2 hbar kronecker(sigmay,I) S1z = 1/2 hbar kronecker(sigmaz,I) S2x = 1/2 hbar kronecker(I,sigmax) S2y = 1/2 hbar kronecker(I,sigmay) S2z = 1/2 hbar kronecker(I,sigmaz) s1 = (cos(1/2 theta1), sin(1/2 theta1) exp(i phi1)) s2 = (cos(1/2 theta2), sin(1/2 theta2) exp(i phi2)) s = kronecker(s1,s2) ES1x = dot(conj(s),S1x,s) ES1y = dot(conj(s),S1y,s) ES1z = dot(conj(s),S1z,s) ES2x = dot(conj(s),S2x,s) ES2y = dot(conj(s),S2y,s) ES2z = dot(conj(s),S2z,s) check(dot(conj(s),S1x,S2x,s) == ES1x ES2x) check(dot(conj(s),S1x,S2y,s) == ES1x ES2y) check(dot(conj(s),S1x,S2z,s) == ES1x ES2z) check(dot(conj(s),S1y,S2x,s) == ES1y ES2x) check(dot(conj(s),S1y,S2y,s) == ES1y ES2y) check(dot(conj(s),S1y,S2z,s) == ES1y ES2z) check(dot(conj(s),S1z,S2x,s) == ES1z ES2x) check(dot(conj(s),S1z,S2y,s) == ES1z ES2y) check(dot(conj(s),S1z,S2z,s) == ES1z ES2z) "ok"
Run