{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "
\n", "

# Electron Spin

\n", "
\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": [ "

## Contents

\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "

## ^ Setup Cell

" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "%autosave 0\n", "%matplotlib inline\n", "from sglib import *\n", "from sympy import sqrt, cos, sin, pi, Rational\n", "set_font_size(3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "

## ^ Superposition Spin Problem

\n", "

\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", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "# Define the given state (any superposition in x,y, or z)\n", "psi = frac(1,2)*ket_from_symbol('+z')\\\n", " + frac(sqrt(3),2)*ket_from_symbol('-z')\n", "#psi = ket_from_symbol('-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)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

### Section 6.1 spin problems

\n", "

\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." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "Print('6.1-1: we want +')\n", "psi = ( frac(1,sqrt(2))*ket_from_symbol('+z')\n", " + frac(1,sqrt(2))*ket_from_symbol('-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_from_symbol('+z')\n", " + frac(1,sqrt(2))*ket_from_symbol('-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_from_symbol('+x')\n", " - frac(3,5)*ket_from_symbol('-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_from_symbol('+y')\n", " + frac(1,sqrt(10))*ket_from_symbol('-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_from_symbol('+x')\n", " + frac(3+i,sqrt(51))*ket_from_symbol('-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_from_symbol('+z')\n", " + frac(1+2*i,sqrt(10))*ket_from_symbol('-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_from_symbol('+z')\n", " + frac(1+5*i,sqrt(35))*ket_from_symbol('-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_from_symbol('+z')\n", " + frac(3+4*i,5*sqrt(2))*ket_from_symbol('-z') )\n", "meas_basis = 'x'\n", "superposition_spin_problem(psi, meas_basis, quiet=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

\n", "\n", "

## ^ Arbitrary Direction Spin Problem

\n", "

" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true }, "outputs": [], "source": [ "s_2 = col(1/sqrt(2), 0, 1/sqrt(2)) # This is +45 in the Notes\n", "#s_2 = col(0, 1/sqrt(2), 1/sqrt(2))\n", "#s_2 = col(1/sqrt(2), 1/sqrt(2), 0)\n", "\n", "#p60 = col( sqrt(3)/2, 0, -Rational(1,2) ) # my |+60> state from Feb 2018\n", "#m60 = -p60\n", "#s_2 = p60\n", "\n", "s_1 = col(0,0,1)\n", "#s_1 = col(1,0,0)\n", "#s_1 = col(0,1,0)\n", "\n", "arbitrary_spin_problem(s_1, s_2, exact=False, ndigs=3, draw_box=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "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.6.5" } }, "nbformat": 4, "nbformat_minor": 1 }