{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# SUMMARY notebook\n", "\n", "This notebook scans the directory in which it lives to find all jupyter notebooks (other than itself) in that directory. It then prints for every notebook it finds (1) a hyperlink to the notebook, and (2) the first cell (which is always markdown) of the notebook. This way you can read a nice, automatically generated summary of all the notebooks without having to open all of them. If you find a notebook that you want to explore further, you can simply click on its link to open it." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/markdown": [ "\n", "\n", "
\n", "\n", "[formation-entanglement.ipynb] 1/6\n", "\n", "# Entanglement of Formation\n", "\n", "$$\n", " \\newcommand{\\ul}[1]{\\underline{#1}}\n", " \\newcommand{\\rvalp}[0]{{\\ul{\\alpha}}}\n", "\\newcommand{\\alp}[0]{{\\alpha}}\n", " \\newcommand{\\rvx}[0]{{\\ul{x}}}\n", "\\newcommand{\\rvy}[0]{{\\ul{y}}}\n", "$$\n", "\n", "The purpose of this notebook is to show how to use entanglish to calculate the formation entanglement of a mixed state (either pure or not pure). \n", "\n", "A closed exact formula is known, thanks to Wootters, for the\n", "entang of formation of an arbitrary mixture of 2 qubits. Class\n", "TwoQubitState of entanglish contains an implementation of said formula.\n", "In this notebook, we calculate formation entanglement for some\n", "2 qubit states using our Arimoto-Blahut inspired algorithm and\n", "compare the results to Wootters formula.\n", "\n", "We've been calculating squashed entanglement from the formula\n", "\n", "$$\n", "E_{\\rvx, \\rvy}(\\rho_{\\rvx, \\rvy})=\n", "\\frac{1}{2}\n", "{\\rm min}\\sum_\\alp w^\\alp [\n", "S(\\rho^\\alp_{\\rvx})\n", "+S(\\rho^\\alp_{\\rvy})\n", "-S(\\rho^\\alp_{\\rvx, \\rvy})]\n", "$$\n", "\n", "where the minimum is over all\n", "families of density matrices\n", "$\\{\\rho^\\alp_{\\rvx, \\rvy}|\\forall \\alp\\}$\n", "such that $\\sum_\\alp \\rho^\\alp_{\\rvx, \\rvy}=\n", "\\rho_{\\rvx, \\rvy}$. If we just add\n", "the further constraint that\n", "the states $\\rho^\\alp_{\\rvx, \\rvy}$ are pure states, then\n", "$S(\\rho^\\alp_{\\rvx, \\rvy})=0$,\n", "$S(\\rho^\\alp_{\\rvx})=S(\\rho^\\alp_{\\rvy})$,\n", "and we get precisely the definition\n", "of Entanglement of Formation for a pure or mixed state.\n", "\n", "\n", "See Entanglish-Original-Ref for a detailed explanation of the algos used in this class.\n", "\n", "**Entanglish-Original-Ref**\n", "* \"A New Algorithm for Calculating\n", "Squashed Entanglement and a Python Implementation Thereof\", by R.R.Tucci\n", "\n", "
\n", "\n", "[maximally-entangled-states.ipynb] 2/6\n", "\n", "# Maximally Entangled States\n", "$$\n", " \\newcommand{\\ul}[1]{\\underline{#1}}\n", " \\newcommand{\\rvx}[0]{{\\ul{x}}}\n", "\\newcommand{\\rvy}[0]{{\\ul{y}}}\n", "$$\n", "\n", " The purpose of this notebook is to construct a maximally entangled state vector and its\n", " corresponding density matrix, and then to calculate the \"entanglement profile\"\n", " of that state. \n", " \n", " In Entaglish, density matrices are stored in the class DenMat.\n", " That class contains attributes: num_rows, row_shape and arr.\n", " arr is a numpy array of shape=(num_rows, num_rows).\n", " row_shape is a tuple such that the product of its components is num_rows.\n", " For example, a state with row_shape=(2,3,4) consists of 3 qudits with\n", " d=2,3,4 and num_rows=24.\n", "\n", " \n", " See Entanglish-Original-Ref for an explicit definition of the maximally entangled states that we use. The basic requirement for a density matrix $\\rho_{\\rvx, \\rvy}$\n", " to be maximally entangled is for its partial trace $\\rho_{\\rvx}={\\rm tr}_\\rvy \\rho_{\\rvx, \\rvy}$ to be a diagonal matrix with all terms in the diagonal equal to the same constant. The sum of the diagonal elements must of course be one. For example, $\\rho_{\\rvx}={\\rm diag}(0.25, 0.25, 0.25, 0.25)$. (If $\\rvx$ and $\\rvy$ have different numbers of possible values, this assumes that\n", " $\\rvx$ is the one with the smaller number of values.)\n", " \n", "Given a state with num_row_axes qudits, one can define\n", "a (bipartite) entanglement for each possible bi-partitions of range(\n", "num_row_axes). By a bi-partition we mean two nonempty disjoint subsets\n", "whose union is range(num_row_axes). An entanglement profile \n", "is a dictionary mapping bi-partition half-size to a dictionary that \n", "maps each bi-partition of that half-size to its entanglement.\n", "\n", "**Entanglish-Original-Ref**\n", "* \"A New Algorithm for Calculating\n", "Squashed Entanglement and a Python Implementation Thereof\", by R.R.Tucci\n", "\n", "
\n", "\n", "[pure-state-entang.ipynb] 3/6\n", "\n", "# Pure State Entanglement\n", "$$\n", "\\newcommand{\\bra}[1]{\\langle#1|}\n", "\\newcommand{\\ket}[1]{|#1\\rangle}\n", "\\newcommand{\\ul}[1]{\\underline{#1}}\n", "\\newcommand{\\rvx}[0]{{\\ul{x}}}\n", "\\newcommand{\\rvy}[0]{{\\ul{y}}}\n", "$$\n", "\n", "The purpose of this notebook is to show how to use entanglish to\n", "calculate the entanglement of a pure state.\n", " \n", " Given a bipartite density matrix \n", " $\\rho_{\\rvx, \\rvy} = \\ket{\\psi_{\\rvx, \\rvy}}\\bra{\\psi_{\\rvx, \\rvy}}$\n", " with partial trace $\\rho_{\\rvx}={\\rm tr}_\\rvy \\rho_{\\rvx, \\rvy}$, we define\n", " its entanglement as $S(\\rho_{\\rvx})$. \n", "\n", "
\n", "\n", "[squashed-entanglement.ipynb] 4/6\n", "\n", "# Squashed Entanglement\n", "$$\n", " \\newcommand{\\ul}[1]{\\underline{#1}}\n", " \\newcommand{\\rvalp}[0]{{\\ul{\\alpha}}}\n", "\\newcommand{\\alp}[0]{{\\alpha}}\n", " \\newcommand{\\rvx}[0]{{\\ul{x}}}\n", "\\newcommand{\\rvy}[0]{{\\ul{y}}}\n", "$$\n", "\n", "The purpose of this notebook is to show how to use entanglish to\n", "calculate the squashed entanglement of a mixed state (either pure or not pure).\n", "\n", "Consider a bipartite system\n", "consisting of two parts labelled\n", "by the random variables $\\rvx$ and $\\rvy$,\n", "and\n", "described by a density matrix $\\rho_{\\rvx, \\rvy}$.\n", "The squashed entanglement of such a system\n", "is defined as\n", "\n", "$$\n", "E_{\\rvx, \\rvy}(\\rho_{\\rvx, \\rvy}) =\n", "\\frac{1}{2}\n", "\\min S(\\rvx : \\rvy|\\rvalp)\n", "\\;.\n", "$$\n", "The min()---or infimum()\n", "if one wishes to be more mathematically\n", "precise--is\n", "over all density matrices $\\rho_{\\rvx, \\rvy,\\rvalp}$\n", "such that ${\\rm tr}_\\rvalp \\; \\rho_{\\rvx, \\rvy,\\rvalp}=\n", "\\rho_{\\rvx, \\rvy}$ with $\\rho_{\\rvx, \\rvy}$ held fixed.\n", "If $\\rho_{\\rvx, \\rvy}$ is a pure state, then\n", "$E_{\\rvx, \\rvy} = S(\\rvx) = S(\\rvy)$.\n", "Entanglish-Original-Ref discusses other interesting\n", "properties of squashed entanglement\n", "\n", "Entanglish-Original-Ref also describes the algo\n", "used by Entanglish to calculate squashed entanglement. The\n", "algorithm is recursive. \n", "The number of recursive steps \n", "can be chosen by the user and is called num_ab_steps (ab stands\n", "for Arimoto-Blahut).\n", "Another parameter of the algorithm is num_hidden_states, which is the number of possible \n", "$\\rvalp$ values.\n", "\n", " \n", "**Entanglish-Original-Ref**\n", "* \"A New Algorithm for Calculating\n", "Squashed Entanglement and a Python Implementation Thereof\", by R.R.Tucci\n", "\n", "
\n", "\n", "[symmetrized-nup-states.ipynb] 5/6\n", "\n", "# Symmetrized N-up States\n", "$$\n", " \\newcommand{\\ul}[1]{\\underline{#1}}\n", " \\newcommand{\\rvalp}[0]{{\\ul{\\alpha}}}\n", "\\newcommand{\\alp}[0]{{\\alpha}}\n", " \\newcommand{\\rvx}[0]{{\\ul{x}}}\n", "\\newcommand{\\rvy}[0]{{\\ul{y}}}\n", "$$\n", "\n", "The purpose of this notebook is to construct a \"symmetrized-N-up-state\" state vector and its\n", " corresponding density matrix, and then to calculate the \"entanglement profile\"\n", " of that state. \n", " \n", " In Entaglish, density matrices are stored in the class DenMat.\n", " That class contains attributes: num_rows, row_shape and arr.\n", " arr is a numpy array of shape=(num_rows, num_rows).\n", " row_shape is a tuple such that the product of its components is num_rows.\n", " For example, a state with row_shape=(2,3,4) consists of 3 qudits with\n", " d=2,3,4 and num_rows=24.\n", " \n", " \n", " See Entanglish-Original-Ref for an explicit definition of \"symmetrized-N-up-states\". \n", " As their name implies, such states consist of NT qubits, with\n", " N qubits up (i.e, in state 1) and NT-N qubits down (i.e., in state 0).\n", " A full symmetrization operator is applied \n", " to the state so that it completely\n", " forgets which of the NT qubits are up and which are down.\n", " \n", " In\n", "Entanglish-Original-Ref, we derive an analytical formula \n", "for the entanglement of any symmetrized n-up state.\n", " \n", "Given a state with num_row_axes qudits, one can define\n", "a (bipartite) entanglement for each possible bi-partitions of range(\n", "num_row_axes). By a bi-partition we mean two nonempty disjoint subsets\n", "whose union is range(num_row_axes). An entanglement profile \n", "is a dictionary mapping bi-partition half-size to a dictionary that \n", "maps each bi-partition of that half-size to its entanglement.\n", "\n", "**Entanglish-Original-Ref**\n", "* \"A New Algorithm for Calculating\n", "Squashed Entanglement and a Python Implementation Thereof\", by R.R.Tucci\n", "\n", "\n", "\n", "
\n", "\n", "[two-qubit-states.ipynb] 6/6\n", "\n", "# Two Qubit States\n", "$$\n", " \\newcommand{\\ul}[1]{\\underline{#1}}\n", " \\newcommand{\\rvx}[0]{{\\ul{x}}}\n", "\\newcommand{\\rvy}[0]{{\\ul{y}}}\n", "\\newcommand{\\bra}[1]{\\langle#1|}\n", "\\newcommand{\\ket}[1]{|#1\\rangle}\n", "\\newcommand{\\calh}[0]{{\\cal H}}\n", "\\newcommand{\\tr}[0]{{\\rm tr }}\n", "\\newcommand{\\alp}[0]{\\alpha}\n", "$$\n", "\n", "The purpose of this notebook is to\n", "illustrate the use of entanglish's class TwoQubitState which contains \n", "methods for calculating quantities related to entanglement for\n", "2 qubit states (Bell Basis states, states that are diagonal\n", "in the Bell Basis such as Werner states, etc.)\n", "In particular, the class calculates \n", "the entanglement of formation\n", "of an arbitrary density matrix of 2 qubits." ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import os\n", "import json\n", "from IPython.display import display, Markdown\n", "\n", "# the name of this file\n", "this_fname = 'SUMMARY.ipynb'\n", "fname_to_md = {}\n", "for fname in sorted(os.listdir('./')):\n", " if fname[-6:] == '.ipynb' and fname != this_fname:\n", " # print('------------', fname)\n", " with open(fname, 'r', encoding=\"utf-8\") as f:\n", " fdata = json.load(f)\n", " fname_to_md[fname] = ''.join(fdata['cells'][0]['source'])\n", "# print(fname_to_md)\n", "pre_sep = '\\n\\n
\\n\\n'\n", "full_md = ''\n", "k = 1\n", "num_nb = len(fname_to_md)\n", "for fname, md in fname_to_md.items():\n", " sep = pre_sep\n", " sep += '[' + fname + '] ' \\\n", " + str(k) + '/' + str(num_nb) + '\\n\\n'\n", " full_md += sep + md\n", " k += 1\n", "display(Markdown(full_md))" ] }, { "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.7.6" } }, "nbformat": 4, "nbformat_minor": 2 }