mirror of
https://asciireactor.com/otho/phy-521.git
synced 2024-11-21 21:45:06 +00:00
388 lines
50 KiB
Plaintext
388 lines
50 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# EPR Paradox Example\n",
|
||
|
"\n",
|
||
|
"# A neutral pi meson (pi0) decays into an electron/positron (e-/e+) \n",
|
||
|
"# pair.\n",
|
||
|
"\n",
|
||
|
"# pi0 --> e+ + e- (electron-positron pair)\n",
|
||
|
"# pi0 has angular momentum l = s = 0\n",
|
||
|
"\n",
|
||
|
"# Align electron and positron detectors in opposite directions.\n",
|
||
|
"\n",
|
||
|
"# | pi0 |\n",
|
||
|
"# |e- <------ ------> e+|\n",
|
||
|
"\n",
|
||
|
"# Where hbar = 1, the measurement of the spin in some direction is \n",
|
||
|
"# +/-1 with spin state [1 0] (up) or [0 1] (down).\n",
|
||
|
"\n",
|
||
|
"# The Pauli exclusion principle with conserved angular momentum 0\n",
|
||
|
"# dictates this system must be in the singlet state \n",
|
||
|
"# chi = [1/sqrt(2) (|up+>|down-> - |down+>|up->)].\n",
|
||
|
"\n",
|
||
|
"# In this state, if the positron is measured to have spin [1 0], the \n",
|
||
|
"# electron must have spin [0 1], or vice versa. There is an equal \n",
|
||
|
"# probability to find either state during the first measurement.\n",
|
||
|
"\n",
|
||
|
"# This view is consistent with the realist view. The realist view could \n",
|
||
|
"# hold that the electron and position had those angular momenta \n",
|
||
|
"# from creation.\n",
|
||
|
"\n",
|
||
|
"# EPR assumes influences cannot propagate faster than the speed of \n",
|
||
|
"# light. \"Wave function collapse\" is apparently instantaneous, however.\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"import numpy as np\n",
|
||
|
"import matplotlib\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"import matplotlib.patches as mpatches\n",
|
||
|
"%matplotlib inline "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEXCAYAAACu1P9TAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAHGBJREFUeJzt3XucHGWd7/HP5LIh2RATWBeDhsUDIQT0EFZcRBAGEAmrBOSAEVgPCR4xB9AX3na5ygQXFFnY5SasslnYFT3gbSG6XAQZiCQkrlyOEXI5CiYkXGMCSQgJSeb88atmairVM92dmXSG5/N+vfrV0089Vf30TPW3qp56qgYkSZIkSZIkSZIkSZIkSZIkqSatwGbg4ia3o17PAE83uxEFbcTv8rAmt0MNGNDsBqhmrcQX7YFu6uye1dneQmJ70bGV808hfr+nbX1TalZvm08C7gZeBDYALwO/Bb4L/M9eak/loX5mULMboLrV8kXzy9i3ttff77eB/wW8BvyM2PC3AOOBjwGHAv+2le9xHfB9YOlWLkdNYOBL9WtpdgNKHEKE/VLgIGB5YfogeqcbZkX2UD9kl04a2ujsdz0RmAesJb643wd2rTLfTsClwPys/irgceDrwLBC3bHE3uMyYH32fAuwZw/tOQWYC6yhsyuqp+lk739e1p41wGpgNvDJKp+lzPuAq4EniN/FOmAR8A/AyELddmBG9vO/Zu2rPHbL1RsEnAk8ArxK/N4eBc6i+obibKLbZR3wLHAt8LY6PgfAB7PnH7Fl2ANsBO4vlLXSeW7jIOA+4m/8KtEt9L6S5bRl8xxaKK90N+5MHGk8B7xOrDtTqrT5NOJv9hLx2Zdk7/uJKvW1ldzDT8uZwCTgDuLL+QFgMrAfMIHo8614d1ZnN+C/gG8ROwjjgHOAG4gvKMD7ibAYni37SaIb4W+A44APZ8so+hJwFHAnEUbFkKs2fSTwi6zNvwb+JWvbROB7wL7ARTX8Pj4DHE+E+b3ZMg4AvggcAxxIbEwgQn5l9nn+g9jQVLySPQ8GZgIfARYQ/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vZClxCiJovOzaa8RXQBlV0nuQ+xxrCX2AqfX0Q5JUh/7LhHOnyHO6J9KHPrmnUcE/ZnEvUN+Rpxgyw/5GkUc8t9LDJv7LDF64Gt92HZJ5VpxD18FE4m+wL27qbMD0e93Ya5sGPFPGPJhfh7Rr5m//PorxN7+jr3RWEk1a8XAV8HtxL04unMEseIU79T3L3S9nP8h4qRS3m7ZvB/bijZKknpQS9/5XxF999cRe/FrieFjo3N19ibOwi8uzLuArkcG47KyvCVEV9C4mlstSapbLYE/mrhL4H8nroSbSgzX+kmuziiiL754KfxKomtnUK5e2WX/K+l64YkkqZfVMt61cuHHcUQwQ1wQ8iDRB9je662SJPW6WgL/j8Sd61bmyh4mTuTuSwT+SuJEbAtd9/Irt0Ot3C1vJeV33htVWD777bdfxxNPbO0tYSQpOU8Qt0XZQi1dOk9VqZcP9wXEDaWK/790bzovI6/UK96nfAzR7dOlb/+JJ56go6MjycfFF1/c9Db05/b5SPtv3x/a2JcPyq9/gipBXvRT4L10vS3vocSl7ZX/6zmbuJdI/p8PDyPuJ5If4XMXcWl6fljmZDov1JIk9ZFaAv/bxNj5mcTQyVOAfyfuuzE7q/M6cc+V84kLr44EfpBNuza3rBuJe4v8OKtzBnFvjqso/085kqReUksf/mpinP01xH+X3wD8B/Efa/K+QWxAziOOBn5F3P3upVydVUTQX0dsQFYSYd/W6Ad4K2ptbW12E7q1vbdPfac//O37QxubpdZbrzZDR9YfJUmqUUtLC1TJdm9aJkmJMPAlKREGviQlwsCXpEQY+JKUCANfkhJh4EtSIgx8SUqEgS9JiTDwJSkRBr4kJcLAl6REGPiSlAgDX5ISYeBLUiIMfElKhIEvSYkw8CUpEQa+JCXCwJekRBj4kpQIA1/SW8KAAQOYOnVqs5uxXTPwEzN37lx
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f22020bd208>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"# If information about the measurement of the wave function propagated\n",
|
||
|
"# at a finite speed, the particles could conceivably be measured such\n",
|
||
|
"# that both are equally likely to hold either spin up or spin down.\n",
|
||
|
"\n",
|
||
|
"# What would happen if the measurements were uncorrelated?\n",
|
||
|
"\n",
|
||
|
"plt.hist(np.random.randint(0,2,1000),bins=4)\n",
|
||
|
"plt.hist(np.random.randint(3,5,1000),bins=4)\n",
|
||
|
"elepatch = mpatches.Patch(color='blue', label='e-')\n",
|
||
|
"pospatch = mpatches.Patch(color='orange', label='e+')\n",
|
||
|
"#plt.legend(handles=[elepatch,pospatch])\n",
|
||
|
"plt.text(0.5,565,\"e-\",size=20)\n",
|
||
|
"plt.text(3.5,565,\"e+\",size=20)\n",
|
||
|
"\n",
|
||
|
"plt.suptitle(\"Uncorrelated Spins\",fontsize=20)\n",
|
||
|
"plt.ylim([400,600])\n",
|
||
|
"plt.xlim([-1,5])\n",
|
||
|
"plt.xticks([0.125,0.85,3.125,3.85],[\"down\",\"up\",\"down\",\"up\"])\n",
|
||
|
"plt.tick_params(axis='both',labelsize=15)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f22020419e8>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEXCAYAAACu1P9TAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAHv9JREFUeJzt3Xl8JVWZ8PFf7AaaHugFUGS1EWRXcHQcYV4hiIq8bA4qzeISdVheHJdXxQFkCa4sgqjoICjgNsMmLoDsEEABaVGQrbEHCA00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8PUW87Is/6DHE8biAuxXekeirgq4gbbO4nesi1G4JqGh2vVYj3eScDd/TeQPVJZRpDT2e8jvYf77A/A8flXUPUG8v3sSpxQ94s4vP3EHHD0ho0fm9vJU62c9Py4ueui8afi7cSn8cniL+NXhrfaXt22k7VoHEngz8P707v7e7UrnnEDWynUn2TmyRJeRpP3HY9i5hT/TAxl7vsyLRsAXG5tk1FnS2Jntt8osd7HI4lSNIy42dEcD6QyPseQFz6FR1BBPpDiXnFlxJ5yLULdaYSc3yvJPK4BxOXW18Zw7ZLkpr0XiInuvkQdSYQOcOjCmUTifxcMZgfQeSOVyuUHUb09st3kUqSlrDzGbgzspF3EgMn5Wd5/Ij626FvYOAJijUbpnV3H0EbJUnDaCZ3/jYid38a0YufT9wQs06hzubEKPqs0rozqb8y2CyVFc0mUkGbNd1qSVLLmgn46xDTq95ETPH6GDFn9peFOlOJXHz51vo+IrUzvlCv6nkYfbT20ClJUouaufGqdiPJXkRghrg54npiDmzPqLdKkjTqmgn4zxA3s/QVyn5PDORuRQT8PmIgtoP6Xv5UIl1Te6JdH9VPwZta2j7bbLNN/x13VN2EKUkawh00eBx2MwH/XqqfS1E
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f2202041dd8>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f22020419e8>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"# How many violations of angular momentum would be measured?\n",
|
||
|
"\n",
|
||
|
"# From running several simulations, it's evident a violation in the \n",
|
||
|
"# conservation of angular momentum would be measured half of the time.\n",
|
||
|
"# We can conclude that the information that the entangled particles are in\n",
|
||
|
"# orthogonal spin states is instantaneously agreed once a measurement\n",
|
||
|
"# is made.\n",
|
||
|
"\n",
|
||
|
"violations = 0\n",
|
||
|
"\n",
|
||
|
"for trial in range(0,1000):\n",
|
||
|
" elespin = np.random.randint(0,2)\n",
|
||
|
" posspin = np.random.randint(0,2)\n",
|
||
|
" if elespin == 0:\n",
|
||
|
" elespin = np.matrix('0 1')\n",
|
||
|
" else:\n",
|
||
|
" elespin = np.matrix('1 0')\n",
|
||
|
" if posspin == 0:\n",
|
||
|
" posspin = np.matrix('0 1')\n",
|
||
|
" else:\n",
|
||
|
" posspin = np.matrix('1 0')\n",
|
||
|
" \n",
|
||
|
" elespin.transpose()\n",
|
||
|
" posspin.transpose()\n",
|
||
|
" chi_squared = elespin*np.matrix('1; 0')*posspin*np.matrix('0; 1') - posspin*np.matrix('1; 0')*elespin*np.matrix('0; 1')\n",
|
||
|
" \n",
|
||
|
" if chi_squared == 0:\n",
|
||
|
" violations = violations + 1\n",
|
||
|
"\n",
|
||
|
"zeroes = np.zeros(violations,dtype=int)\n",
|
||
|
"ones = np.full((1000-violations),1,dtype=int)\n",
|
||
|
"result = np.concatenate((ones,zeroes))\n",
|
||
|
"\n",
|
||
|
"plt.ylim([400,600])\n",
|
||
|
"plt.xlim([-1,2])\n",
|
||
|
"plt.xticks([0.125,0.85],[\"violation\",\"adherence\"])\n",
|
||
|
"plt.tick_params(axis='both',labelsize=15)\n",
|
||
|
"plt.suptitle(\"Conservation Violations\",fontsize=20)\n",
|
||
|
"plt.hist([result],bins=4)\n",
|
||
|
"plt.figure()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f22020737f0>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSU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CBf607rAuL2v64vAgcTc7B/SfRvTyO+DLQ58AWi4TCcR4i+4yOJQfuriDufA4ngu52hA6Z3E/3oRxIt3/uIc/E7tJ8o8Awx++R8YqD/fGIO/RvSvh4ixh7G4tPEOXAtcXFdSkzPPYj4DI3mzkmrqNbUwuEsoP48chj4Zmer1XgbEVj70n6a1uuJD96S9HMlEWhzGDqPvGVbIix/SwTKYiLQv83QC8Y5bd4DjDx9rKz1bccVtJ+q+YNC+VcTH+qFRCvzwfT8VW22P4WYn30TEeJLiQvA1xl8az8F+AfgTuI4LyTe+9Zt3u8MqqfbtTs22xMXiMfT+hVUf0P3tWm7DzD2O9yjGDiGbxum3AKGTj+EGHA9kbjYLGPgm53vqig7g+rjsT5wKnHxWk58UedMov9/HtWflz2JFnTrOxfFc3Y27Y/dnsS58ijxzdw+2n+zs9Nz+MD03u5kYFrrXcC/M3haoyS9OEf7c5NdEUlS56YSrd/n6M78aknSBHkrMT/5KqI1/qXJrY4kqVOtf+nvMaLvfjy/eCRJkiRJkiRJkqQ2JvwfV9933337r7mm6l9tlSQN4xra/PMbk/G/ZPT3968u/wG76urt7aW3t3eyq5E1j+GaraenB9pktv9oliRlziCXpMwZ5JoQjUZjsquQPY+h2rGPXJIyYB+5JK3GDHJJypxBLkmZM8glKXMGuSRlziCXpMwZ5JKUOYNckjJnkEtS5gxyScqcQS5JmTPIJSlzBrkkZc4gl6TMGeSSlDmDXJIyZ5BLk2SjjabT09MzYT8bbTR9st+yxon/Q5A0SeJ/fJnIz0IPfvby5f8QJEm
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f2201ef4358>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f22020737f0>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"# Bell's Experiment took this a step further, to rule out locality \n",
|
||
|
"# completely. Establish the detectors to \"float\" such that they \n",
|
||
|
"# measure the components of the spins of the electron and positron \n",
|
||
|
"# along a unit vector a or b, with angles phi_a and phi_b, \n",
|
||
|
"# respectively. Compute a product P of the spins in units of hbar/2. \n",
|
||
|
"# This will give +/-1. \n",
|
||
|
"\n",
|
||
|
"# / pi0 \\\n",
|
||
|
"# /e- <------ ------> e+\\\n",
|
||
|
"\n",
|
||
|
"# QM predicts P(a,b) = -a dot b, the expectation value of the product \n",
|
||
|
"# of the spins.\n",
|
||
|
"\n",
|
||
|
"# In 1964, Bell derived the Bell inequality for a local hidden variable\n",
|
||
|
"# theory: abs(P(a,b) - P(a,c)) <= 1 + P(b,c)\n",
|
||
|
"\n",
|
||
|
"# For any local hidden variable theory, the Bell inequality must hold. \n",
|
||
|
"# It introduces a third unit vector c, which is any other unit vector \n",
|
||
|
"# than a or b.\n",
|
||
|
"\n",
|
||
|
"# Does the quantum mechanical prediction violate the Bell inequality?\n",
|
||
|
"# Testing several detector configurations in a plane, systematically \n",
|
||
|
"# from 0 to pi, we determine whether the QM prediction is consistent \n",
|
||
|
"# with a local hidden variable theory.\n",
|
||
|
"\n",
|
||
|
"violations = 0\n",
|
||
|
"trials = 0\n",
|
||
|
"for step_a in range(0,6):\n",
|
||
|
" for step_b in range (0,6):\n",
|
||
|
" phi_a = step_a/6*np.pi\n",
|
||
|
" phi_b = step_b/6*np.pi\n",
|
||
|
" phi_c = phi_a - 0.5*phi_b\n",
|
||
|
" P_ab = -1 * np.cos(phi_a - phi_b)\n",
|
||
|
" P_ac = -1 * np.cos(phi_a - phi_c)\n",
|
||
|
" P_bc = -1 * np.cos(phi_b - phi_c)\n",
|
||
|
" \n",
|
||
|
" bell_lhs = np.abs(P_ab - P_ac)\n",
|
||
|
" bell_rhs = 1 + P_bc\n",
|
||
|
" \n",
|
||
|
" if bell_lhs > bell_rhs:\n",
|
||
|
" violations = violations + 1\n",
|
||
|
" \n",
|
||
|
" trials = trials + 1\n",
|
||
|
" \n",
|
||
|
"zeroes = np.zeros(violations,dtype=int)\n",
|
||
|
"ones = np.full((trials-violations),1,dtype=int)\n",
|
||
|
"result = np.concatenate((ones,zeroes))\n",
|
||
|
"\n",
|
||
|
"plt.ylim([trials/2-10,trials/2+10])\n",
|
||
|
"plt.xlim([-1,2])\n",
|
||
|
"plt.xticks([0.125,0.85],[\"violation\",\"adherence\"])\n",
|
||
|
"plt.tick_params(axis='both',labelsize=15)\n",
|
||
|
"plt.suptitle(\"Hidden Locality Violations\",fontsize=20)\n",
|
||
|
"plt.hist([result],bins=4)\n",
|
||
|
"plt.figure()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f220202b080>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 5,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAEXCAYAAACwHc/gAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAHBRJREFUeJzt3XmYHVWd//F3SMKSYV9EUQRG0CgIqAwjKEyzCQ4yOoIBQSQugOsPRkXZNImjyIjzQ0EZwFHijMyAIBAWUUBpZImAKIhIIgJhS9gTkpBAMOn543suXV1d1V23t+Qk79fz3Of2rfXcuvd+6tSpU9UgSZIkSZIkSZIkSZIkSZKkEbQMuL6N6TvSPJPamGdymmf3NuZRtS2JbXleafjUNPy1I1yewZgFPDjIZWxJ9fYYahPTeo4Y5vWsslZb3gVYASxLj77Mov6H3jWAdQ5knhXJREYmAIZLeft3VQzbkuF/j19P6/i3BtOem6Y9Jr2uKvNADXY5HfRdQeliaMur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fQ3a31XuDb9OzWKEkv99GesrwLIvVlDHEIex9xv4JHgP9fMd2Jadwi4nBph5EqoLScjCFqvy8yNP2rpWHzY+Jw+EiizfAw4tCr6AQiwD9FtO1eRbTv1XWrk3L2TqJ/8rVEbfw7y7c4Ut/2I9o1y/f0KFqTaIs7uTBsHNHu9a/DVzRpuWnd6e8pou1+OC88kgbtJ8RJuL7sSXypy/d4+AHVl9NKkoZIkzPsOxNt498lat3PE93kihdsjCfOJt9XmncGfdfkJUmD1CTIX0V0H9qe6ML0EaKvZ/FeEhsQXXvKF67MJZpY7K8uScOkScC2LoR5L91Xu80heqV00PNG8pKkEdYkyJ8lrjScWxh2M3ECdFsiyOcSl/COometvHXP5h7
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f22020bdb38>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x7f220202b080>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"# It is seen that the QM prediction disagrees with a local hidden \n",
|
||
|
"# variable theory in a significant number of configurations.\n",
|
||
|
"\n",
|
||
|
"# On average, for random orientations between 0 and pi, how often? \n",
|
||
|
"# After running several trials, it appears to be about half of the, \n",
|
||
|
"# which is what one would expect from the quantum mechanical\n",
|
||
|
"# prediction.\n",
|
||
|
"\n",
|
||
|
"violations = 0\n",
|
||
|
"trials = 0\n",
|
||
|
"for rand_a in range(0,10):\n",
|
||
|
" for rand_b in range (0,10):\n",
|
||
|
" phi_a = np.random.rand(1)*np.pi\n",
|
||
|
" phi_b = np.random.rand(1)*np.pi\n",
|
||
|
" phi_c = phi_a - 0.5*phi_b\n",
|
||
|
" P_ab = -1 * np.cos(phi_a - phi_b)\n",
|
||
|
" P_ac = -1 * np.cos(phi_a - phi_c)\n",
|
||
|
" P_bc = -1 * np.cos(phi_b - phi_c)\n",
|
||
|
" \n",
|
||
|
" bell_lhs = np.abs(P_ab - P_ac)\n",
|
||
|
" bell_rhs = 1 + P_bc\n",
|
||
|
" \n",
|
||
|
" if bell_lhs > bell_rhs:\n",
|
||
|
" violations = violations + 1\n",
|
||
|
" \n",
|
||
|
" trials = trials + 1\n",
|
||
|
"\n",
|
||
|
"zeroes = np.zeros(violations,dtype=int)\n",
|
||
|
"ones = np.full((trials-violations),1,dtype=int)\n",
|
||
|
"result = np.concatenate((ones,zeroes))\n",
|
||
|
"\n",
|
||
|
"plt.ylim([trials/2-10,trials/2+10])\n",
|
||
|
"plt.xlim([-1,2])\n",
|
||
|
"plt.xticks([0.125,0.85],[\"violation\",\"adherence\"])\n",
|
||
|
"plt.tick_params(axis='both',labelsize=15)\n",
|
||
|
"plt.suptitle(\"Hidden Locality Violations\",fontsize=20)\n",
|
||
|
"plt.hist([result],bins=4)\n",
|
||
|
"plt.figure()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 6,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# The prediction (Bell's inequality) made by assuming a local hidden\n",
|
||
|
"# variable is violated by a significant number of the possibile \n",
|
||
|
"# bborientations. This simulation cannot determine which theory is\n",
|
||
|
"# correct, but the QM prediction has been confirmed through experiment.\n",
|
||
|
"# No hidden local variable holds actionable information about the \n",
|
||
|
"# state. Entangled states retain their entanglement in a non-local \n",
|
||
|
"# nature."
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 7,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.4.3"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|