From 08bc12e1b64c20aec6273455103824294a401db6 Mon Sep 17 00:00:00 2001 From: Liu Zixiong <93533314+liu-zixiong@users.noreply.github.com> Date: Wed, 21 Feb 2024 23:22:46 +0800 Subject: [PATCH] Added EC intro + README for kitten code notebook --- tutorials/bosonic-kitten-code/README.md | 12 +++++++ .../bosonic-kitten-code.ipynb | 36 +++++++++++++++---- 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 tutorials/bosonic-kitten-code/README.md diff --git a/tutorials/bosonic-kitten-code/README.md b/tutorials/bosonic-kitten-code/README.md new file mode 100644 index 0000000..00d1475 --- /dev/null +++ b/tutorials/bosonic-kitten-code/README.md @@ -0,0 +1,12 @@ +# Bosonic 'Kitten' Code Tutorial + +This Jupyter notebook presents a tutorial for how one may implement the bosonic 'kitten' code using the Bosonic Qiskit package. +As much as possible, this notebook explains the basics of bosonic error correction at the level of an undergraduate audience. The notebook is meant to be interactive, and users are +encouraged to vary the parameters controlling the simulation as instructed within the notebook. There is also an accompanying IBM Qiskit blog article for this notebook, and +it will be linked after its publication. + +This work was produced in 2023 by Liu Zixiong as part of their PHYS 472 Independent Project in Physics course and subsequent summer research experience in Prof. Girvin's group +at Yale University. This project was supervised by Prof. Steven M. Girvin, and Dr. Kevin Smith. + +## Dependencies +* Bosonic Qiskit 11.2 \ No newline at end of file diff --git a/tutorials/bosonic-kitten-code/bosonic-kitten-code.ipynb b/tutorials/bosonic-kitten-code/bosonic-kitten-code.ipynb index 10c914f..90af8bc 100644 --- a/tutorials/bosonic-kitten-code/bosonic-kitten-code.ipynb +++ b/tutorials/bosonic-kitten-code/bosonic-kitten-code.ipynb @@ -51,15 +51,32 @@ "Z. Liu\n", "\n", "#### Contents\n", - "1. Introduction\n", - "2. Implementation of amplitude damping\n", + "1. What is error correction?\n", + "2. Error correction with the binomial 'kitten' code\n", + "3. Implementation of amplitude damping\n", "3. Implementation of Photon Number Parity Operator\n", "4. Defining error correction gates\n", "5. Implementing arbitrary gates in Bosonic Qiskit\n", "6. Full error correction circuit with Bosonic Qiskit\n", "7. References\n", "\n", - "## Introduction\n", + "## What is error correction?\n", + "\n", + "At the lowest level, information on a classical computer is stored as a sequence of ‘0’s and ‘1’s. Hence, the only error that can occur in classical systems is the bit flip error, where a ‘0’ might turn into a ‘1’ or vice versa. One way to protect the classically stored information against bit flips is to store the information redundantly. For instance, if a single bit of information is copied across multiple bits, the extra copies can be used to determine the original piece of information. This redundancy is at the heart of all classical error correction, and error correcting codes mainly differ in the amount of redundancy and the strategy with which it is introduced, as well as the method by which errors are detected and corrected. However, there is a limit to the number of errors any code can correct. If a catastrophic sequence of errors occurred where all the information, including the redundant pieces, were fully wiped, it will no longer be possible to recover the original information. \n", + "\n", + "The same idea of redundancy and limits on the number of correctable errors is also present in quantum error correction. However, it is much more complicated to create quantum error correcting codes as the quantum objects in which quantum information is stored are governed by an additional set of rules. Firstly, figuring out whether or not an error occurred poses a challenge, as the act of measurement will irreversibly change the state of the quantum object, potentially destroying any encoded quantum information. This ‘measurement backaction’ is a fundamental property of quantum mechanics and is not something that can be fixed with better measuring apparatus. \n", + "\n", + "Secondly, it is not possible to perfectly copy the information from one quantum object to another due to the implications of measurement backaction. Since measurement irreversibly changes the information stored, the quantum object must not be measured before copying the information. Yet not measuring means the information stored cannot be accessed, and thus a copy of the information cannot be made either. This ‘no-cloning’ condition makes the process of storing redundant quantum information much more challenging as a result.\n", + "\n", + "Thirdly, there are different kinds of errors that can occur in different quantum systems. For a two-level quantum system such as a qubit, information is stored as an arbitrary superposition of two possible states, $\\left|0\\right\\rangle$ and $\\left|1\\right\\rangle$. Due to the existence of superposition states, it is possible for a single qubit to have bit flip errors ($\\left|0\\right\\rangle\\leftrightarrow\\ \\left|1\\right\\rangle$), phase flip errors ($[\\left|0\\right\\rangle+\\left|1\\right\\rangle]/\\sqrt2\\leftrightarrow[\\left|0\\right\\rangle-\\left|1\\right\\rangle]/\\sqrt2$), or some combination of both. In general, quantum error correction requires us to distinguish not just the number of errors to correct, but also the type of error that is to be corrected. \n", + "\n", + "Astonishingly, it is still possible to do quantum error correction even with these strict conditions. In fact, a tremendous variety of quantum error correcting codes have been developed (just check out the aptly named [Error Correction Zoo](https://errorcorrectionzoo.org/) and see for yourself). At present, the major challenge for many qubit-based error correction protocols (i.e., protocols that encode a logical qubit in many physical qubits) is that as codes “scale-up” in the number of errors they can correct (proportional to a quantity known as the code distance), there is a corresponding increase in the number of (noisy) physical qubits over which the logical information needs to be “spread out”. But this, in turn, just creates more opportunities for errors to occur! Therefore, implementing an error correction code reliable enough to tame this vicious cycle and improve the lifetime of logical information despite the increase in additional parts is not a trivial task.\n", + "\n", + "Rather than using many physical qubits, a promising approach is to instead encode a logical qubit into a single bosonic mode, using its infinite dimensional Hilbert space to provide the “extra space” to encode redundancy and detect errors. One advantage of so-called bosonic codes is in their hardware efficiency, requiring just a single mode (in, for example, a microwave cavity) to encode an error-corrected logical qubit . A second advantage is the simplicity of the dominant error channel: photon loss. This will be further explained below. \n", + "\n", + "The potential of bosonic error correction has been recently realized experimentally in superconducting platforms, with three distinct bosonic codes demonstrated to surpass “break-even” (i.e., the lifetime of the logical qubit exceeds that of all base components in the system): the cat code [1], the GKP code [2], and the binomial code [3]. In the rest of this article, we will dive deeper into the last of these — the binomial code. We will begin by describing the basics of this code, and will ultimately show how one can simulate this code in Bosonic Qiskit. \n", + "\n", + "## Error correction with the binomial 'kitten' code\n", "\n", "The binomial code refers to a family of codes which seek to approximately correct amplitude damping noise (i.e., photon loss errors). This is especially helpful given that photon loss is the dominant error that occurs within bosonic modes. The simplest version of the binomial code is commonly referred to as the ‘kitten’ code, and is capable of correcting a single photon loss error (though multiple photon loss events can result in a logical error, as we will see). For the purposes of this tutorial, we will model a qumode undergoing photon loss errors, with error correction applied. \n", "\n", @@ -274,7 +291,7 @@ "\\ket{1_L} &\\rightarrow \\ket{1_L}\n", "\\end{align*}\n", "\n", - "To first order, it can be shown that $\\cos{\\frac{\\theta}{2}} \\approx 1$ and $\\sin{\\frac{\\theta}{2}} \\approx \\kappa t$, where $\\kappa$ is a constant describing the rate of photon loss [1]. Therefore, we can express $\\hat{U}_{\\text{even}}$ as\n", + "To first order, it can be shown that $\\cos{\\frac{\\theta}{2}} \\approx 1$ and $\\sin{\\frac{\\theta}{2}} \\approx \\kappa t$, where $\\kappa$ is a constant describing the rate of photon loss [4]. Therefore, we can express $\\hat{U}_{\\text{even}}$ as\n", "\\begin{align*}\n", "\\hat{U}_{\\text{even}} &= \\ket{0_L}\\left[\\frac{\\hspace{2pt}(1 + \\kappa t)\\bra{0} + (1 - \\kappa t)\\bra{4}\\hspace{2pt}}{\\sqrt{2+2(kt)^2}}\\right] + \\ket{E_2} \\left[\\frac{\\hspace{2pt}(1 - \\kappa t)\\bra{0} + (1 + \\kappa t)\\bra{4}\\hspace{2pt}}{\\sqrt{2+2(kt)^2}}\\right] + \\ket{1}\\bra{1} + \\ket{2}\\bra{2} + \\ket{3}\\bra{3}\\\\\n", "&= \\left[\\frac{\\hspace{2pt} \\ket{0}\\bra{0} + \\kappa t \\ket{4}\\bra{0} - \\kappa t \\ket{0}\\bra{4} + \\ket{4}\\bra{4} \\hspace{2pt}}{\\sqrt{1+(kt)^2}}\\right] + \\ket{1}\\bra{1} + \\ket{2}\\bra{2} + \\ket{3}\\bra{3}\n", @@ -2190,9 +2207,16 @@ "metadata": {}, "source": [ "## References\n", - "[1] Girvin, Steven M. 2021. \"Introduction to Quantum Error Correction and Fault Tolerance.\" arXiv. https://doi.org/10.48550/ARXIV.2111.08894.\n", "\n", - "[2] Albert, Victor V., and Philippe Faist. 2022. \"Binomial Code.\" The Error Correction Zoo. https://errorcorrectionzoo.org/c/binomial." + "[1] Ofek, N., Petrenko, A., Heeres, R. et al. Extending the lifetime of a quantum bit with error correction in superconducting circuits. Nature 536, 441–445 (2016).\n", + "\n", + "[2] Sivak, V., Eickbusch, A., Royer, B. et al., Real-time quantum error correction beyond break-even. Nature 616, 50-55 (2023).\n", + "\n", + "[3] Ni, Z. Li, S., Deng, X., et al. Beating the break-even point with a discrete-variable-encoded logical qubit. Nature 616, 56-60 (2023).\n", + "\n", + "[4] Girvin, Steven M. 2021. \"Introduction to Quantum Error Correction and Fault Tolerance.\" arXiv. https://doi.org/10.48550/ARXIV.2111.08894.\n", + "\n", + "[5] Albert, Victor V., and Philippe Faist. 2022. \"Binomial Code.\" The Error Correction Zoo. https://errorcorrectionzoo.org/c/binomial." ] }, {