Guest User

Unentangled Photon Bell Experiment

a guest
May 21st, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #Unentangled photon case using semiclassical Malus's law
  2. import math
  3. import random
  4. random.seed()
  5. #Insert whatever you want here for the polarizer angles in radians
  6. a=0.8
  7. b=3.1
  8.  
  9. trials = 10000
  10. successes = 0.0
  11.  
  12. #Fire pair of photons with same polarization at parallel detectors
  13. for x in range(1,trials):
  14. m=0
  15. n=0
  16.  
  17. #Photon a goes through polarizer a
  18. if(random.random() <= math.cos(a)**2):
  19. m=1
  20.  
  21. #Photon b goes through polarizer b
  22. if(random.random() <= math.cos(b)**2):
  23. n=1
  24.  
  25. if(m==1 and n==1):
  26. successes = successes + 1 #Both photons in the pair made it through
  27.  
  28. print("Dual pass rate is " + str((successes/trials)))
  29. print("cos^2(a)cos^2(b) is " + str((math.cos(a)**2 * math.cos(b)**2)))
  30. print("cos^2(a)cos^2(a-b) is " + str((math.cos(a)**2 * math.cos(a-b)**2)))
Add Comment
Please, Sign In to add comment