{ "metadata": { "name": "", "signature": "sha256:9eb18cf1c093aa357e52cdcbd03acecabe8b141cbacff6f81576f3e00f1cc3d6" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "
\n", "This notebook goes with section 6 of the notes. It is intended to\n", "demonstrate two different types of electron spin problems.\n", "
\n", "(1) We are given an\n", "electron in some superposition of the x, y, or z spin states.\n", "Our job is to find out the probabilities for getting a + or - spin\n", "for some specified measurement. The measurement basis specified may\n", "or may not be the same one in which the original spin was given.\n", "
\n", "(2) We are given an electron whose spin is in some arbitrary\n", "physical direction. Then we are asked to find the probabilities\n", "of + or - for a measurement done in some other arbitrary direction.\n", "This is a more complicated problem, because we first have to\n", "calculate the \"mathematical model\" spin states that represent the\n", "physical directions given.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "We are given an electron in the state $\\psi$ which is some superposition\n", "in one of the three bases x, y, or z.\n", "
\n", "We are then asked to calculate the probabilities of measuring a + or -\n", "spin in one of those three same bases. The given basis and the target\n", "basis may or may not be the same.\n", "
\n",
"You can edit \"psi\" and \"meas_basis\" in the following cell to work\n",
"the problems you're interested in. And, in the following cell, the\n",
"problems from section 6.1 have been done."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Define the given state (any superposition in x,y, or z)\n",
"psi = frac(1,2)*ket('+z') + frac(sqrt(3),2)*ket('-z')\n",
"#psi = ket('-z')\n",
"# Select the basis in which to do the measurement ( 'x', 'y', or 'z')\n",
"meas_basis = 'x'\n",
"superposition_spin_problem(psi, meas_basis)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
" \n",
"Here are the section 6.1 problems as further examples. These have\n",
"the \"quiet\" flag turned on, so they just print the answers. You can\n",
"turn that off, if you want to see the details. Note: It looks like\n",
"perhaps the answer to problem 8, as given in the notes, may be wrong."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"Print('6.1-1: we want +')\n",
"psi = frac(1,sqrt(2))*ket('+z') + frac(1,sqrt(2))*ket('-z')\n",
"meas_basis = 'z'\n",
"superposition_spin_problem(psi, meas_basis, quiet=True)\n",
"\n",
"Print('6.1-2: we want +')\n",
"psi = frac(1,sqrt(2))*ket('+z') + frac(1,sqrt(2))*ket('-z')\n",
"meas_basis = 'x'\n",
"superposition_spin_problem(psi, meas_basis, quiet=True)\n",
"\n",
"Print('6.1-3: we want +')\n",
"psi = -frac(4,5)*ket('+x') - frac(3,5)*ket('-x')\n",
"meas_basis = 'x'\n",
"superposition_spin_problem(psi, meas_basis, quiet=True)\n",
"\n",
"Print('6.1-4: we want +')\n",
"psi = frac(3,sqrt(10))*ket('+y') + frac(1,sqrt(10))*ket('-y')\n",
"meas_basis = 'z'\n",
"superposition_spin_problem(psi, meas_basis, quiet=True)\n",
"\n",
"Print('6.1-5: we want -')\n",
"psi = -frac(5+4*i,sqrt(51))*ket('+x') + frac(3+i,sqrt(51))*ket('-x')\n",
"meas_basis = 'z'\n",
"superposition_spin_problem(psi, meas_basis, quiet=True)\n",
"\n",
"Print('6.1-6: we want -')\n",
"psi = -frac(1+2*i,sqrt(10))*ket('+z') + frac(1+2*i,sqrt(10))*ket('-z')\n",
"meas_basis = 'y'\n",
"superposition_spin_problem(psi, meas_basis, quiet=True)\n",
"\n",
"Print('6.1-7: we want -')\n",
"psi = frac(3*i,sqrt(35))*ket('+z') + frac(1+5*i,sqrt(35))*ket('-z')\n",
"meas_basis = 'z'\n",
"superposition_spin_problem(psi, meas_basis, quiet=True)\n",
"\n",
"Print('6.1-8: we want -')\n",
"psi = frac(4+3*i,5*sqrt(2))*ket('+z') + frac(3+4*i,5*sqrt(2))*ket('-z')\n",
"meas_basis = 'x'\n",
"superposition_spin_problem(psi, meas_basis, quiet=True)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"6.1-1: we want +"
],
"metadata": {},
"output_type": "display_data",
"text": [
" "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"s_2 = col(1/sqrt(2), 0, 1/sqrt(2)) # This is p45 in the Bell notebook\n",
"# = col(0, 1/sqrt(2), 1/sqrt(2))\n",
"# = col(1/sqrt(2), 1/sqrt(2), 0)\n",
"# = col(0,0,1)\n",
"s_1 = col(1,0,0)\n",
"# = col(0,1,0)\n",
"\n",
"arbitrary_spin_problem(s_1, s_2, exact=False, ndigs=3, draw_box=True)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"Section 6.1 spin problems
\n",
"
\n",
"\n",
"^ Arbitrary Direction Spin Problem
\n",
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
The projection onto $s_2$ goes like this:"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
The state written in the $s_2$ basis is:"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
$(0.924)|+s_2\\rangle + (0.383)|-s_2\\rangle$"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"
"
],
"metadata": {},
"output_type": "display_data",
"text": [
"