Advertisement
chemoelectric

eprb_simulation.adb

Aug 21st, 2023 (edited)
1,983
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 25.54 KB | Source Code | 0 0
  1. --********************************************************************
  2. -- This is free and unencumbered software released into the public domain.
  3.  
  4. -- Anyone is free to copy, modify, publish, use, compile, sell, or
  5. -- distribute this software, either in source code form or as a compiled
  6. -- binary, for any purpose, commercial or non-commercial, and by any
  7. -- means.
  8.  
  9. -- In jurisdictions that recognize copyright laws, the author or authors
  10. -- of this software dedicate any and all copyright interest in the
  11. -- software to the public domain. We make this dedication for the benefit
  12. -- of the public at large and to the detriment of our heirs and
  13. -- successors. We intend this dedication to be an overt act of
  14. -- relinquishment in perpetuity of all present and future rights to this
  15. -- software under copyright law.
  16.  
  17. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  18. -- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19. -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  20. -- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  21. -- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  22. -- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  23. -- OTHER DEALINGS IN THE SOFTWARE.
  24.  
  25. -- For more information, please refer to <https://unlicense.org>
  26. ----------------------------------------------------------------------
  27.  
  28. -- A simulation of an EPR-B experiment, demonstrating that ‘Bell’s
  29. -- theorem’ assumes its conclusion and therefore is fallacious.
  30. -- (https://en.wikipedia.org/w/index.php?title=Begging_the_question&oldid=1163995745)
  31.  
  32. -- Bell’s conclusion is not proven. Indeed, because the proof is by
  33. -- counterexample, the contrary IS proven: hidden variable theories
  34. -- ARE possible. Therefore ‘Bell’s theorem’ is shown to be worthless,
  35. -- even if it were not begging the question: its premises are
  36. -- demonstrably false.
  37.  
  38. -- Let us list the references here, near the top:
  39.  
  40. -- [1] J. S. Bell, ‘Bertlmann’s socks and the nature of reality’,
  41. --     preprint, CERN-TH-2926 (1980).
  42. --     http://cds.cern.ch/record/142461/ (Open access, CC BY 4.0)
  43.  
  44. -- [2] A. F. Kracklauer, ‘EPR-B correlations: non-locality or
  45. --     geometry?’, J. Nonlinear Math. Phys. 11 (Supp.) 104–109
  46. --     (2004). https://doi.org/10.2991/jnmp.2004.11.s1.13 (Open
  47. --     access, CC BY-NC)
  48.  
  49. -- The simulation is written in Ada—which, if carefully used, seems to
  50. -- me a good language for conveying scientific algorithms. Also, a
  51. -- free software Ada compiler is widely available: GCC. Many readers
  52. -- can compile this program, optimized and with runtime checks, by
  53. -- saving it in a file called ‘eprb_simulation.adb’ and then running
  54. -- the command
  55.  
  56. --   gnatmake -O2 -gnata eprb_simulation
  57.  
  58. -- which will create an executable program called ‘eprb_simulation’.
  59.  
  60. -- Ada, simply put, seemed the best choice, among the programming
  61. -- languages I felt comfortable using.
  62.  
  63. -- However, if you know another language, such as Fortran, Python, or
  64. -- Common Lisp, it would be very useful for the reader’s understanding
  65. -- to translate the program from Ada into the other language.
  66.  
  67. ----------------------------------------------------------------------
  68.  
  69. pragma ada_2012;
  70. pragma wide_character_encoding (utf8);
  71.  
  72. with ada.exceptions;
  73. with ada.text_io;
  74. with ada.containers.ordered_sets;
  75. with ada.numerics;
  76. with ada.numerics.generic_elementary_functions;
  77.  
  78. procedure eprb_simulation is
  79.  
  80.   subtype range_1_to_2 is integer range 1 .. 2;
  81.  
  82.   type scalar is digits 15;     -- double precision
  83.   type scalar_pair is array (range_1_to_2) of scalar;
  84.  
  85.   use ada.text_io;
  86.   use ada.numerics;
  87.  
  88.   package scalar_elementary_functions is
  89.     new ada.numerics.generic_elementary_functions (scalar);
  90.   use scalar_elementary_functions;
  91.  
  92.   package scalar_io is new float_io (scalar);
  93.   use scalar_io;
  94.  
  95.   π   : constant scalar := pi;
  96.   π_2 : constant scalar := π / 2.0;
  97.   π_4 : constant scalar := π / 4.0;
  98.   π_8 : constant scalar := π / 8.0;
  99.  
  100.   programmer_mistake : exception;
  101.  
  102. ----------------------------------------------------------------------
  103.  
  104.   -- For the sake of reproducibility, let us write our own random
  105.   -- number generator. It will be a simple linear congruential
  106.   -- generator. The author has used one like it, in quicksorts and
  107.   -- quickselects to select the pivot. It is good enough for our
  108.   -- purpose.
  109.  
  110.   type uint64 is mod 2 ** 64;
  111.  
  112.   -- The multiplier lcg_a comes from Steele, Guy; Vigna, Sebastiano
  113.   -- (28 September 2021). ‘Computationally easy, spectrally good
  114.   -- multipliers for congruential pseudorandom number generators’.
  115.   -- arXiv:2001.05304v3 [cs.DS]
  116.  
  117.   lcg_a : constant uint64 := 16#F1357AEA2E62A9C5#;
  118.  
  119.   -- The value of lcg_c is not critical, but should be odd.
  120.  
  121.   lcg_c : constant uint64 := 1;
  122.  
  123.   seed  : uint64 := 0;
  124.  
  125.   function random_scalar
  126.   return scalar
  127.   with post => 0.0 <= random_scalar'result
  128.                 and random_scalar'result < 1.0 is
  129.     randval : scalar;
  130.   begin
  131.     -- Take the high 48 bits of the seed and divide it by 2**48.
  132.     randval := scalar (seed / (2**16)) / scalar (2**48);
  133.  
  134.     -- Update the seed.
  135.     seed := (lcg_a * seed) + lcg_c;
  136.  
  137.     return randval;
  138.   end random_scalar;
  139.  
  140.   function random_1_or_2
  141.   return range_1_to_2 is
  142.   begin
  143.     return (if random_scalar < 0.5 then 1 else 2);
  144.   end random_1_or_2;
  145.  
  146. ----------------------------------------------------------------------
  147.  
  148.   -- The simulation is of a two-arm Clauser-Aspect type
  149.   -- experiment. See [2] for description of a closely related
  150.   -- simulation. We will be referring to equation numbers in that
  151.   -- paper.
  152.  
  153.   -- The objects of our simulation are as follows.
  154.  
  155.   -- There are light pulses that we shall call photons. These are
  156.   -- randomly generated in pairs, with either a vertically polarized
  157.   -- pulse to the left and a horizontally polarized pulse to the
  158.   -- right, or vice versa. Call the polarization state φ. In our
  159.   -- simulation, these photons are assumed also to carry ‘hidden
  160.   -- variables’ called ξ. A photon generated with vertical
  161.   -- polarization has ξ=ξa, and a photon with horizontal polarization
  162.   -- has ξ=ξb. Thus the following is our representation:
  163.  
  164.   type ξ_value is (ξa, ξb, ξ_quiescent);
  165.   type photon is
  166.     record
  167.       φ : scalar;       -- The current polarization angle, in radians.
  168.       ξ : ξ_value;      -- The hidden variable. Either ξa or ξb.
  169.     end record;
  170.  
  171.   -- The following are the only possible initial photons:
  172.  
  173.   photon_vertical   : constant photon := (φ => π_2, ξ => ξa);
  174.   photon_horizontal : constant photon := (φ => 0.0, ξ => ξb);
  175.  
  176.   -- Later we will introduce special photodetectors that can measure
  177.   -- the value of a photon’s ξ. The quiescent state of such a
  178.   -- photodetector will be ξ_quiescent.
  179.  
  180.   -- Please note something carefully here: by including a ‘hidden
  181.   -- variable’ in the simulation of a photon, we are contradicting an
  182.   -- assumption in [1], which Bell attempts to justify on pages 15 and
  183.   -- 16. To quote [1]: ‘[I]t may be that it is not permissible to
  184.   -- regard the experimental settings a and b in the analyzers as
  185.   -- independent variables, as we did.’ Merely imagining hidden
  186.   -- variables, along with photodetectors able to measure the hidden
  187.   -- variables, directly contradicts ‘regarding the experimental
  188.   -- settings a and b ... as independent variables’. That we can
  189.   -- imagine such hidden variables therefore proves beyond doubt that
  190.   -- Bell’s argument is founded on a false assumption! Thus his
  191.   -- argument as a whole fails.
  192.  
  193.   -- So we have done enough already. But let us proceed with the
  194.   -- simulation, nonetheless. Doing so will help illustrate why simply
  195.   -- assuming the existence of a photon with hidden variables
  196.   -- contradicts Bell’s assumption—or, in other words, how Bell’s
  197.   -- argument is circular. Bell does the following:
  198.  
  199.   --   1. He assumes that a particle must be an ‘independent
  200.   --   variable’.
  201.  
  202.   --   2. This is equivalent to assuming that a particle has no
  203.   --   ‘hidden variables’.
  204.  
  205.   --   3. He performs various mathematical operations from this
  206.   --   assumption, concluding that a particle cannot have any hidden
  207.   --   variables.
  208.  
  209.   -- It is a classic example of someone accidentally assuming the
  210.   -- conclusion, which is an informal fallacy. There is no deductive
  211.   -- error, and yet the conclusion remains unproven.
  212.  
  213.   -- (Side note: the contrast is striking, between our simple disproof
  214.   -- by counterexample, and the sophistries at the top of page 16 of
  215.   -- [1]. Notable is Bell’s reliance on his physical intuitions,
  216.   -- employing no principles of logic and mathematics. Also he
  217.   -- overcomplicates the matter, seemingly in a struggle to visualize
  218.   -- the situation. All that one needs to visualize is a hidden
  219.   -- variable and a detector capable of measuring it! Bell obviously
  220.   -- did not realize he had to visualize a photon WITH a hidden
  221.   -- variable, rather than the photon WITHOUT a hidden variable that
  222.   -- he was used to imagining.)
  223.  
  224.   -- Next after photons, there are two polarizing beam splitters (PBS)
  225.   -- (https://en.wikipedia.org/w/index.php?title=Polarizer&oldid=1152014034#Beam-splitting_polarizers).
  226.   -- These redirect photons in proportion to the Law of Malus
  227.   -- (https://en.wikipedia.org/w/index.php?title=Polarizer&oldid=1152014034#Malus's_law_and_other_properties),
  228.   -- altering the photons’ polarization angles φ, but not their hidden
  229.   -- variables ξ.
  230.  
  231.   type pbs is
  232.     record
  233.       θ : scalar;               -- The angle of beam splitting.
  234.     end record;
  235.  
  236.   -- These are the different PBS settings, in radians, making up four
  237.   -- pairs of (left,right) settings, chosen for maximum nominal CHSH
  238.   -- contrast (=2√2):
  239.  
  240.   θ_left  : constant scalar_pair := (π_4, 0.0);
  241.   θ_right : constant scalar_pair := (π_8, 3.0 * π_8);
  242.  
  243.   -- Without loss of generality, we have specified the PBS angles in
  244.   -- the first quadrant. PBS geometry is actually a sort of ×, where
  245.   -- one of the two slopes represents one of the channels, and the
  246.   -- crossing slope represents the other.
  247.  
  248.   -- Finally, there are four photodetectors
  249.   -- (https://en.wikipedia.org/w/index.php?title=Photodetector&oldid=1168137030).
  250.   -- These are fancy new-model photodetectors: not only do they detect
  251.   -- incident photons without fail, but also they tell you the value
  252.   -- of the photon’s ξ. Their output is a ξ_value: the quiescent state
  253.   -- is ξ_quiescent, and they go to ξa or ξb to register a photon
  254.   -- detection. They can detect only one photon at a time, but the
  255.   -- experimental arrangement is such that they will encounter at most
  256.   -- one at a time.
  257.  
  258. ----------------------------------------------------------------------
  259.  
  260.   -- Here is a procedure that generates a (left,right) pair of
  261.   -- photons.
  262.  
  263.   procedure generate_photon_pair (photon_left  : out photon;
  264.                                   photon_right : out photon) is
  265.   begin
  266.     if random_1_or_2 = 1 then
  267.       photon_left := photon_vertical;
  268.       photon_right := photon_horizontal;
  269.     else
  270.       photon_left := photon_horizontal;
  271.       photon_right := photon_vertical;
  272.     end if;
  273.   end generate_photon_pair;
  274.  
  275. ----------------------------------------------------------------------
  276.  
  277.   -- The following procedure decides towards which of two
  278.   -- photodetectors a PBS will transmit a given photon. The output of
  279.   -- the procedure is the outputs of the two photodetectors. The
  280.   -- photon will have its angle of polarization altered, but the
  281.   -- photodetectors cannot measure angle of polarization. The outputs
  282.   -- are of what the photodetectors CAN measure: hidden variable
  283.   -- values.
  284.  
  285.   procedure split_beam (photon0   : photon;
  286.                         pbs0      : pbs;
  287.                         detector1 : out ξ_value;
  288.                         detector2 : out ξ_value) is
  289.   begin
  290.     detector1 := ξ_quiescent;
  291.     detector2 := ξ_quiescent;
  292.  
  293.     -- We implement the Law of Malus this way, which I think is
  294.     -- clearer than if I wrote it in terms of differences of angles—
  295.  
  296.     -- If the incident photon is polarized horizontally, then the
  297.     -- probability of transmission along channel 1 will be cos²(θ),
  298.     -- where θ is the pbs setting. Thus the probability it will
  299.     -- instead be transmitted along channel 2 is sin²(θ), and the
  300.     -- total probability of transmission is cos²(θ)+sin²(θ)=1.
  301.  
  302.     -- On the other hand, if the incident photon is polarized
  303.     -- vertically, the roles of cosine and sine will be reversed.
  304.     -- (This role reversal results from application of the identities
  305.     -- cos(π/2-x)≡sin(x) and sin(π/2-x)≡cos(x).) The probability of
  306.     -- transmission along channel 1 is sin²(θ), along channel 2 is
  307.     -- cos²(θ).
  308.  
  309.     if abs (photon0.φ) < π_4 * scalar'model_epsilon then
  310.       -- The photon is polarized horizontally.
  311.       if random_scalar < cos (pbs0.θ) ** 2 then
  312.         detector1 := photon0.ξ;
  313.       else
  314.         detector2 := photon0.ξ;
  315.       end if;
  316.     elsif abs (photon0.φ - π_2) < π_4 * scalar'model_epsilon then
  317.       -- The photon is polarized vertically.
  318.       if random_scalar < sin (pbs0.θ) ** 2 then
  319.         detector1 := photon0.ξ;
  320.       else
  321.         detector2 := photon0.ξ;
  322.       end if;
  323.     else
  324.       -- There should be only horizontally or vertically polarized
  325.       -- photons.
  326.       raise programmer_mistake;
  327.     end if;
  328.   end split_beam;
  329.  
  330. ----------------------------------------------------------------------
  331.  
  332.   -- The function one_event, below, simulates an event of the
  333.   -- simulation: from generation of a pair of photons to their
  334.   -- measurement by four photodetectors. The settings of the two PBS
  335.   -- are chosen randomly and included in the output. The output is
  336.   -- gathered into a record and given a unique identifier (so it can
  337.   -- be stored in set objects).
  338.  
  339.   current_identifier : long_integer := 1;
  340.  
  341.   type event_record is
  342.     record
  343.       identifier        : long_integer;
  344.       pbs_left_setting  : range_1_to_2;
  345.       pbs_right_setting : range_1_to_2;
  346.       detector_left_1   : ξ_value;
  347.       detector_left_2   : ξ_value;
  348.       detector_right_1  : ξ_value;
  349.       detector_right_2  : ξ_value;
  350.     end record;
  351.  
  352.   function one_event
  353.   return event_record is
  354.     ev           : event_record;
  355.     pbs_left     : pbs;
  356.     pbs_right    : pbs;
  357.     photon_left  : photon;
  358.     photon_right : photon;
  359.   begin
  360.     ev.identifier := current_identifier;
  361.     current_identifier := current_identifier + 1;
  362.  
  363.     ev.pbs_left_setting := random_1_or_2;
  364.     pbs_left.θ := θ_left(ev.pbs_left_setting);
  365.  
  366.     ev.pbs_right_setting := random_1_or_2;
  367.     pbs_right.θ := θ_right(ev.pbs_right_setting);
  368.  
  369.     generate_photon_pair (photon_left, photon_right);
  370.  
  371.     split_beam (photon_left, pbs_left,
  372.                 ev.detector_left_1, ev.detector_left_2);
  373.     split_beam (photon_right, pbs_right,
  374.                 ev.detector_right_1, ev.detector_right_2);
  375.  
  376.     return ev;
  377.   end one_event;
  378.  
  379. ----------------------------------------------------------------------
  380.  
  381.   -- We wish to simulate some number of events, and to gather the
  382.   -- output records in a set. Here is where the set type is created.
  383.  
  384.   function "<" (a, b : event_record)
  385.   return boolean is
  386.   begin
  387.     return (a.identifier < b.identifier);
  388.   end "<";
  389.  
  390.   package event_record_sets is
  391.     new ada.containers.ordered_sets (element_type => event_record);
  392.  
  393. ----------------------------------------------------------------------
  394.  
  395.   -- The following function simulates a given number of events and
  396.   -- gathers the output records into a set.
  397.  
  398.   function simulate_events (number_of_events : natural)
  399.   return event_record_sets.set is
  400.     events : event_record_sets.set;
  401.   begin
  402.     for i in 1 .. number_of_events loop
  403.       event_record_sets.include (events, one_event);
  404.     end loop;
  405.     return events;
  406.   end simulate_events;
  407.  
  408. ----------------------------------------------------------------------
  409.  
  410.   -- Now comes analysis.
  411.  
  412.   procedure analyze (events : event_record_sets.set) is
  413.  
  414.     use event_record_sets;
  415.  
  416.     events_L1R1 : set;
  417.     events_L1R2 : set;
  418.     events_L2R1 : set;
  419.     events_L2R2 : set;
  420.  
  421.     procedure separate_into_four_subsets_by_pbs_settings is
  422.       curs              : cursor;
  423.       ev                : event_record;
  424.     begin
  425.       curs := first (events);
  426.       while has_element (curs) loop
  427.         ev := element (curs);
  428.         case ev.pbs_left_setting is
  429.           when 1 =>
  430.             case ev.pbs_right_setting is
  431.               when 1 => include (events_L1R1, ev);
  432.               when 2 => include (events_L1R2, ev);
  433.             end case;
  434.           when 2 =>
  435.             case ev.pbs_right_setting is
  436.               when 1 => include (events_L2R1, ev);
  437.               when 2 => include (events_L2R2, ev);
  438.             end case;
  439.         end case;
  440.         curs := next (curs);
  441.       end loop;
  442.     end separate_into_four_subsets_by_pbs_settings;
  443.  
  444.     function estimate_correlation_coefficient (subset : set)
  445.     return scalar is
  446.       curs                   : cursor;
  447.       ev                     : event_record;
  448.       n, nLc, nLs, nRc, nRs  : scalar;
  449.       cosL, sinL, cosR, sinR : scalar;
  450.       cosLR, sinLR           : scalar;
  451.     begin
  452.  
  453.       -- We use equation (2.4) of [2] to estimate cosines and sines
  454.       -- for calculation of the correlation coefficient by equations
  455.       -- (2.3) and (2.5).
  456.       --
  457.       -- We take account of the hidden variable in this way: if ξ=ξa,
  458.       -- this indicates that the PBS followed the sine-squared law for
  459.       -- channel 1, rather than the cosine-squared law. For the hidden
  460.       -- variable tells us that the photon had a vertical angle of
  461.       -- polarization when it entered the PBS. We must, therefore,
  462.       -- count a ξ=ξa detection towards the sine estimate. By
  463.       -- contrast, and symmetrically, a ξ=ξb detection goes towards
  464.       -- the cosine estimate.
  465.       --
  466.       -- If ξ=ξ_quiescent then a detector did not receive a photon.
  467.  
  468.       n := 0.0;
  469.       nLc := 0.0;
  470.       nLs := 0.0;
  471.       nRc := 0.0;
  472.       nRs := 0.0;
  473.  
  474.       curs := first (subset);
  475.  
  476.       while has_element (curs) loop
  477.  
  478.         ev := element (curs);
  479.         if ev.detector_left_1 /= ξ_quiescent then
  480.           if ev.detector_left_1 = ξa then
  481.             nLs := nLs + 1.0;
  482.           else
  483.             nLc := nLc + 1.0;
  484.           end if;
  485.         elsif ev.detector_left_2 /= ξ_quiescent then
  486.           if ev.detector_left_2 = ξb then
  487.             nLs := nLs + 1.0;
  488.           else
  489.             nLc := nLc + 1.0;
  490.           end if;
  491.         else
  492.           -- The way the program currently works, this should not
  493.           -- happen.
  494.           raise programmer_mistake;
  495.         end if;
  496.  
  497.         if ev.detector_right_1 /= ξ_quiescent then
  498.           if ev.detector_right_1 = ξa then
  499.             nRs := nRs + 1.0;
  500.           else
  501.             nRc := nRc + 1.0;
  502.           end if;
  503.         elsif ev.detector_right_2 /= ξ_quiescent then
  504.           if ev.detector_right_2 = ξb then
  505.             nRs := nRs + 1.0;
  506.           else
  507.             nRc := nRc + 1.0;
  508.           end if;
  509.         else
  510.           -- The way the program currently works, this should not
  511.           -- happen.
  512.           raise programmer_mistake;
  513.         end if;
  514.  
  515.         n := n + 1.0;
  516.  
  517.         curs := next (curs);
  518.  
  519.       end loop;
  520.  
  521.       cosL := sqrt (nLc / n);
  522.       sinL := sqrt (nLs / n);
  523.       cosR := sqrt (nRc / n);
  524.       sinR := sqrt (nRs / n);
  525.  
  526.       -- Reference [2], Equation (2.3).
  527.       cosLR := (cosR * cosL) + (sinR * sinL);
  528.       sinLR := (sinR * cosL) - (cosR * sinL);
  529.  
  530.       -- Reference [2], Equation (2.5).
  531.       return (cosLR ** 2) - (sinLR ** 2);
  532.  
  533.     end estimate_correlation_coefficient;
  534.  
  535.     κ_L1R1, κ_L1R2      : scalar;
  536.     κ_L2R1, κ_L2R2      : scalar;
  537.     κ_nominal           : constant scalar := sqrt (0.5);
  538.     chsh_contrast       : scalar;
  539.     chsh_nominal        : constant scalar := 2.0 * sqrt (2.0);
  540.     chsh_difference     : scalar;
  541.     relative_difference : scalar;
  542.  
  543.   begin
  544.     separate_into_four_subsets_by_pbs_settings;
  545.     κ_L1R1 := estimate_correlation_coefficient (events_L1R1);
  546.     κ_L1R2 := estimate_correlation_coefficient (events_L1R2);
  547.     κ_L2R1 := estimate_correlation_coefficient (events_L2R1);
  548.     κ_L2R2 := estimate_correlation_coefficient (events_L2R2);
  549.  
  550.     chsh_contrast := κ_L1R1 + κ_L1R2 + κ_L2R1 - κ_L2R2;
  551.     chsh_difference := chsh_contrast - chsh_nominal;
  552.     relative_difference := chsh_difference / chsh_nominal;
  553.  
  554.     put_line ("  =========================");
  555.     put_line ("   no. of events:  " &
  556.               event_record_sets.length (events)'image);
  557.     put_line ("  =========================");
  558.     put_line ("   correlation coefficients");
  559.     put ("          kappa11");
  560.     put (κ_L1R1, 4, 5, 0);
  561.     put_line ("");
  562.     put ("          kappa12");
  563.     put (κ_L1R2, 4, 5, 0);
  564.     put_line ("");
  565.     put ("          kappa21");
  566.     put (κ_L2R1, 4, 5, 0);
  567.     put_line ("");
  568.     put ("          kappa22");
  569.     put (κ_L2R2, 4, 5, 0);
  570.     put_line ("");
  571.     put ("          nominal");
  572.     put (κ_nominal, 4, 5, 0);
  573.     put_line ("");
  574.     put_line ("  =========================");
  575.     put ("    CHSH contrast");
  576.     put (chsh_contrast, 4, 5, 0);
  577.     put_line ("");
  578.     put ("          nominal");
  579.     put (chsh_nominal, 4, 5, 0);
  580.     put_line ("");
  581.     put_line ("       --------------------");
  582.     put ("       difference");
  583.     put (chsh_difference, 4, 5, 0);
  584.     put_line ("");
  585.     put ("    relative diff");
  586.     put (relative_difference, 4, 5, 0);
  587.     put_line ("");
  588.     put_line ("  =========================");
  589.   end analyze;
  590.  
  591. ----------------------------------------------------------------------
  592.  
  593. -- Finally, the main program.
  594.  
  595.   number_of_events : natural := 0;
  596.  
  597. begin
  598.  
  599.   -- Simulate many events.
  600.  
  601.   seed := 12345;
  602.   number_of_events := 1000000;
  603.   analyze (simulate_events (number_of_events));
  604.  
  605. end eprb_simulation;
  606.  
  607. ----------------------------------------------------------------------
  608.  
  609. -- The condition for supposed demonstration of ‘non-locality’ is CHSH
  610. -- contrast greater than 2. The nominal value predicted by quantum
  611. -- mechanics is 2√2≅2.82843. Here is the program’s output for
  612. -- seed=12345, number_of_events=1000000:
  613.  
  614. --  =========================
  615. --   no. of events:   1000000
  616. --  =========================
  617. --   correlation coefficients
  618. --          kappa11   0.70739
  619. --          kappa12   0.70775
  620. --          kappa21   0.70710
  621. --          kappa22  -0.70741
  622. --          nominal   0.70711
  623. --  =========================
  624. --    CHSH contrast   2.82965
  625. --          nominal   2.82843
  626. --       --------------------
  627. --       difference   0.00123
  628. --    relative diff   0.00043
  629. --  =========================
  630.  
  631. -- As you can see, the CHSH contrast is essentially that which is
  632. -- predicted by quantum mechanics, and certainly exceeds the value of
  633. -- 2, which supposedly is impossible for a ‘local realistic’ model to
  634. -- achieve. We have disproven that ‘impossibility’, by counterexample.
  635.  
  636. -- (One might object this is a random simulation, not closed
  637. -- expressions. But closed expressions can be written by analogy to
  638. -- the simulation. One might write them as an exercise.)
  639.  
  640. -- However, let us go deduce further. Let us imagine that the photons
  641. -- actually do NOT have ξ values, and that the photodetectors merely
  642. -- detect photons without fail. Does anything change in the pattern of
  643. -- their detections? Not one bit. A PBS reacts only to a photon’s φ,
  644. -- its polarization angle. Therefore the correlations are exactly the
  645. -- same. We get the exact same results we did above.
  646.  
  647. -- It turns out that ξ was merely a fiction introduced so we could
  648. -- include the initial angles of polarization in the analysis stage,
  649. -- and yet make it so we were using only information actually measured
  650. -- in the experiment. We never actually needed that fiction at all,
  651. -- but could simply have included the initial angles of polarization
  652. -- in the event records.
  653.  
  654. -- Recall the quote from [1]: ‘[I]t may be that it is not permissible
  655. -- to regard the experimental settings a and b in the analyzers as
  656. -- independent variables, as we did.’ In other words, it may be that
  657. -- one must regard Bell’s a and b as functions of the initial angles
  658. -- of polarization. This is exactly what we have shown: that one must
  659. -- regard a and b as FUNCTIONS, and that the initial angle of
  660. -- polarization of one of the photons of the pair may be regarded as
  661. -- the sole independent variable.
  662.  
  663. -- Furthermore, we showed this by inventing a method whereby the
  664. -- ACTUAL independent variable is converted into a fictitious
  665. -- experimental ‘hidden variable’. Thus it is shown that assuming a
  666. -- and b must be the independent variables is equivalent to assuming
  667. -- there can be no such hidden variable. Bell has assumed away the
  668. -- ability to construct what (by ignoring his assumption) we succeeded
  669. -- in constructing: a ‘locally realistic’ hidden variable theory.
  670.  
  671. -- Note one thing more: we have shown that there is nothing necessary
  672. -- to obtain the correlations but that the light be
  673. -- polarized. ‘Entanglement’, at least in this case, is simply an
  674. -- artifact of quantum mechanics notation.
  675.  
  676. -- (Indeed, classical electromagnetic wave theory predicts the same
  677. -- correlations. See [2].)
  678.  
  679. --********************************************************************
  680. -- Some instructions for the Emacs text editor.
  681. -- local variables:
  682. -- mode: indented-text
  683. -- tab-width: 2
  684. -- end:
  685.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement