Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Unentangled photon case using semiclassical Malus's law
- import math
- import random
- random.seed()
- #Insert whatever you want here for the polarizer angles in radians
- a=0.8
- b=3.1
- trials = 10000
- successes = 0.0
- #Fire pair of photons with same polarization at parallel detectors
- for x in range(1,trials):
- m=0
- n=0
- #Photon a goes through polarizer a
- if(random.random() <= math.cos(a)**2):
- m=1
- #Photon b goes through polarizer b
- if(random.random() <= math.cos(b)**2):
- n=1
- if(m==1 and n==1):
- successes = successes + 1 #Both photons in the pair made it through
- print("Dual pass rate is " + str((successes/trials)))
- print("cos^2(a)cos^2(b) is " + str((math.cos(a)**2 * math.cos(b)**2)))
- 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