{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Lab 2 - Quantum States\n", "Useful for working examples and problems with photon quantum states. You may notice some similarity to the Jones Calculus ;-)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from qutip import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "These are the polarization states:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "H = Qobj([[1],[0]])\n", "V = Qobj([[0],[1]])\n", "P45 = Qobj([[1/np.sqrt(2)],[1/np.sqrt(2)]])\n", "M45 = Qobj([[1/np.sqrt(2)],[-1/np.sqrt(2)]])\n", "R = Qobj([[1/np.sqrt(2)],[-1j/np.sqrt(2)]])\n", "L = Qobj([[1/np.sqrt(2)],[1j/np.sqrt(2)]])" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\\begin{equation*}\\left(\\begin{array}{*{11}c}0.0\\\\1.0\\\\\\end{array}\\right)\\end{equation*}" ], "text/plain": [ "Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\n", "Qobj data =\n", "[[0.]\n", " [1.]]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "V" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Devices:\n", "\n", "HWP - Half-wave plate axis at $\\theta$ to the horizontal\n", "\n", "LP - Linear polarizer, axis at $\\theta$\n", "\n", "QWP - Quarter-wave plate, axis at $\\theta$\n", "\n", "Note, these are functions so you need to call them with a specific value of theta." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "def HWP(theta):\n", " return Qobj([[np.cos(2*theta),np.sin(2*theta)],[np.sin(2*theta),-np.cos(2*theta)]]).tidyup()" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "def LP(theta):\n", " return Qobj([[np.cos(theta)**2,np.cos(theta)*np.sin(theta)],[np.sin(theta)*np.cos(theta),np.sin(theta)**2]]).tidyup()" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "def QWP(theta):\n", " return Qobj([[np.cos(theta)**2 + 1j*np.sin(theta)**2,\n", " (1-1j)*np.sin(theta)*np.cos(theta)],\n", " [(1-1j)*np.sin(theta)*np.cos(theta),\n", " np.sin(theta)**2 + 1j*np.cos(theta)**2]]).tidyup()" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = False\\begin{equation*}\\left(\\begin{array}{*{11}c}(0.500+0.500j) & (0.500-0.500j)\\\\(0.500-0.500j) & (0.500+0.500j)\\\\\\end{array}\\right)\\end{equation*}" ], "text/plain": [ "Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = False\n", "Qobj data =\n", "[[0.5+0.5j 0.5-0.5j]\n", " [0.5-0.5j 0.5+0.5j]]" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "QWP(np.pi/4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1) Check that the $|H\\rangle$ state is normalized" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "Quantum object: dims = [[1], [1]], shape = (1, 1), type = bra\\begin{equation*}\\left(\\begin{array}{*{11}c}1.0\\\\\\end{array}\\right)\\end{equation*}" ], "text/plain": [ "Quantum object: dims = [[1], [1]], shape = (1, 1), type = bra\n", "Qobj data =\n", "[[1.]]" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H.dag()*H" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To show more information on an object, use the question mark after the function or object:" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "np.sin?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 2) Converting from ket to bra:" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\\begin{equation*}\\left(\\begin{array}{*{11}c}(1.0+1.0j)\\\\(2.0-1.0j)\\\\\\end{array}\\right)\\end{equation*}" ], "text/plain": [ "Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\n", "Qobj data =\n", "[[1.+1.j]\n", " [2.-1.j]]" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "psi = Qobj([[1+1j],[2-1j]])\n", "psi" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "Quantum object: dims = [[1], [2]], shape = (1, 2), type = bra\\begin{equation*}\\left(\\begin{array}{*{11}c}(1.0-1.0j) & (2.0+1.0j)\\\\\\end{array}\\right)\\end{equation*}" ], "text/plain": [ "Quantum object: dims = [[1], [2]], shape = (1, 2), type = bra\n", "Qobj data =\n", "[[1.-1.j 2.+1.j]]" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "psi.dag()" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\\begin{equation*}\\left(\\begin{array}{*{11}c}(1.0+1.0j)\\\\(2.0-1.0j)\\\\\\end{array}\\right)\\end{equation*}" ], "text/plain": [ "Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\n", "Qobj data =\n", "[[1.+1.j]\n", " [2.-1.j]]" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "psi.dag().dag()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "the `.dag()` python method computes the \"daggar\" or the complex transpose." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1) Is `psi` normalized? If not, find the normalization constant and confirm that constant normalizes `psi`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2) Verify that the $|V\\rangle$ state is normalized" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3) Verify that the $|H\\rangle$ and $|V\\rangle$ states are orthogonal. Repeat for the other pairs of states." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 4) Calculate the horizontal component $c_H$ of the state $\\psi = \\frac{1}{\\sqrt{5}}|H\\rangle + \\frac{2}{\\sqrt{5}}|V\\rangle$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5) Verify Eq. (3.18), $P(H||45\\rangle)=\\frac{1}{2},$ (which states \"The probability that a photon prepared in the +45 state will leave a PA_HV in the Horizontal state is one half.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 6) Demonstrate that a half-wave plate at 45-degrees converts $|H\\rangle$ to $|V\\rangle$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 7) Re-create Figure 3.9 by plotting the probability P(+45) vs phase φ" ] } ], "metadata": { "kernel_info": { "name": "python3" }, "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.7.4" }, "nteract": { "version": "0.15.0" } }, "nbformat": 4, "nbformat_minor": 1 }