Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Photon(Enum):
- HORIZONTAL = 1
- VERTICAL = 2
- class Detector(Enum):
- PLUS = 1
- MINUS = 2
- ...
- σ1 = (Photon.HORIZONTAL if random() < 0.5
- else Photon.VERTICAL)
- σ2 = (Photon.VERTICAL if σ1 == Photon.HORIZONTAL
- else Photon.HORIZONTAL)
- r1 = random()
- x1 = (cos(ζ1) if σ1 == Photon.HORIZONTAL else sin(ζ1))
- τ1 = (Detector.PLUS if r1 < x1 * x1 else Detector.MINUS)
- r2 = random()
- x2 = (cos(ζ2) if σ2 == Photon.HORIZONTAL else sin(ζ2))
- τ2 = (Detector.PLUS if r2 < x2 * x2 else Detector.MINUS)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement