{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# How to Think about Entanglement\n", "\n", "## Part 1: Spheres and Ellipsoids" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I want to give you a visceral sense of what entanglement is, really concretely. We're going to consider a case where entanglement can be understood in relatively simple geometric terms. We're going to start in a seemingly very specific place in our discussion of the very general phenomenon of entanglement: the sphere. And we'll see what can generalize from there.\n", "\n", "So the story begins with the sphere. \n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As you probably know, the sphere can be defined with the following equation:\n", "\n", "$ r^{2} = x^{2} + y^{2} + z^{2} $\n", "\n", "Here \\\\(r\\\\) is the radius of the sphere. We recognize that \\\\( \\sqrt{x^{2} + y^{2} + z^{2}} \\\\) is the length of the vector from the origin to the point \\\\( (x, y, z) \\\\). So this equation is true for all points of constant radius from the origin in three dimensions: in other words, a sphere.\n", "\n", "But we're too cool for that so we like to represent points on our sphere using complex numbers. First, we pick a north pole/south pole axis. Then we do the stereographic projection from the sphere to the complex plane, taken to be an infinite plane cutting the sphere at its equator. All the points on the sphere save one are projected to a unique location on the plane and so can be written as a complex number \\\\( x+iy\\\\). All except the north pole, the point of projection, which we take to be a point beyond every point along the circular planar horizon, a point at infinity. So we map:\n", "\n", "$ (x, y, z) \\rightarrow \\mathbb{C} + \\infty $\n", "\n", "But here's the thing: we need two \"coordinate charts.\"\n", "\n", "Suppose we have a function \\\\(f(x, y, z)\\\\) and we want to instead use the \\\\(f( \\mathbb{C} \\ or \\ \\infty )\\\\) version. Everything is fine until we try plugging infinity into whatever expression \\\\( f \\\\) is equal to: what do we do? Simple. We have two coordinate systems: one given by a projection from the north pole, and one given by a projection from the south pole. And if we worry about \\\\( f_{north}(\\infty) \\\\), we just take \\\\( f_{south}(0) \\\\), and vice versa. Indeed, it's as much to say: as you move around the \"Riemann sphere,\" if your coordinate systems moves with you, \\\\( \\infty \\\\) is always the point antipodal to you; and so \\\\( \\infty \\\\) acts as your \"double,\" with a coordinate chart of its own, showing you at \\\\( \\infty \\\\).\n", "\n", "We're going to come back these two \"coordinate charts\" in a surprising way soon enough." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next we have to talk about Mobius tranformations. They are the most natural thing in the \\\\( \\mathbb{C} + \\infty \\\\) world.\n", "\n", "$ f(z) = \\frac{az+b}{cz+d} $\n", "\n", "where \\\\( a, b, c, d \\\\) satisfy \\\\( ad - bc \\neq 0 \\\\). It's understood that the \\\\( z \\\\) can be a complex number or infinity, and if we need to evaluate at infinity we use our flipped coordinate chart.\n", "\n", "We can comprehend a Mobius transformation completely geometrically as a generalization of the stereographic projection. Given the points on the complex plane, first stereographically project them to the unit sphere. Then you are allowed to translate the sphere and rotate it however you like in 3D, passing it above below the plane, who cares. And then at the end, project all the points back to the same plane.\n", "\n", "\n", "\n", "These transformations are also known as \"conformal transformations\": they are 1-to-1, and they deform distances, but locally preserve angles. So that all right angles and all circles are preserved. The classic reference is:\n", "\n", "https://www.youtube.com/watch?v=0z1fIsUNhO4" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we get tired of the whole \\\\( \\mathbb{C} + \\infty \\\\) thing, we can always work with our friend the complex projective space.\n", "\n", "$ \\mathbb{C} + \\infty \\rightarrow \\begin{pmatrix} \\alpha \\\\ \\beta \\end{pmatrix} $\n", "\n", "Where if you recall: some \\\\( z \\rightarrow \\begin{pmatrix} z \\\\ 1 \\end{pmatrix}\\\\) (normalized) or \\\\( \\begin{pmatrix} 1 \\\\ 0 \\end{pmatrix} \\\\) if \\\\( \\infty \\\\).\n", "\n", "So we've traded our infinity for a second complex dimension. And now our (x, y, z) is encoded in our 2d complex projective vector up to multiplication by any (complex) scalar.\n", "\n", "Well, you'll be pleased to know that we can upgrade our Mobius transformation is a very obvious way.\n", "\n", "\\\\(f(z) = \\frac{az+b}{cz+d} \\Rightarrow \\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix}\\\\), with determinant equal to 1. These are called SL(2,\\\\(\\mathbb{C}\\\\)) matrices.\n", "\n", "Now this is a \"matrix\" group and we've seen it before. It has six \"generators\" which are just two copies of the 3 Pauli matrices, the second set of 3 being multiplied by i.\n", "\n", "$ SL(2,\\mathbb{C}) = e^{(a+bi)X + (c+di)Y + (e+fi)Z} $\n", "\n", "If we use only complex components, we get a subgroup SU(2), corresponding to the (double cover) of 3D rotations. And if we use real components too, we get also \"boosts\".\n", "\n", "This is already starting to sound like relativity.\n", "\n", "Suppose we have a point on the unit sphere. We could write it as a 4-vector:\n", "\n", "$0 = 1 - x^{2} - y^{2} - z^{2} \\rightarrow (1, x, y, z) $\n", "\n", "If, for example, we're working in the complex projective space, with a qubit, where we've taken the normalization of our state to be 1, we could form:\n", "\n", "$ \\begin{pmatrix} t \\\\ x \\\\ y \\\\ z \\end{pmatrix} = \\begin{pmatrix} \\langle \\psi \\mid \\psi \\rangle \\\\ \\langle \\psi \\mid X \\mid \\psi \\rangle \\\\ \\langle \\psi \\mid Y \\mid \\psi \\rangle \\\\ \\langle \\psi \\mid Z \\mid \\psi \\rangle \\\\ \\end{pmatrix} $\n", "\n", "One can show that the 4-vector asociated to a qubit transforming under \\\\(SL(2, \\mathbb{C})\\\\) transforms under a Lorentz transformation. In other words, a transformation that preserves: $ t^{2} - x^{2} - y^{2} - z^{2} $. These are the transformations in special relativity that take you to boosted and rotated reference frames. The 4-vector could represent the Minkowski space position of a particle \\\\((t, x, y, z)\\\\), or it could represent its momentum \\\\((E, P_{x}, P_{y}, P_{z})\\\\), where E is the energy and the P's are the momentum in the X, Y, and Z directions. More on this in a moment.\n", "\n", "We can see the correspondence plainly in the following way.\n", "\n", "Suppose we have a 4-vector \\\\( (t, x, y, z) \\\\). We can uniquely associate it to a Hermitian matrix like so:\n", "\n", "$$ H = tI + xX + yY + zZ = t\\begin{pmatrix}1 & 0 \\\\ 0 & 1 \\end{pmatrix} + x\\begin{pmatrix} 0 & 1 \\\\ 1 & 0 \\end{pmatrix} + y\\begin{pmatrix}0 & -i \\\\ i & 0 \\end{pmatrix} + z\\begin{pmatrix} 1 & 0 \\\\ 0 & -1 \\end{pmatrix} = \\begin{pmatrix} t + z & x - iy \\\\ x + iy & t - z \\end{pmatrix}$$\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import qutip as qt\n", "\n", "IXYZ = {\"I\": qt.identity(2),\\\n", " \"X\": qt.sigmax(),\\\n", " \"Y\": qt.sigmay(),\\\n", " \"Z\": qt.sigmaz()}\n", "\n", "a = qt.rand_ket(2)\n", "# normalized qubit -> 4 vector\n", "a4 = np.array([qt.expect(IXYZ[o], a) for o in [\"I\", \"X\", \"Y\", \"Z\"]])\n", "\n", "# 4-vector -> hermitian matrix\n", "# note in real life: a factor of 1/2\n", "h = sum([a4[i]*IXYZ[o]/2 for i, o in enumerate([\"I\", \"X\", \"Y\", \"Z\"])])\n", "\n", "# hermitian matrix -> 4-vector\n", "h4 = np.array([qt.expect(IXYZ[o], h) for o in [\"I\", \"X\", \"Y\", \"Z\"]])\n", "print((np.isclose(a4,h4)).all())\n", "print(h == a*a.dag())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we have a qubit \\\\( \\mid \\psi \\rangle \\\\), what we did above amounts to taking \\\\( \\mid \\psi \\rangle \\langle \\psi \\mid \\\\). \n", "\n", "We can transform hermitian matrices with \\\\(SL(2, \\mathbb{C})\\\\) by acting on them from both sides.\n", "\n", "$ H \\rightarrow UXU^{\\dagger} $\n", "\n", "What do we know about these \\\\( U \\\\) matrices? Their determinant is equal to 1. This means that as linear transformations they preserve the determinant of matrices they act on. What's the determinant of our of our 2x2 hermitians?\n", "\n", "$ \\begin{vmatrix} t + z & x - iy \\\\ x + iy & t - z \\end{vmatrix} = (t + z)(t - z) - (x + iy)(x - iy) = t^{2} - z^{2} - x^{2} - y^{2} $\n", "\n", "In other words, the determinant of the hermitian matrix is just the Lorentz norm of its corresponding 4-vector. Since \\\\(SL(2, \\mathbb{C})\\\\) matrices preserve the determinant they therefore fully represent Lorentz transformations.\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now here's an interesting fact: if, as we've seen, a hermitian matrix can be written as an outer product for some \\\\( \\psi \\\\), as \\\\( \\mid \\psi \\rangle \\langle \\psi \\mid \\\\), then: it represents a pure state, and its (x, y, z) point lies on the sphere \\\\( t^{2} = x^{2} + y^{2} + z^{2} \\\\) or \\\\( E^{2} = P_{x}^{2} + P_{y}^{2} + P_{z}^{2} \\\\) if we're working with momenta. Now this is the unit sphere if we're working with normalized states in quantum mechanics. But let's allow the state to have arbitrary norm. Then in special relativity, the corresponding 4-vector would represent the momentum of a massless particle:\n", "\n", "$ E^{2} - P_{x}^{2} - P{y}^{2} - P_{z}^{2} = m^{2} $ for \\\\(m = 0\\\\). \n", "\n", "And we can interpret this as a photon rushing in or out with a certain color (frequency proportional to energy) in a certain direction in 3D. The fact that a massless particle travels always at the speed of light corresponds to the fact that its 4-vector describes a point on the surface of its sphere. Picture its momentum like an arrow from the center of the sphere to that point: it can't go any faster, that's why the point lies on the surface.\n", "\n", "But what if the particle does have a mass? Then it has to travel slower than the speed of light. And this corresponds to a hermitian matrix that can't be broken down into a single outer product, a rank-2 matrix, not a rank-1 matrix. And so it has to be written as a sum \\\\(a\\mid \\psi \\rangle \\langle \\psi \\mid + \\ b\\mid \\phi \\rangle \\langle \\phi \\mid \\\\). And in our representation, this corresponds to a point in the interior of the sphere. \n", "\n", "Now when we're talking about quantum mechanics, this represents a general mixed state, or density matrix for a qubit. And incidentally, the rule for density matrices generally speaking is that their eigenvalues are all positive and when normalized sum to 1. And you can see that if you take the expectation values of the X, Y, Z operators for generally entangled qubits, the resulting points lie within the interior of the sphere, the maximally mixed state being in the center.\n", "\n", "So on the one hand, we have the relativistic geometry of momentum space, which by the way, is the space *we actually see around us* on the \"celestial sphere\"; and on the other hand, we have the quantum geometry of the qubit, a little spin 1/2. And there is an intimate relationship. In what follows, we'll use the fact that it's easy to visualize relativity to visualize the quantum case.\n", "\n", "(Incidentally, a word to the wise: one can really represent a lot of classical relativity theory in this way including the \"little groups\" of particles. For a massless particle, its hermitian matrices can be expressed as the outer product of a bra and a ket: now these each have an overall complex phase, and if we rotate each of them contrary to each other before we combine them, they will combine to give the same hermitian matrix as before. So the hermitian matrix is really only defined by the bra and the ket up to an arbitrary secret phase between the two parts. Correspondingly, the little group of a massless particle is U(1), the circle group. It's the photon corkscrewing in the plane orthogonal to its motion. And we can rotate the polarization of a photon without changing its momentum and vice versa. If we have a massive particle, we can break its hermitian matrix into four parts: a sum of two outer products. Now you could wonder: what could we do to these guys that doesn't change the Hermitian matrix they represents? It turns out to be (basically) SU(2): in other words, there's a qubit hidden inside there. We won't go into the details here, but similarly to before, you separate out two parts, and if you do a 3d rotation to the one, and the opposite rotation to the other, then the hermitian matrix everyone combines into is left invariant.)\n", "\n", "This is the spin of a massive particle: the little group of a massive particle is SU(2): you can rotate its spin without changing the particle's momentum. But to expound on this would take us too far afield--we're only entering the territory to glean knowledge of quantum mechanical spins.\n", "\n", "But before we go on, let's actually see it all happen. Let's simulate the relativistic photon sphere! We'll see the classic special effects including the blue shifting in the direction of mostion!" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import qutip as qt\n", "import numpy as np\n", "import vpython as vp\n", "scene = vp.canvas(background=vp.color.white)\n", "\n", "def pure_to_four(pure):\n", " return np.array([qt.expect(qt.identity(2), pure),\\\n", " qt.expect(qt.sigmax(), pure),\\\n", " qt.expect(qt.sigmay(), pure),\\\n", " qt.expect(qt.sigmaz(), pure)])\n", "n = 10\n", "dt = 0.001\n", "pts = [np.random.randn()*qt.rand_ket(2)/2 for i in range(n)]\n", "mobius = sum([o*c for o, c in zip([qt.sigmax(), qt.sigmay(), qt.sigmaz()],\\\n", " dt*(np.random.randn(3)+1j*np.random.randn(3)))]).expm()\n", "print(np.linalg.det(mobius.full()))\n", "\n", "vsphere = vp.sphere(color=vp.color.blue, opacity=0.4)\n", "vpts = [vp.sphere(radius=0.15, make_trail=True, emissive=True) for pt in pts]\n", "\n", "for t in range(5000):\n", " for i in range(n):\n", " pts[i] = mobius*pts[i]\n", " txyz = pure_to_four(pts[i])\n", " vpts[i].pos = vp.vector(*txyz[1:]/txyz[0])\n", " vpts[i].color = vp.color.hsv_to_rgb(vp.vector(txyz[0] if txyz[0] < 0.6 else 0.6, 1,0.5))\n", " vp.rate(150)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Okay, so now comes the punchline. We can use all this machinery from classical relativity theory to visualize the entanglement between two qubits.\n", "\n", "The idea is this: suppose we have two entangled qubits A and B. We want to visualize their entanglement. So we go through all the points on the surface of A's sphere, which correspond to all of A's pure states, and form the projectors onto those points. These are all the states A might end up in due to some measurement along some axis. We then see how B is \"steered\" due to that projection. Because of the entanglement, when A ends up in a certain state, it's as if a linear map is applied to B. \n", "\n", "In other words, we can think of entanglement like a map from A to B (and vice versa). We form all possible projectors corresponding to points on the sphere and tensor them with the identity so they only act on A, say. And we project the entangled state using each projector in turn, and due to the entanglement B will be steered to a certain state. B's state will be weighted by the probability of the outcome for A, unless normalized. \n", "\n", "To visualize this, we pepper A's sphere with points, *each with a color unique to its location*. We then project A into each of those states in turn, and see where B is projected to: we take B's X, Y, Z expectation values and place a star there for B which is the same color as A's star. And for now, let's not normalize the state afterwards.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import qutip as qt\n", "import numpy as np\n", "import vpython as vp\n", "from itertools import product\n", "scene = vp.canvas(background=vp.color.white)\n", "\n", "#######################################\n", "\n", "def normalize(v):\n", " n = np.linalg.norm(v)\n", " if n != 0:\n", " return v/n\n", " else:\n", " return v\n", "\n", "def xyz_c(xyz, pole=\"south\"):\n", " x, y, z = xyz\n", " if (pole==\"south\"):\n", " if np.isclose(z,-1):\n", " return float(\"Inf\")\n", " else:\n", " return x/(1+z) + 1j*y/(1+z)\n", " elif (pole==\"north\"):\n", " if np.isclose(z,1):\n", " return float(\"Inf\")\n", " else:\n", " return x/(1-z) + 1j*y/(1-z)\n", "\n", "def c_spinor(c):\n", " if c == float('Inf'):\n", " return np.array([0,1])\n", " else:\n", " return normalize(np.array([1, c]))\n", "\n", "def xyz_spinor(xyz):\n", " return c_spinor(xyz_c(xyz))\n", "\n", "####################################################\n", "\n", "vp.scene.width = 1000\n", "vp.scene.height = 800\n", "\n", "#state = qt.rand_ket(4)\n", "state = qt.tensor(qt.rand_ket(2), qt.rand_ket(2))\n", "#state = qt.bell_state(\"00\")\n", "state.dims = [[2,2],[1,1]]\n", "\n", "N = 4\n", "XYZs = []\n", "Aprojectors = []\n", "for x in np.linspace(-1,1,N):\n", " for y in np.linspace(-1,1,N):\n", " for z in np.linspace(-1,1,N):\n", " xyz = np.array([x,y,z])\n", " if(np.linalg.norm(xyz) > 0):\n", " xyz = xyz/np.linalg.norm(xyz)\n", " XYZs.append(xyz)\n", " spinor = qt.Qobj(xyz_spinor(xyz))\n", " proj = spinor*spinor.dag()\n", " Aprojectors.append(qt.tensor(proj, qt.identity(2)))\n", "\n", "LXYZ = {\"I\": qt.tensor(qt.identity(2), qt.identity(2)),\\\n", " \"X\": qt.tensor(qt.sigmax(), qt.identity(2)),\\\n", " \"Y\": qt.tensor(qt.sigmay(), qt.identity(2)),\\\n", " \"Z\": qt.tensor(qt.sigmaz(), qt.identity(2))}\n", "RXYZ = {\"I\": qt.tensor(qt.identity(2), qt.identity(2)),\\\n", " \"X\": qt.tensor(qt.identity(2), qt.sigmax()),\\\n", " \"Y\": qt.tensor(qt.identity(2), qt.sigmay()),\\\n", " \"Z\": qt.tensor(qt.identity(2), qt.sigmaz())}\n", "\n", "vAsphere = vp.sphere(pos=vp.vector(-1.5,0,0),\\\n", " opacity=0.2, color=vp.color.blue)\n", "vAarrow = vp.arrow(pos=vAsphere.pos)\n", "vBsphere = vp.sphere(pos=vp.vector(1.5,0,0),\\\n", " opacity=0.2, color=vp.color.red)\n", "vBarrow = vp.arrow(pos=vBsphere.pos)\n", "vApts = [vp.sphere(radius=0.07,\\\n", " pos=vAsphere.pos+vp.vector(*xyz),\\\n", " color=vp.vector(*xyz))\\\n", " for i, xyz in enumerate(XYZs)]\n", "vBpts = [vp.sphere(radius=0.07,\\\n", " color=vp.vector(*xyz))\\\n", " for i, xyz in enumerate(XYZs)]\n", "\n", "def review(normalize=False):\n", " global state, XYZs, Aprojectors, LXYZ, RXYZ\n", " for i, xyz in enumerate(XYZs):\n", " b_state = (Aprojectors[i]*state).ptrace(1)\n", " b_xyz = np.array([qt.expect(qt.sigmax(), b_state),\\\n", " qt.expect(qt.sigmay(), b_state),\\\n", " qt.expect(qt.sigmaz(), b_state)])\n", " if normalize:\n", " b_xyz = b_xyz/np.linalg.norm(b_xyz)\n", " vBpts[i].pos = vBsphere.pos+vp.vector(*b_xyz)\n", " vAarrow.axis = vp.vector(qt.expect(LXYZ[\"X\"], state),\\\n", " qt.expect(LXYZ[\"Y\"], state),\\\n", " qt.expect(LXYZ[\"Z\"], state))\n", " vBarrow.axis = vp.vector(qt.expect(RXYZ[\"X\"], state),\\\n", " qt.expect(RXYZ[\"Y\"], state),\\\n", " qt.expect(RXYZ[\"Z\"], state))\n", " vp.rate(100)\n", "review()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we think of the entanglement between A and B as a map from A's sphere to B's sphere, then we can see that the image of A's sphere is an ellipsoid. In other words: a squished sphere oriented and placed within the unit sphere. Also shown are the expected values of A and B's spin axes. Cf. [Quantum Steering Ellipsoids](https://arxiv.org/abs/1303.4724) from Jetvic, Pusey, Jennings, et Rudolph for a similar construction.\n", "\n", "Look at the three different cases. When A and B are separable, the ellipsoid reduces down to B's spin axis. In other words, no matter A's state, B ends up in the same state, which it's already in. So there's no correlation between them. When A and B are generally entangled, for each state A ends up in, B's spin axis gets steered to a corresponding location. But remember this spin axis is statistical, in a quantm mechanic sense. Despite steering, there is still quantum uncertainty w/r/t B's outcome, due to the fact that even if B's spin axis gets steered, one still has to choose a axis to measure along and the answer B gives will be probabilistic. Nonetheless, A can control the variation of B around its spin axis, and this is represented by the fatness of the ellipsoid. So fatter ellipsoids are more entangled.\n", "\n", "Finally, consider the cup state, the maximally entangled state. A's sphere is mapped to another sphere! But it's flipped upside down along the Y axis. This is because the \\\\( \\mid 00 \\rangle \\ + \\mid 11 \\rangle \\\\) state is entangled specifically in terms of the Z-basis. Now we note that under a Y flip, points on the equator are mapped to themselves. In other words, if we make a measurement on A along the Z axis, then B perfectly correlates with A. But notice that if A were measured along the Y axis, then B would anticorrelate with A.\n", "\n", "Here's an interesting way to think about this. Recall before that we needed two coordinate charts to cover the Riemann sphere, one given by stereographic projection from the North Pole vs the South Pole. Well, that's just our Y flip! So when two qubits are maximally entangled we could actually view their spheres as two coordinate charts of the same sphere, the Riemann sphere!\n", "\n", "And finally, the antisymmetric state leads to A and B having inverted spheres: because the overall angular momentum between them must be 0." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "