#OK to post homework #Joseph Koutsoutis, 02-23-2025, Assignment 8 read `C8.txt`: #1 TestExpMV := proc() local M, V, i: for i from 1 to 3 do: M := RHM(3,10): V := RSV(3,10): print(Re(evalf(ProbDist(M, V)[3])), evalf(ExpMV(M,V))): od: end: #2 TestPMExpSums := proc() local V, i, j: for i from 1 to 3 do: V := RSV(2, 100): print(add(ExpMV(PM()[j], V)^2, j=1..3)): od: end: #3 EntanglementAlice := proc(V) local Ax, Ay, Az: Ax := TP(PM()[1], PM()[4]): Ay := TP(PM()[2], PM()[4]): Az := TP(PM()[3], PM()[4]): ExpMV(Ax, V)^2 + ExpMV(Ay, V)^2 + ExpMV(Az, V)^2: end: #4 RandomProductState4 := proc(K): op(TP([RSV(2, K)], [RSV(2, K)])): end: #5 #I found that EntanglementAlice(V) outputted 0 for V = ES()[i], i=1..4, #and 1 for V = RandomProductState4(K). #TestRSVEntanglement takes 20 vectors RSV(4,10) and outputs a list of the form #[[max_entanglement, max_entanglement_vector], [least_entanglement, least_entanglement_vector]] TestRSVEntanglement := proc() local i, most, most_V, least, least_V, V, ent: most := 1: least := 0: for i from 1 to 20 do: V := RSV(4, 10): ent := evalf(EntanglementAlice(V)): if ent <= most then: most := ent: most_V := V: fi: if ent >= least then: least := ent: least_V := V: fi: od: [[most, most_V], [least, least_V]]: end: #TestRSVEntanglement outputted: #[[0.05895075700, # [(-1/94 - 4*I/141)*sqrt(282), (1/47 + I/47)*sqrt(282), # (-4/141 - I/47)*sqrt(282), (-1/47 - I/282)*sqrt(282)]], # [0.9562637307, # [(2/199 + 5*I/199)*sqrt(199), (-10/199 - 5*I/199)*sqrt(199), # (2/199 + 3*I/199)*sqrt(199), (-4/199 - 4*I/199)*sqrt(199)]]] #6 EntanglementBob := proc(V) local Bx, By, Bz: Bx := TP(PM()[4], PM()[1]): By := TP(PM()[4], PM()[2]): Bz := TP(PM()[4], PM()[3]): ExpMV(Bx, V)^2 + ExpMV(By, V)^2 + ExpMV(Bz, V)^2: end: #I found that EntanglementBob(V) outputted 0 for V = ES()[i], i=1..4, #and 1 for V = RandomProductState4(K). TestRSVEntanglementBob := proc() local i, most, most_V, least, least_V, V, ent: most := 1: least := 0: for i from 1 to 20 do: V := RSV(4, 10): ent := evalf(EntanglementBob(V)): if ent <= most then: most := ent: most_V := V: fi: if ent >= least then: least := ent: least_V := V: fi: od: [[most, most_V], [least, least_V]]: end: #TestRSVEntanglementBob outputted: #[[0.05895075700, # [(-1/94 - 4*I/141)*sqrt(282), (1/47 + I/47)*sqrt(282), # (-4/141 - I/47)*sqrt(282), (-1/47 - I/282)*sqrt(282)]], # [0.9562637307, # [(2/199 + 5*I/199)*sqrt(199), (-10/199 - 5*I/199)*sqrt(199), # (2/199 + 3*I/199)*sqrt(199), (-4/199 - 4*I/199)*sqrt(199)]]]