-
Notifications
You must be signed in to change notification settings - Fork 2
/
hvt.js
62 lines (60 loc) · 2.32 KB
/
hvt.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var etc = require('./etc.js');
module.exports = [
// Standard HVT as defined in the paper in section
// "VIII. A LOCAL REALISTIC HIDDEN VARIABLE THEORY"
{
name: "VIII Example HVT",
entangle: function(p_angle) {
// "As successive pairs are produced λ changes in an unpredictable
// manner that uniformly covers the whole range of possible
// polarizations."
// We interpret this as:
var λ = p_angle + (etc.rndFn() - 0.5) * Math.PI / 2;
return [λ, λ];
},
filter: function(γ, λ) {
//x-dbg/ console.log(angle * 180 / Math.PI, hstate * 180 / Math.PI);
// "In our HVT, each photon has a polarization angle λ, but this
// polarization does not behave like polarization in quantum
// mechanics. When a photon meets a polarizer set to an angle γ, it
// will always register as Vγ if λ is closer to γ than to γ + π/2"
// We interpret this as:
return (Math.abs(γ - λ) <= Math.PI / 4)
|| (Math.abs(γ - λ) > 3 * Math.PI / 4);
}
},
{
name: "Custom Naive HVT 0",
entangle: function(p_angle) {
// We store the exact polarisation angle in the hidden state.
var λ = p_angle;
return [λ, λ];
},
filter: function(γ, λ) {
// Introduce the probability here instead via the standard
// probability formula of photon passing a polarizer.
var Θ = Math.abs(γ - λ);
var b = 1.33; // Curve fitting factor.
return etc.rndFn() < b * (0.5 + 0.5 * Math.cos(2 * Θ));
}
},
{
name: "Super Luminal HVT",
entangle: function(p_angle) {
// Shared state.
var λ = p_angle;
var fn = function(γ) {
var Θ = Math.abs(γ - λ);
var pass = (etc.rndFn() < (0.5 + 0.5 * Math.cos(2 * Θ)));
// FTL transfer of polarisation information,
// setting the polarisation of the other photon.
λ = γ + (pass? 0: Math.PI / 2);
return pass;
};
return [fn, fn];
},
filter: function(γ, state) {
return state(γ);
}
}
];