{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Accelerated Random Benchmarking" ] }, { "cell_type": "heading", "level": 2, "metadata": { "slideshow": { "slide_type": "-" } }, "source": [ "Cassandra Granade
\n", "Institute for Quantum Computing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Joint Work with** Christopher Ferrie and D. G. Cory" ] }, { "cell_type": "heading", "level": 3, "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "Abstract" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "Producing useful quantum information devices requires efficiently\n", "assessing control of quantum systems, so that\n", "we can determine whether we have implemented a desired *gate*,\n", "and refine accordingly.\n", "*Randomized benchmarking* uses symmetry to reduce the difficulty of this task.\n", "\n", "We bound the resources required for benchmarking and show that\n", "with prior information, *orders* of magnitude in accuracy can be obtained.\n", "We reach these accuracies with near-optimal resources, improving dramatically\n", "on curve fitting.\n", "Finally, we show that our approach is useful for physical devices\n", "by comparing to simulations. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Slides, references and source code are available at [https://www.cgranade.com/research/arb/](https://www.cgranade.com/research/arb/).\n", "$\\renewcommand{\\vec}[1]{\\boldsymbol{#1}}$\n", "$\\newcommand{\\ket}[1]{\\left|#1\\right\\rangle}$\n", "$\\newcommand{\\dd}{\\mathrm{d}}$\n", "$\\newcommand{\\expect}{\\mathbb{E}}$\n", "$\\newcommand{\\matr}[1]{\\mathbf{#1}}$\n", "$\\newcommand{\\T}{\\mathrm{T}}$" ] }, { "cell_type": "heading", "level": 2, "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "Compling and Hosting" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "To compile these slides, we use **nbconvert**." ] }, { "cell_type": "code", "collapsed": false, "input": [ "!ipython nbconvert --to slides --template slides.tpl slides.ipynb\n", "!mv slides.slides.html slides.html" ], "language": "python", "metadata": { "slideshow": { "slide_type": "skip" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[NbConvertApp] Using existing profile dir: u'/home/cgranade/.ipython/profile_default'\r\n", "[NbConvertApp] Converting notebook slides.ipynb to slides\r\n", "[NbConvertApp] Support files will be in slides_files/\r\n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "[NbConvertApp] Loaded template slides.tpl\r\n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "[NbConvertApp] Writing 225569 bytes to slides.slides.html\r\n" ] } ], "prompt_number": 3 }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "If you want to view them in your browser complete with speaker notes, remote control support, etc., then you need to host the slides. The [instructions for Reveal.js](https://github.com/hakimel/reveal.js/#full-setup) include directions for hosting via a library called Grunt. Unfortunately, this doesn't work well with [remot.io](http://remot.io/), as that tool requires that you serve from port 80." ] }, { "cell_type": "heading", "level": 2, "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "Configuration" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "Since we're going to display some ``'.format(src))" ], "language": "python", "metadata": { "slideshow": { "slide_type": "skip" } }, "outputs": [], "prompt_number": 3 }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Introduction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Fully characterizing large quantum systems is very difficult.\n", "\n", "- Exponentially many parameters.\n", "- Classical simulation of large quantum systems is intractable.\n", "- State preparation and measurement (SPAM) errors.\n", "\n", "For some applications, fidelity alone can be useful. Ex:\n", "\n", "- Comparison to adversarial thresholds.\n", "- Feedback for refining control.\n", "\n", "Fidelity isn't the full story, though (Puzzuoli et al, PRA **89** 022306),\n", "so some care is needed." ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Twirling" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- The Clifford group is a unitary 2-design, so conjugating a map $\\Lambda$ by random Cliffords samples from the Haar averaged channel\n", "$$\n", " W[\\Lambda](\\rho) = \\int U \\Lambda(U^\\dagger \\rho U) U^\\dagger\\ \\dd U.\n", "$$\n", "- $W$ is a *superchannel* that maps quantum channels to *depolarizing* channels that preserve their inputs with probability\n", "$$\n", " p = \\frac{d F - 1} {d - 1},\n", "$$ where $F$ is the fidelity of $\\Lambda$.\n", "\n", "> Knill et al, PRA **77** 012307 (2008). Magesan, Gambetta and Emerson, PRA **85** 042311 (2012). Wood, in preparation." ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Randomized Benchmarking" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Can't tell with one instance how much of the error is due to SPAM, how much is due to imperfect twirling.\n", "- The *decay* of fidelity with sequence length gives info, even w/ SPAM, imperfect gates.\n", "- Choose each sequence such that ideal action is identity.\n", "\n", "\n", "\n", "- Used in a wide range of experiments to characterize gatesets." ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Example of Randomized Benchmarking Data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![](files/figures/ex-signal-noninterleaved.svg)" ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Zeroth-Order Model" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "-" } }, "source": [ "$$\n", " F_g(m) = A p^m + B.\n", "$$\n", "\n", "- $A$, $B$ are constants describing SPAM errors. $F_g(m)$ is the average fidelity of a sequence of length $m$.\n", "- $1 - p$ is then the depolarizing strength of $$\n", " W[\\Lambda] = W\\left[\\expect_{C \\sim \\mathcal{C}} [\\Lambda_C] \\right],\n", "$$ taken over the implementation of each Clifford gate $C$.\n", "\n", "> Knill et al, PRA **77** 012307 (2008). Magesan, Gambetta and Emerson, PRA **85** 042311 (2012)." ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Interleaved Protocol" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Can probe performance of a desired gate by *interleaving* it into the twirling sequences.\n", "- Effective depolarizing parameter $p_{\\bar{\\mathcal{C}}} := \\tilde{p} p_{\\text{ref}}$.\n", " - $\\tilde{p}$: depolarizing parameter for the gate of interest.\n", " - $p_{\\text{ref}}$: expected depolarizing parameter, taken over gateset.\n", "\n", "For example, to measure the fidelity of $S_C$:\n", "\n", "\n", "\n", "> Magesan et al, PRL **109** 080505 (2012)." ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Example of Interleaved Model" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![](files/figures/ex-signal-interleaved.svg)\n", "\n", "$\\tilde{p} = 0.99994$, $p_{\\text{ref}} = 0.99999$" ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Finite Sampling" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Randomized benchmarking data is 0/1 data: was the initial state preserved by a random sequence of length $m$ or not?\n", "- Conventional approach: estimate $\\hat{F}_g(m)$ using $K$ sequences for each of many $m$.\n", "- Epstein et al (1308.2928) investigate error bounds due to finite sampling." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Known from frequency estimation examples that 1 bit/experiment limit can be useful." ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Cramer-Rao Bound" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- We extend by using Fisher information to investigate limit as $K \\to 1$.\n", "- Mean (taken over data) error matrix $\\expect_D[(\\hat{\\vec{x}} - \\vec{x}) (\\hat{\\vec{x}} - \\vec{x})^\\T]$ for *unbiased* estimators bounded by Cramer-Rao Bound:\n", "$$\n", " \\matr{E}(\\vec{x}) \\ge \\matr{I}^{-1}(\\vec{x}),\n", "$$\n", "where\n", "$$\n", " \\matr{I}(\\vec{x}) := \\expect_{D | \\vec{x}} [\\nabla_{\\vec{x}} \\log\\Pr(D | \\vec{x}) \\cdot \\nabla_{\\vec{x}}^\\T \\log\\Pr(D | \\vec{x}) ]\n", "$$ is the Fisher information at $\\vec{x}$.\n", "\n", "- Here, $\\vec{x} = (p, A, B)$ or $(\\tilde{p}, p_{\\text{ref}}, A, B)$ are the unknown parameters being estimated.\n", "\n", "> Ferrie and Granade, QIP **12** 611 (2012). " ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Experiment Design" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Using Fisher information, we can choose most informative $m$ for hypotheses about $A$ and $B$.\n", "\n", "![](files/figures/best-m-vs-A.svg)\n", "![](files/figures/best-m-vs-B.svg)" ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Bayesian Approach" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In practice, we often have prior information. Demanding *unbiased* estimators is too strong.\n", "\n", "Let's take a Bayesian approach instead. After observing a datum $d$ taken from a sequence of length $m$:\n", "$$\n", " \\Pr(\\vec{x} | d; m) = \\frac{\\Pr(d | \\vec{x}; m)}{\\Pr(d | m)} \\Pr(\\vec{x}).\n", "$$\n", "\n", "We can implement this on a computer using sequential Monte Carlo (SMC). For example, to incorporate a uniform prior:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from qinfer.smc import SMCUpdater\n", "from qinfer.rb import RandomizedBenchmarkingModel\n", "from qinfer.distributions import UniformDistribution\n", "\n", "prior = UniformDistribution([[0.9, 1], [0.4, 0.5], [0.5, 0.6]])\n", "updater = SMCUpdater(RandomizedBenchmarkingModel(), 10000, prior)\n", "\n", "# As data arrives:\n", "# updater.update(datum, experiment)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 9 }, { "cell_type": "markdown", "metadata": {}, "source": [ "> Granade et al, NJP **14** 103013 (2012)." ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Bayesian Cramer-Rao Bound" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "With prior information, we need the *Bayesian* Cramer-Rao Bound,\n", "$$\n", " \\expect_{\\vec{x}} [\\matr{E}(\\vec{x})] \\ge \\matr{J}^{-1},\n", "$$\n", "where\n", "$$\n", " \\matr{J} := \\expect_{\\vec{x}} [\\matr{I}(\\vec{x})]\n", "$$\n", "is the Bayesian information matrix.\n", "\n", "This again can also be computed by using SMC." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from qinfer.smc import SMCUpdaterBCRB\n", "updater = SMCUpdaterBCRB(RandomizedBenchmarkingModel(), 10000, prior)\n", "\n", "# As data arrives, the BCRB is given by:\n", "# updater.current_bim" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 5 }, { "cell_type": "markdown", "metadata": {}, "source": [ "> Ferrie and Granade, QIP **12** 611 (2012). Granade et al, NJP **14** 103013 (2012)." ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Performance Results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "SMC-accelerate algorithm, outperforms least-squares fitting, esp. with small amounts of data.\n", "\n", "\n", "" ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Performance Results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This advantage persists for changing the maximum sequence length as well.\n", "\n", "\n", "" ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Testing with Bad Prior and Physical Gates" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To show that SMC acceleration is experimentally useful, we use a prior that is approximately 7 standard deviations away from the correct values for a cumulant-simulated gateset.\n", "\n", "\n", "\n", "The data was simulated using the methods of Puzzuoli et al, PRA **89** 022306." ] }, { "cell_type": "heading", "level": 2, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Even with a significantly bad prior, SMC does quite well.\n", "\n", "$$\\begin{array}{l|cccc}\n", " & \\tilde{p} & p_{\\text{ref}} & A_0 & B_0 \\\\\n", " \\hline\n", " \\text{True} & 0.9983 & 0.9957 & 0.3185 & 0.5012 \\\\\n", " \\text{SMC Estimate} & 0.9940 & 0.9968 & 0.3071 & 0.5134 \\\\\n", " \\text{LSF Estimate} & 0.9947 & 0.9972 & 0.3369 & 0.4820 \\\\\n", " \\hline\n", " \\text{SMC Error} & 0.0043 & 0.0011 & 0.0113 & 0.0122 \\\\\n", " \\text{LSF Error} & 0.0036 & 0.0015 & 0.0184 & 0.0192\n", "\\end{array}$$\n", "\n", "Due to the bad prior, it doesn't outperform least-squares fitting in this case for $\\tilde{p}$, but it does very well at $p_{\\text{ref}}$, $A$ and $B$, lending credibility to the estimate. \n" ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Software Implementation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We have developed a flexible and easy-to-use Python library, [**QInfer**](https://github.com/csferrie/python-qinfer), for implementing SMC-based applications." ] }, { "cell_type": "code", "collapsed": false, "input": [ "iframe(\"http://python-qinfer.readthedocs.org/en/latest/\")" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "" ], "metadata": {}, "output_type": "pyout", "prompt_number": 11, "text": [ "" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Conclusions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Randomized benchmarking allows for efficiently extracting useful information about a channel.\n", "- Bayesian inference dramatically reduces the data required for randomized benchmarking.\n", "- SMC produces nearly optimal estimates.\n", "- Our method is robust to bad priors, and works on physically-reasonable models." ] }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "References" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "-" } }, "source": [ "Full reference information is available on [Zotero](https://www.zotero.org/cgranade/items/collectionKey/2NQVPRK9)." ] }, { "cell_type": "code", "collapsed": false, "input": [ "iframe('https://www.zotero.org/cgranade/items/collectionKey/2NQVPRK9')" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "" ], "metadata": {}, "output_type": "pyout", "prompt_number": 7, "text": [ "" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 1, "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Thank You" ] } ], "metadata": {} } ] }