"Exercise 1. Verify equation (2)." sigmax = ((0,1),(1,0)) sigmay = ((0,-i),(i,0)) sigmaz = ((1,0),(0,-1)) A0 = sigmaz A1 = sigmax B0 = -(sigmax + sigmaz) / sqrt(2) B1 = (sigmax - sigmaz) / sqrt(2) uu = (1,0,0,0) ud = (0,1,0,0) du = (0,0,1,0) dd = (0,0,0,1) s = (ud - du) / sqrt(2) S = dot(conj(s),kronecker(A0,B0),s) + dot(conj(s),kronecker(A0,B1),s) + dot(conj(s),kronecker(A1,B0),s) - dot(conj(s),kronecker(A1,B1),s) check(S == 2 sqrt(2)) "ok" "Exercise 2. Verify spin expectation values." I = ((1,0),(0,1)) check(dot(conj(s),kronecker(A0,I),s) == 0) check(dot(conj(s),kronecker(A1,I),s) == 0) check(dot(conj(s),kronecker(I,B0),s) == 0) check(dot(conj(s),kronecker(I,B1),s) == 0) "ok" "Exercise 3. Verify that A and B are correlated for all entangled states." s1 = (uu + dd) / sqrt(2) s2 = (uu - dd) / sqrt(2) s3 = (ud + du) / sqrt(2) S1 = dot(conj(s1),kronecker(A0,B0),s1) + dot(conj(s1),kronecker(A0,B1),s1) + dot(conj(s1),kronecker(A1,B0),s1) - dot(conj(s1),kronecker(A1,B1),s1) S2 = dot(conj(s2),kronecker(A0,B0),s2) + dot(conj(s2),kronecker(A0,B1),s2) - dot(conj(s2),kronecker(A1,B0),s2) + dot(conj(s2),kronecker(A1,B1),s2) S3 = dot(conj(s3),kronecker(A0,B0),s3) + dot(conj(s3),kronecker(A0,B1),s3) - dot(conj(s3),kronecker(A1,B0),s3) + dot(conj(s3),kronecker(A1,B1),s3) check(abs(S1) > 2) check(abs(S2) > 2) check(abs(S3) > 2) "ok"
Run