diff --git a/_book/Introduction-to-Quantum-Computing.epub b/_book/Introduction-to-Quantum-Computing.epub index 1d4350bb77ed31e533b6552a2cf741ed62f5f5d9..2671a2add1efc564d2f41d4705a83b4e12634677 100644 Binary files a/_book/Introduction-to-Quantum-Computing.epub and b/_book/Introduction-to-Quantum-Computing.epub differ diff --git a/_book/Introduction-to-Quantum-Computing.pdf b/_book/Introduction-to-Quantum-Computing.pdf index 3c9bc8171ee51179dd79afc7c5b6b959a9ba8134..2cfe1616f01f8ca7441b3f9067a8d88de93af925 100644 Binary files a/_book/Introduction-to-Quantum-Computing.pdf and b/_book/Introduction-to-Quantum-Computing.pdf differ diff --git a/_book/index.html b/_book/index.html index 0a503845ce2c4686893019720633d2ff287c0f0b..dda181b8d9ad1ff682ee751ceb147843511e759f 100644 --- a/_book/index.html +++ b/_book/index.html @@ -7,6 +7,8 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <meta name="author" content="Jannik Hellenkamp"> +<meta name="author" content="Dominique Unruh"> +<meta name="dcterms.date" content="2024-05-16"> <title>Introduction to Quantum Computing</title> <style> @@ -152,12 +154,6 @@ ul.task-list li input[type="checkbox"] { <a href="./probabilisticSystems.html" class="sidebar-item-text sidebar-link"> <span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Probabilistic systems</span></span></a> </div> -</li> - <li class="sidebar-item"> - <div class="sidebar-item-container"> - <a href="./quantumStates.html" class="sidebar-item-text sidebar-link"> - <span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Quantum States</span></span></a> - </div> </li> </ul> </li> @@ -171,7 +167,10 @@ ul.task-list li input[type="checkbox"] { <h2 id="toc-title">Table of contents</h2> <ul> - <li><a href="#welcome" id="toc-welcome" class="nav-link active" data-scroll-target="#welcome">Welcome</a></li> + <li><a href="#welcome" id="toc-welcome" class="nav-link active" data-scroll-target="#welcome">Welcome</a> + <ul class="collapse"> + <li><a href="#changelog" id="toc-changelog" class="nav-link" data-scroll-target="#changelog">Changelog</a></li> + </ul></li> </ul> </nav> </div> @@ -189,12 +188,19 @@ ul.task-list li input[type="checkbox"] { <div class="quarto-title-meta"> <div> - <div class="quarto-title-meta-heading">Author</div> + <div class="quarto-title-meta-heading">Authors</div> <div class="quarto-title-meta-contents"> <p>Jannik Hellenkamp </p> + <p>Dominique Unruh </p> </div> </div> + <div> + <div class="quarto-title-meta-heading">Published</div> + <div class="quarto-title-meta-contents"> + <p class="date">May 16, 2024</p> + </div> + </div> </div> @@ -206,11 +212,21 @@ ul.task-list li input[type="checkbox"] { <section id="welcome" class="level1 unnumbered"> <h1 class="unnumbered">Welcome</h1> -<p>These are the lecture notes for the “Introduction to Quantum Computing” lecture held by Dominique Unruh in the summer term 2024. The lecture notes are updated throughout the semester and should be viewed as an addition to the written notes and the lecture recordings.</p> -<p>If you prefer a <code>.pdf</code> or <code>.epub</code> file, there is a download available at the top left corner. Please note, that these files are autogenerated and some of the ebook readers have difficulties with the formulas.</p> -<p>If you spot an error or have any suggestions, please post them to the Moodle forum or send them to Jannik Hellenkamp. You can contact Jannik by sending an e-mail to my firstname.lastname@rwth-aachen.de (please replace first and lastname with my name).</p> +<p>These are the lecture notes for the “Introduction to Quantum Computing” lecture held by Dominique Unruh at RWTH Aachen in the summer term 2024. The lecture notes are updated throughout the semester and should be viewed as an addition to the handwritten notes and the lecture recordings.</p> +<p>If you prefer a <code>.pdf</code> or <code>.epub</code> file, there is a download available at the top left corner. Please note, that these files are autogenerated and some of the ebook readers have difficulties with the formulas. We are still working on a universal solution.</p> +<p>If you spot an error, please send Jannik Hellenkamp an e-mail. You can contact Jannik by sending an e-mail to firstname.lastname@rwth-aachen.de (please replace first and lastname with Jannik’s full name). If you have a question of understanding, please ask it in the Moodle forum.</p> +<p>These lecture notes are released under the CC BY-NC 4.0 license, which can be found <a href="https://creativecommons.org/licenses/by-nc/4.0/">here</a>.</p> +<section id="changelog" class="level2 unnumbered"> +<h2 class="unnumbered anchored" data-anchor-id="changelog">Changelog</h2> +<section id="version-0.1.1-16.05.2024" class="level4"> +<h4 class="anchored" data-anchor-id="version-0.1.1-16.05.2024">Version 0.1.1 (16.05.2024)</h4> +<ul> +<li>Started the lecture notes.</li> +</ul> +</section> +</section> </section> </main> <!-- /main --> @@ -295,7 +311,7 @@ window.document.addEventListener("DOMContentLoaded", function (event) { }); var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); var mailtoRegex = new RegExp(/^mailto:/); - var filterRegex = new RegExp("http:\/\/qis\.rwth-aachen\.de\/"); + var filterRegex = new RegExp("https:\/\/qis\.rwth-aachen\.de\/teaching\/24ss\/intro-quantum-computing\/script\/"); var isInternal = (href) => { return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); } diff --git a/_book/introduction.html b/_book/introduction.html index f0e0a42faa9bea4c4af281813c90709de9586e8d..bbcd1a3f98b629384a77a9121b30c025b5193cc8 100644 --- a/_book/introduction.html +++ b/_book/introduction.html @@ -181,12 +181,6 @@ window.Quarto = { <a href="./probabilisticSystems.html" class="sidebar-item-text sidebar-link"> <span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Probabilistic systems</span></span></a> </div> -</li> - <li class="sidebar-item"> - <div class="sidebar-item-container"> - <a href="./quantumStates.html" class="sidebar-item-text sidebar-link"> - <span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Quantum States</span></span></a> - </div> </li> </ul> </li> @@ -237,7 +231,7 @@ window.Quarto = { <p>In a classical computer the information is stored in <em>bits</em> which can either have the state <span class="math inline">\(0\)</span> <em>or</em> the state <span class="math inline">\(1\)</span>. These bits can be manipulated through different classical operations and we can look at these bits and read them, without interfering with the system or changing any states.</p> <p>In a quantum computer the information is stored in a <em>qubit</em> which is in a superposition <em>between</em> the state <span class="math inline">\(0\)</span> and <span class="math inline">\(1\)</span>. Just as with classical computers, we can construct variables from these qubits to store bigger numbers. For example a 64-<em>qu</em>bit integer would be described by 64 qubits is in a superposition between <span class="math inline">\(0\)</span> and <span class="math inline">\(2^{64}-1\)</span>. This can be imagined best as variable where the universe has not yet decided on its value and therefor the variable has all possible values at the same time.</p> <p>We can now use this superposition and manipulate it with different quantum operations. Contrary to a classical computer, in a quantum computer these operations are “applied” at all possible input values at the same time and the result is a superposition of all possible results of the operation. We call this effect <em>quantum parallelism</em>.</p> -<div class="callout callout-style-default callout-tip no-icon callout-titled"> +<div class="callout callout-style-simple callout-tip no-icon callout-titled"> <div class="callout-header d-flex align-content-center"> <div class="callout-icon-container"> <i class="callout-icon no-icon"></i> @@ -247,12 +241,12 @@ Example: Quantum parallelism </div> </div> <div class="callout-body-container callout-body"> -<p>Let’s say you have a quantum variable <span class="math inline">\(x\)</span> in a superposition between <span class="math inline">\(0\)</span> and <span class="math inline">\(2^{64}-1\)</span> (all possible 64-bit values) and some function <span class="math inline">\(f(x)\)</span>. You program a quantum computer to compute <span class="math inline">\(f(x)\)</span>.</p> +<p>Let’s say you have a quantum variable <span class="math inline">\(x\)</span> in a superposition of numbers between <span class="math inline">\(0\)</span> and <span class="math inline">\(2^{64}-1\)</span> (all possible 64-bit values) and some function <span class="math inline">\(f(x)\)</span>. You program a quantum computer to compute <span class="math inline">\(f(x)\)</span>.</p> <p>The quantum computer would compute <span class="math inline">\(f(x)\)</span> for <span class="math inline">\(x=0,x=1,x=2,...\)</span> at the the same time and the result of this computation is a superposition of all possible values <span class="math inline">\(f(x)\)</span>.</p> </div> </div> <p>Reading this one might be tempted to utilize quantum parallelism run any algorithm on a quantum computer in order to optimize runtime. Unfortunately there is a big catch with quantum computers: If we try to look at the state of a qubit (also called <em>measuring</em>), the universe decides randomly on a outcome and therefore when measuring we only get the result of one computation and all the rest of the information is lost.</p> -<div class="callout callout-style-default callout-tip no-icon callout-titled"> +<div class="callout callout-style-simple callout-tip no-icon callout-titled"> <div class="callout-header d-flex align-content-center"> <div class="callout-icon-container"> <i class="callout-icon no-icon"></i> @@ -353,7 +347,7 @@ window.document.addEventListener("DOMContentLoaded", function (event) { }); var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); var mailtoRegex = new RegExp(/^mailto:/); - var filterRegex = new RegExp("http:\/\/qis\.rwth-aachen\.de\/"); + var filterRegex = new RegExp("https:\/\/qis\.rwth-aachen\.de\/teaching\/24ss\/intro-quantum-computing\/script\/"); var isInternal = (href) => { return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); } diff --git a/_book/probabilisticSystems.html b/_book/probabilisticSystems.html index bdff93a5b87cf4185542baa450fa9bdd62635ac7..4b0c780c41bc880ab283476229e1d5b20801c3c6 100644 --- a/_book/probabilisticSystems.html +++ b/_book/probabilisticSystems.html @@ -30,7 +30,6 @@ ul.task-list li input[type="checkbox"] { <script src="site_libs/quarto-search/fuse.min.js"></script> <script src="site_libs/quarto-search/quarto-search.js"></script> <meta name="quarto:offset" content="./"> -<link href="./quantumStates.html" rel="next"> <link href="./introduction.html" rel="prev"> <script src="site_libs/quarto-html/quarto.js"></script> <script src="site_libs/quarto-html/popper.min.js"></script> @@ -181,12 +180,6 @@ window.Quarto = { <a href="./probabilisticSystems.html" class="sidebar-item-text sidebar-link active"> <span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Probabilistic systems</span></span></a> </div> -</li> - <li class="sidebar-item"> - <div class="sidebar-item-container"> - <a href="./quantumStates.html" class="sidebar-item-text sidebar-link"> - <span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Quantum States</span></span></a> - </div> </li> </ul> </li> @@ -200,9 +193,12 @@ window.Quarto = { <h2 id="toc-title">Table of contents</h2> <ul> - <li><a href="#deterministic-possibilities" id="toc-deterministic-possibilities" class="nav-link active" data-scroll-target="#deterministic-possibilities"><span class="header-section-number">2.1</span> Deterministic possibilities</a></li> + <li><a href="#deterministic-classical-possibilities" id="toc-deterministic-classical-possibilities" class="nav-link active" data-scroll-target="#deterministic-classical-possibilities"><span class="header-section-number">2.1</span> Deterministic (classical) possibilities</a></li> <li><a href="#probability-distribution" id="toc-probability-distribution" class="nav-link" data-scroll-target="#probability-distribution"><span class="header-section-number">2.2</span> Probability distribution</a></li> - <li><a href="#probabilistic-processes" id="toc-probabilistic-processes" class="nav-link" data-scroll-target="#probabilistic-processes"><span class="header-section-number">2.3</span> Probabilistic processes</a></li> + <li><a href="#probabilistic-processes" id="toc-probabilistic-processes" class="nav-link" data-scroll-target="#probabilistic-processes"><span class="header-section-number">2.3</span> Probabilistic processes</a> + <ul class="collapse"> + <li><a href="#applying-a-probabilistic-process" id="toc-applying-a-probabilistic-process" class="nav-link" data-scroll-target="#applying-a-probabilistic-process">Applying a probabilistic process</a></li> + </ul></li> </ul> </nav> </div> @@ -229,10 +225,10 @@ window.Quarto = { <p>To describe a quantum computer mathematically, we can do math similar to the known topic of probabilistic systems. We therefore first look into describing a probabilistic system.</p> -<section id="deterministic-possibilities" class="level2" data-number="2.1"> -<h2 data-number="2.1" class="anchored" data-anchor-id="deterministic-possibilities"><span class="header-section-number">2.1</span> Deterministic possibilities</h2> -<p>At first we need to define all the different possible outcomes of our system. For example for a coin flip this could be <em>heads</em> or <em>tails</em> or for a dice this could be the labels of the different sides. Note that there always has to be a <em>finite</em> number of possibilities.</p> -<div class="callout callout-style-default callout-tip no-icon callout-titled"> +<section id="deterministic-classical-possibilities" class="level2" data-number="2.1"> +<h2 data-number="2.1" class="anchored" data-anchor-id="deterministic-classical-possibilities"><span class="header-section-number">2.1</span> Deterministic (classical) possibilities</h2> +<p>At first we need to define all the different possible outcomes of our system. For example for a coin flip this could be <em>heads</em> or <em>tails</em> or for a dice this could be the labels of the different sides. We call these possibilities <em>classical possibilities</em>. Note that we will only be using a <em>finite</em> number of possibilities.</p> +<div class="callout callout-style-simple callout-tip no-icon callout-titled"> <div class="callout-header d-flex align-content-center"> <div class="callout-icon-container"> <i class="callout-icon no-icon"></i> @@ -242,14 +238,14 @@ Example: Random 2-bit number </div> </div> <div class="callout-body-container callout-body"> -<p>Imagine you have a random number generator, which outputs 2-bit numbers. The possible outcomes of this generator are <span class="math inline">\(00\)</span>, <span class="math inline">\(01\)</span>, <span class="math inline">\(10\)</span> and <span class="math inline">\(11\)</span>.</p> +<p>Imagine you have a random number generator, which outputs 2-bit numbers. The classical possibilities of this generator are <span class="math inline">\(00\)</span>, <span class="math inline">\(01\)</span>, <span class="math inline">\(10\)</span> and <span class="math inline">\(11\)</span>.</p> </div> </div> </section> <section id="probability-distribution" class="level2" data-number="2.2"> <h2 data-number="2.2" class="anchored" data-anchor-id="probability-distribution"><span class="header-section-number">2.2</span> Probability distribution</h2> -<p>Next, we need to give each possible outcome a probability. We write this <span class="math inline">\(Pr[outcome]=p\)</span> where <span class="math inline">\(p \in [0,1]\)</span> is the probability of the <span class="math inline">\(outcome\)</span>.</p> -<div class="callout callout-style-default callout-tip no-icon callout-titled"> +<p>Next, we need to give each possibility a probability. We write this <span class="math inline">\(\Pr[X]=p\)</span> where <span class="math inline">\(p \in [0,1]\)</span> is the probability of the classical possibility <span class="math inline">\(X\)</span>.</p> +<div class="callout callout-style-simple callout-tip no-icon callout-titled"> <div class="callout-header d-flex align-content-center"> <div class="callout-icon-container"> <i class="callout-icon no-icon"></i> @@ -259,18 +255,121 @@ Example: Coin flip </div> </div> <div class="callout-body-container callout-body"> -<p>For a coin flip the probability of heads would be <span class="math inline">\(Pr[heads] = \frac{1}{2}\)</span> and the probability for tails would be <span class="math inline">\(Pr[tails] = \frac{1}{2}\)</span>.</p> +<p>For a coin flip the probability of heads would be <span class="math inline">\(\Pr[\text{heads}] = \frac{1}{2}\)</span> and the probability for tails would be <span class="math inline">\(\Pr[\text{tails}] = \frac{1}{2}\)</span>.</p> </div> </div> <p>If we combine all probabilities for all the possible outcomes and write them as a vector, we get a <em>probability distribution</em>.</p> +<div class="callout callout-style-simple callout-note no-icon"> +<div class="callout-body d-flex"> +<div class="callout-icon-container"> +<i class="callout-icon no-icon"></i> +</div> +<div class="callout-body-container"> <div id="def-prob-distribution" class="definition theorem"> <p><span class="theorem-title"><strong>Definition 2.1 (Probability distribution)</strong></span> A vector <span class="math inline">\(M \in \mathbb{R}^n\)</span> is a valid probability distribution iff <span class="math inline">\(\sum M_i = 1\)</span> and <span class="math inline">\(\forall i\)</span> <span class="math inline">\(M_i \geq 0\)</span></p> </div> +</div> +</div> +</div> +<p>This vector has <span class="math inline">\(n\)</span> entries, where each entry corresponds to a classical possibility <span class="math inline">\(X\)</span> and the probability of <span class="math inline">\(X\)</span> is <span class="math inline">\(\Pr[X] = M_i\)</span>. The sum over all probabilities has to be <span class="math inline">\(1\)</span> and each entry needs to be nonnegative in order to be a valid probability.</p> +<div class="callout callout-style-simple callout-tip no-icon callout-titled"> +<div class="callout-header d-flex align-content-center"> +<div class="callout-icon-container"> +<i class="callout-icon no-icon"></i> +</div> +<div class="callout-title-container flex-fill"> +Example (continued): Coin flip +</div> +</div> +<div class="callout-body-container callout-body"> +<p>For a coin flip the probability distribution would be <span class="math inline">\(M_{\text{coin}} \in \mathbb{R}^2\)</span> with <span class="math inline">\(M = \begin{pmatrix}\frac{1}{2}\\ \frac{1}{2} \end{pmatrix}\)</span></p> +</div> +</div> +<div class="callout callout-style-simple callout-tip no-icon callout-titled"> +<div class="callout-header d-flex align-content-center"> +<div class="callout-icon-container"> +<i class="callout-icon no-icon"></i> +</div> +<div class="callout-title-container flex-fill"> +Example (continued): Random 2-bit number +</div> +</div> +<div class="callout-body-container callout-body"> +<p>Recall your random 2-bit number generator from above. Imagine your generator outputs each classical possibility with equal probability, except for the possibility <span class="math inline">\(00\)</span>, which is never generated. The corresponding probability distribution would be <span class="math display">\[ +M_{\text{2-bit}} = \begin{pmatrix} 0 \\ \frac{1}{3}\\ \frac{1}{3} \\ \frac{1}{3} \end{pmatrix} +\]</span></p> +</div> +</div> </section> <section id="probabilistic-processes" class="level2" data-number="2.3"> <h2 data-number="2.3" class="anchored" data-anchor-id="probabilistic-processes"><span class="header-section-number">2.3</span> Probabilistic processes</h2> +<p>With a probability distribution, we can only describe the probabilities of possibilities without any knowledge of a prior state. We therefore add another element to our toolbox of probabilistic systems called a <em>probabilistic process</em>.</p> +<p>A probabilistic process is a collection of <span class="math inline">\(n\)</span> probability distributions, where for each classical possibility there is a probability distribution. This distribution is the distribution under the condition, that the assigned classical possibility was the previous state. This lets us have conditional probabilities. We can write this as a matrix, where each column is a probability distribution.</p> +<div class="callout callout-style-simple callout-note no-icon"> +<div class="callout-body d-flex"> +<div class="callout-icon-container"> +<i class="callout-icon no-icon"></i> +</div> +<div class="callout-body-container"> +<div id="def-prob-process" class="definition theorem"> +<p><span class="theorem-title"><strong>Definition 2.2 (Probabilistic process)</strong></span> A matrix <span class="math inline">\(A \in \mathbb{R}^{n\times n}\)</span> is a valid probabilistic process iff for every column <span class="math inline">\(a\)</span> of <span class="math inline">\(A\)</span>, <span class="math inline">\(a\)</span> is a valid probability distribution.</p> +</div> +</div> +</div> +</div> +<p>From <a href="#def-prob-distribution" class="quarto-xref">Definition <span>2.1</span></a> we know that a valid probability distribution <span class="math inline">\(a\)</span> has the properties <span class="math inline">\(\sum a_i = 1\)</span> and <span class="math inline">\(\forall i\)</span> <span class="math inline">\(a_i \geq 0\)</span>, so a matrix <span class="math inline">\(A \in \mathbb{R}^{n \times n}\)</span> with <span class="math inline">\(\sum a_i = 1\)</span> and <span class="math inline">\(\forall i\)</span> <span class="math inline">\(a_i \geq 0\)</span> is a probabilistic process. This matrix is also called a <em>stochastic matrix</em>.</p> +<div class="callout callout-style-simple callout-tip no-icon callout-titled"> +<div class="callout-header d-flex align-content-center"> +<div class="callout-icon-container"> +<i class="callout-icon no-icon"></i> +</div> +<div class="callout-title-container flex-fill"> +Example (continued): Random 2-bit number +</div> +</div> +<div class="callout-body-container callout-body"> +<p>Imagine a second device, which receives a 2-bit number as an input and flips both bits with a probability of <span class="math inline">\(\frac{1}{3}\)</span>. The probability distributions for each of the classical possibility would then be <span class="math display">\[ +a_{00} = \begin{pmatrix} \frac{2}{3} \\ 0 \\ 0 \\ \frac{1}{3} \end{pmatrix}, a_{01} =\begin{pmatrix} 0 \\ \frac{2}{3} \\ \frac{1}{3} \\ 0 \end{pmatrix}, a_{10} =\begin{pmatrix} 0 \\ \frac{1}{3} \\ \frac{2}{3} \\ 0 \end{pmatrix}, a_{11} = \begin{pmatrix} \frac{1}{3} \\ 0 \\ 0 \\ \frac{2}{3} \end{pmatrix} +\]</span> From this we can construct the process as a matrix from these processes as follows: <span class="math display">\[ +A_{\text{flip}} = \begin{pmatrix} a_{00} & a_{01} & a_{10} & a_{11} \end{pmatrix} = \begin{pmatrix} \frac{2}{3} & 0 & 0 & \frac{1}{3} \\ 0 & \frac{2}{3} & \frac{1}{3} & 0 \\ 0 & \frac{1}{3} & \frac{2}{3} & 0 \\ \frac{1}{3} & 0 & 0 & \frac{2}{3} \end{pmatrix} +\]</span></p> +</div> +</div> +<section id="applying-a-probabilistic-process" class="level3 unnumbered"> +<h3 class="unnumbered anchored" data-anchor-id="applying-a-probabilistic-process">Applying a probabilistic process</h3> +<p>Having defined probability distributions and probabilistic processes, we can now combine these two elements and apply a probabilistic process on a probability distribution.</p> +<div class="callout callout-style-simple callout-note no-icon"> +<div class="callout-body d-flex"> +<div class="callout-icon-container"> +<i class="callout-icon no-icon"></i> +</div> +<div class="callout-body-container"> +<div id="def-prob-apply" class="definition theorem"> +<p><span class="theorem-title"><strong>Definition 2.3 (Applying a probabilistic process)</strong></span> Given an initial probability distribution <span class="math inline">\(x\)</span> and a probabilistic process <span class="math inline">\(A\)</span>, the result <span class="math inline">\(y\)</span> of applying the process <span class="math inline">\(A\)</span> is defined as <span class="math display">\[ +y = Ax +\]</span></p> +</div> +</div> +</div> +</div> +<div class="callout callout-style-simple callout-tip no-icon callout-titled"> +<div class="callout-header d-flex align-content-center"> +<div class="callout-icon-container"> +<i class="callout-icon no-icon"></i> +</div> +<div class="callout-title-container flex-fill"> +Example (continued): Random 2-bit number +</div> +</div> +<div class="callout-body-container callout-body"> +<p>Recall the 2-bit number generator and the bit flip from above. Imagine you would first draw a random 2-bit number from the generator and then run the bit flip device. We already know that the probability distribution of the generator is <span class="math inline">\(M_\text{2-bit}\)</span>. Using <span class="math inline">\(A_\text{flip}\)</span> we can calculate the final probability distribution: <span class="math display">\[ +A_\text{flip} \cdot M_\text{2-bit} = \begin{pmatrix} \frac{2}{3} & 0 & 0 & \frac{1}{3} \\ 0 & \frac{2}{3} & \frac{1}{3} & 0 \\ 0 & \frac{1}{3} & \frac{2}{3} & 0 \\ \frac{1}{3} & 0 & 0 & \frac{2}{3} \end{pmatrix}\begin{pmatrix} 0 \\ \frac{1}{3}\\ \frac{1}{3} \\ \frac{1}{3} \end{pmatrix} = \begin{pmatrix} \frac{1}{9} \\ \frac{1}{3}\\ \frac{1}{3} \\ \frac{2}{9} \end{pmatrix} +\]</span></p> +</div> +</div> +</section> </section> </main> <!-- /main --> @@ -355,7 +454,7 @@ window.document.addEventListener("DOMContentLoaded", function (event) { }); var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); var mailtoRegex = new RegExp(/^mailto:/); - var filterRegex = new RegExp("http:\/\/qis\.rwth-aachen\.de\/"); + var filterRegex = new RegExp("https:\/\/qis\.rwth-aachen\.de\/teaching\/24ss\/intro-quantum-computing\/script\/"); var isInternal = (href) => { return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); } @@ -690,9 +789,6 @@ window.document.addEventListener("DOMContentLoaded", function (event) { </a> </div> <div class="nav-page nav-page-next"> - <a href="./quantumStates.html" class="pagination-link" aria-label="Quantum States"> - <span class="nav-page-text"><span class="chapter-number">3</span> <span class="chapter-title">Quantum States</span></span> <i class="bi bi-arrow-right-short"></i> - </a> </div> </nav> </div> <!-- /content --> diff --git a/_book/quantumBasics.html b/_book/quantumBasics.html index 0b55b459d43013ac192411df835dd330c08a5151..e776bea12a6a13487f85a48610823ba342c7bcca 100644 --- a/_book/quantumBasics.html +++ b/_book/quantumBasics.html @@ -152,12 +152,6 @@ ul.task-list li input[type="checkbox"] { <a href="./probabilisticSystems.html" class="sidebar-item-text sidebar-link"> <span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Probabilistic systems</span></span></a> </div> -</li> - <li class="sidebar-item"> - <div class="sidebar-item-container"> - <a href="./quantumStates.html" class="sidebar-item-text sidebar-link"> - <span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Quantum States</span></span></a> - </div> </li> </ul> </li> @@ -276,7 +270,7 @@ window.document.addEventListener("DOMContentLoaded", function (event) { }); var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); var mailtoRegex = new RegExp(/^mailto:/); - var filterRegex = new RegExp("http:\/\/qis\.rwth-aachen\.de\/"); + var filterRegex = new RegExp("https:\/\/qis\.rwth-aachen\.de\/teaching\/24ss\/intro-quantum-computing\/script\/"); var isInternal = (href) => { return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); } diff --git a/_book/quantumStates.html b/_book/quantumStates.html deleted file mode 100644 index aea3acb81b95835ec46ea8987ac30ce030f0cd9f..0000000000000000000000000000000000000000 --- a/_book/quantumStates.html +++ /dev/null @@ -1,652 +0,0 @@ -<!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> - -<meta charset="utf-8"> -<meta name="generator" content="quarto-1.4.553"> - -<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> - - -<title>Introduction to Quantum Computing - 3 Quantum States</title> -<style> -code{white-space: pre-wrap;} -span.smallcaps{font-variant: small-caps;} -div.columns{display: flex; gap: min(4vw, 1.5em);} -div.column{flex: auto; overflow-x: auto;} -div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} -ul.task-list{list-style: none;} -ul.task-list li input[type="checkbox"] { - width: 0.8em; - margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ - vertical-align: middle; -} -</style> - - -<script src="site_libs/quarto-nav/quarto-nav.js"></script> -<script src="site_libs/quarto-nav/headroom.min.js"></script> -<script src="site_libs/clipboard/clipboard.min.js"></script> -<script src="site_libs/quarto-search/autocomplete.umd.js"></script> -<script src="site_libs/quarto-search/fuse.min.js"></script> -<script src="site_libs/quarto-search/quarto-search.js"></script> -<meta name="quarto:offset" content="./"> -<link href="./probabilisticSystems.html" rel="prev"> -<script src="site_libs/quarto-html/quarto.js"></script> -<script src="site_libs/quarto-html/popper.min.js"></script> -<script src="site_libs/quarto-html/tippy.umd.min.js"></script> -<script src="site_libs/quarto-html/anchor.min.js"></script> -<link href="site_libs/quarto-html/tippy.css" rel="stylesheet"> -<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles"> -<script src="site_libs/bootstrap/bootstrap.min.js"></script> -<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet"> -<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light"> -<script id="quarto-search-options" type="application/json">{ - "location": "sidebar", - "copy-button": false, - "collapse-after": 3, - "panel-placement": "start", - "type": "textbox", - "limit": 50, - "keyboard-shortcut": [ - "f", - "/", - "s" - ], - "show-item-context": false, - "language": { - "search-no-results-text": "No results", - "search-matching-documents-text": "matching documents", - "search-copy-link-title": "Copy link to search", - "search-hide-matches-text": "Hide additional matches", - "search-more-match-text": "more match in this document", - "search-more-matches-text": "more matches in this document", - "search-clear-button-title": "Clear", - "search-text-placeholder": "", - "search-detached-cancel-button-title": "Cancel", - "search-submit-button-title": "Submit", - "search-label": "Search" - } -}</script> - - <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> - <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script> - -<script type="text/javascript"> -const typesetMath = (el) => { - if (window.MathJax) { - // MathJax Typeset - window.MathJax.typeset([el]); - } else if (window.katex) { - // KaTeX Render - var mathElements = el.getElementsByClassName("math"); - var macros = []; - for (var i = 0; i < mathElements.length; i++) { - var texText = mathElements[i].firstChild; - if (mathElements[i].tagName == "SPAN") { - window.katex.render(texText.data, mathElements[i], { - displayMode: mathElements[i].classList.contains('display'), - throwOnError: false, - macros: macros, - fleqn: false - }); - } - } - } -} -window.Quarto = { - typesetMath -}; -</script> - -</head> - -<body class="nav-sidebar floating"> - -<div id="quarto-search-results"></div> - <header id="quarto-header" class="headroom fixed-top"> - <nav class="quarto-secondary-nav"> - <div class="container-fluid d-flex"> - <button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }"> - <i class="bi bi-layout-text-sidebar-reverse"></i> - </button> - <nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./quantumBasics.html">Quantum Basics</a></li><li class="breadcrumb-item"><a href="./quantumStates.html"><span class="chapter-number">3</span> <span class="chapter-title">Quantum States</span></a></li></ol></nav> - <a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }"> - </a> - <button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();"> - <i class="bi bi-search"></i> - </button> - </div> - </nav> -</header> -<!-- content --> -<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article"> -<!-- sidebar --> - <nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation floating overflow-auto"> - <div class="pt-lg-2 mt-2 text-left sidebar-header"> - <div class="sidebar-title mb-0 py-0"> - <a href="./">Introduction to Quantum Computing</a> - <div class="sidebar-tools-main"> - <a href="https://git.rwth-aachen.de/j1/intro-qc/" title="Source Code" class="quarto-navigation-tool px-1" aria-label="Source Code"><i class="bi bi-git"></i></a> - <div class="dropdown"> - <a href="" title="Download" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Download"><i class="bi bi-download"></i></a> - <ul class="dropdown-menu" aria-labelledby="quarto-navigation-tool-dropdown-0"> - <li> - <a class="dropdown-item sidebar-tools-main-item" href="./Introduction-to-Quantum-Computing.pdf"> - <i class="bi bi-bi-file-pdf pe-1"></i> - Download PDF - </a> - </li> - <li> - <a class="dropdown-item sidebar-tools-main-item" href="./Introduction-to-Quantum-Computing.epub"> - <i class="bi bi-bi-journal pe-1"></i> - Download ePub - </a> - </li> - </ul> - </div> -</div> - </div> - </div> - <div class="mt-2 flex-shrink-0 align-items-center"> - <div class="sidebar-search"> - <div id="quarto-search" class="" title="Search"></div> - </div> - </div> - <div class="sidebar-menu-container"> - <ul class="list-unstyled mt-1"> - <li class="sidebar-item"> - <div class="sidebar-item-container"> - <a href="./index.html" class="sidebar-item-text sidebar-link"> - <span class="menu-text">Welcome</span></a> - </div> -</li> - <li class="sidebar-item sidebar-item-section"> - <div class="sidebar-item-container"> - <a href="./quantumBasics.html" class="sidebar-item-text sidebar-link"> - <span class="menu-text">Quantum Basics</span></a> - <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true" aria-label="Toggle section"> - <i class="bi bi-chevron-right ms-2"></i> - </a> - </div> - <ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show"> - <li class="sidebar-item"> - <div class="sidebar-item-container"> - <a href="./introduction.html" class="sidebar-item-text sidebar-link"> - <span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Introduction</span></span></a> - </div> -</li> - <li class="sidebar-item"> - <div class="sidebar-item-container"> - <a href="./probabilisticSystems.html" class="sidebar-item-text sidebar-link"> - <span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Probabilistic systems</span></span></a> - </div> -</li> - <li class="sidebar-item"> - <div class="sidebar-item-container"> - <a href="./quantumStates.html" class="sidebar-item-text sidebar-link active"> - <span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Quantum States</span></span></a> - </div> -</li> - </ul> - </li> - </ul> - </div> -</nav> -<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div> -<!-- margin-sidebar --> - <div id="quarto-margin-sidebar" class="sidebar margin-sidebar"> - - </div> -<!-- main --> -<main class="content" id="quarto-document-content"> - -<header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./quantumBasics.html">Quantum Basics</a></li><li class="breadcrumb-item"><a href="./quantumStates.html"><span class="chapter-number">3</span> <span class="chapter-title">Quantum States</span></a></li></ol></nav> -<div class="quarto-title"> -<h1 class="title"><span class="chapter-number">3</span> <span class="chapter-title">Quantum States</span></h1> -</div> - - - -<div class="quarto-title-meta"> - - - - - </div> - - - -</header> - - -<div id="def-quantum-state" class="definition theorem"> -<p><span class="theorem-title"><strong>Definition 3.1 (Quantum State)</strong></span> A quantum state is a vector <span class="math inline">\(\psi \in \mathbb{C}^n\)</span> with <span class="math inline">\(\sqrt{\sum |\psi|^2} = 1\)</span></p> -</div> - - - -</main> <!-- /main --> -<script id="quarto-html-after-body" type="application/javascript"> -window.document.addEventListener("DOMContentLoaded", function (event) { - const toggleBodyColorMode = (bsSheetEl) => { - const mode = bsSheetEl.getAttribute("data-mode"); - const bodyEl = window.document.querySelector("body"); - if (mode === "dark") { - bodyEl.classList.add("quarto-dark"); - bodyEl.classList.remove("quarto-light"); - } else { - bodyEl.classList.add("quarto-light"); - bodyEl.classList.remove("quarto-dark"); - } - } - const toggleBodyColorPrimary = () => { - const bsSheetEl = window.document.querySelector("link#quarto-bootstrap"); - if (bsSheetEl) { - toggleBodyColorMode(bsSheetEl); - } - } - toggleBodyColorPrimary(); - const icon = ""; - const anchorJS = new window.AnchorJS(); - anchorJS.options = { - placement: 'right', - icon: icon - }; - anchorJS.add('.anchored'); - const isCodeAnnotation = (el) => { - for (const clz of el.classList) { - if (clz.startsWith('code-annotation-')) { - return true; - } - } - return false; - } - const clipboard = new window.ClipboardJS('.code-copy-button', { - text: function(trigger) { - const codeEl = trigger.previousElementSibling.cloneNode(true); - for (const childEl of codeEl.children) { - if (isCodeAnnotation(childEl)) { - childEl.remove(); - } - } - return codeEl.innerText; - } - }); - clipboard.on('success', function(e) { - // button target - const button = e.trigger; - // don't keep focus - button.blur(); - // flash "checked" - button.classList.add('code-copy-button-checked'); - var currentTitle = button.getAttribute("title"); - button.setAttribute("title", "Copied!"); - let tooltip; - if (window.bootstrap) { - button.setAttribute("data-bs-toggle", "tooltip"); - button.setAttribute("data-bs-placement", "left"); - button.setAttribute("data-bs-title", "Copied!"); - tooltip = new bootstrap.Tooltip(button, - { trigger: "manual", - customClass: "code-copy-button-tooltip", - offset: [0, -8]}); - tooltip.show(); - } - setTimeout(function() { - if (tooltip) { - tooltip.hide(); - button.removeAttribute("data-bs-title"); - button.removeAttribute("data-bs-toggle"); - button.removeAttribute("data-bs-placement"); - } - button.setAttribute("title", currentTitle); - button.classList.remove('code-copy-button-checked'); - }, 1000); - // clear code selection - e.clearSelection(); - }); - var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); - var mailtoRegex = new RegExp(/^mailto:/); - var filterRegex = new RegExp("http:\/\/qis\.rwth-aachen\.de\/"); - var isInternal = (href) => { - return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href); - } - // Inspect non-navigation links and adorn them if external - var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool)'); - for (var i=0; i<links.length; i++) { - const link = links[i]; - if (!isInternal(link.href)) { - // undo the damage that might have been done by quarto-nav.js in the case of - // links that we want to consider external - if (link.dataset.originalHref !== undefined) { - link.href = link.dataset.originalHref; - } - } - } - function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) { - const config = { - allowHTML: true, - maxWidth: 500, - delay: 100, - arrow: false, - appendTo: function(el) { - return el.parentElement; - }, - interactive: true, - interactiveBorder: 10, - theme: 'quarto', - placement: 'bottom-start', - }; - if (contentFn) { - config.content = contentFn; - } - if (onTriggerFn) { - config.onTrigger = onTriggerFn; - } - if (onUntriggerFn) { - config.onUntrigger = onUntriggerFn; - } - window.tippy(el, config); - } - const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]'); - for (var i=0; i<noterefs.length; i++) { - const ref = noterefs[i]; - tippyHover(ref, function() { - // use id or data attribute instead here - let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href'); - try { href = new URL(href).hash; } catch {} - const id = href.replace(/^#\/?/, ""); - const note = window.document.getElementById(id); - if (note) { - return note.innerHTML; - } else { - return ""; - } - }); - } - const xrefs = window.document.querySelectorAll('a.quarto-xref'); - const processXRef = (id, note) => { - // Strip column container classes - const stripColumnClz = (el) => { - el.classList.remove("page-full", "page-columns"); - if (el.children) { - for (const child of el.children) { - stripColumnClz(child); - } - } - } - stripColumnClz(note) - if (id === null || id.startsWith('sec-')) { - // Special case sections, only their first couple elements - const container = document.createElement("div"); - if (note.children && note.children.length > 2) { - container.appendChild(note.children[0].cloneNode(true)); - for (let i = 1; i < note.children.length; i++) { - const child = note.children[i]; - if (child.tagName === "P" && child.innerText === "") { - continue; - } else { - container.appendChild(child.cloneNode(true)); - break; - } - } - if (window.Quarto?.typesetMath) { - window.Quarto.typesetMath(container); - } - return container.innerHTML - } else { - if (window.Quarto?.typesetMath) { - window.Quarto.typesetMath(note); - } - return note.innerHTML; - } - } else { - // Remove any anchor links if they are present - const anchorLink = note.querySelector('a.anchorjs-link'); - if (anchorLink) { - anchorLink.remove(); - } - if (window.Quarto?.typesetMath) { - window.Quarto.typesetMath(note); - } - // TODO in 1.5, we should make sure this works without a callout special case - if (note.classList.contains("callout")) { - return note.outerHTML; - } else { - return note.innerHTML; - } - } - } - for (var i=0; i<xrefs.length; i++) { - const xref = xrefs[i]; - tippyHover(xref, undefined, function(instance) { - instance.disable(); - let url = xref.getAttribute('href'); - let hash = undefined; - if (url.startsWith('#')) { - hash = url; - } else { - try { hash = new URL(url).hash; } catch {} - } - if (hash) { - const id = hash.replace(/^#\/?/, ""); - const note = window.document.getElementById(id); - if (note !== null) { - try { - const html = processXRef(id, note.cloneNode(true)); - instance.setContent(html); - } finally { - instance.enable(); - instance.show(); - } - } else { - // See if we can fetch this - fetch(url.split('#')[0]) - .then(res => res.text()) - .then(html => { - const parser = new DOMParser(); - const htmlDoc = parser.parseFromString(html, "text/html"); - const note = htmlDoc.getElementById(id); - if (note !== null) { - const html = processXRef(id, note); - instance.setContent(html); - } - }).finally(() => { - instance.enable(); - instance.show(); - }); - } - } else { - // See if we can fetch a full url (with no hash to target) - // This is a special case and we should probably do some content thinning / targeting - fetch(url) - .then(res => res.text()) - .then(html => { - const parser = new DOMParser(); - const htmlDoc = parser.parseFromString(html, "text/html"); - const note = htmlDoc.querySelector('main.content'); - if (note !== null) { - // This should only happen for chapter cross references - // (since there is no id in the URL) - // remove the first header - if (note.children.length > 0 && note.children[0].tagName === "HEADER") { - note.children[0].remove(); - } - const html = processXRef(null, note); - instance.setContent(html); - } - }).finally(() => { - instance.enable(); - instance.show(); - }); - } - }, function(instance) { - }); - } - let selectedAnnoteEl; - const selectorForAnnotation = ( cell, annotation) => { - let cellAttr = 'data-code-cell="' + cell + '"'; - let lineAttr = 'data-code-annotation="' + annotation + '"'; - const selector = 'span[' + cellAttr + '][' + lineAttr + ']'; - return selector; - } - const selectCodeLines = (annoteEl) => { - const doc = window.document; - const targetCell = annoteEl.getAttribute("data-target-cell"); - const targetAnnotation = annoteEl.getAttribute("data-target-annotation"); - const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation)); - const lines = annoteSpan.getAttribute("data-code-lines").split(","); - const lineIds = lines.map((line) => { - return targetCell + "-" + line; - }) - let top = null; - let height = null; - let parent = null; - if (lineIds.length > 0) { - //compute the position of the single el (top and bottom and make a div) - const el = window.document.getElementById(lineIds[0]); - top = el.offsetTop; - height = el.offsetHeight; - parent = el.parentElement.parentElement; - if (lineIds.length > 1) { - const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]); - const bottom = lastEl.offsetTop + lastEl.offsetHeight; - height = bottom - top; - } - if (top !== null && height !== null && parent !== null) { - // cook up a div (if necessary) and position it - let div = window.document.getElementById("code-annotation-line-highlight"); - if (div === null) { - div = window.document.createElement("div"); - div.setAttribute("id", "code-annotation-line-highlight"); - div.style.position = 'absolute'; - parent.appendChild(div); - } - div.style.top = top - 2 + "px"; - div.style.height = height + 4 + "px"; - div.style.left = 0; - let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter"); - if (gutterDiv === null) { - gutterDiv = window.document.createElement("div"); - gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter"); - gutterDiv.style.position = 'absolute'; - const codeCell = window.document.getElementById(targetCell); - const gutter = codeCell.querySelector('.code-annotation-gutter'); - gutter.appendChild(gutterDiv); - } - gutterDiv.style.top = top - 2 + "px"; - gutterDiv.style.height = height + 4 + "px"; - } - selectedAnnoteEl = annoteEl; - } - }; - const unselectCodeLines = () => { - const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"]; - elementsIds.forEach((elId) => { - const div = window.document.getElementById(elId); - if (div) { - div.remove(); - } - }); - selectedAnnoteEl = undefined; - }; - // Handle positioning of the toggle - window.addEventListener( - "resize", - throttle(() => { - elRect = undefined; - if (selectedAnnoteEl) { - selectCodeLines(selectedAnnoteEl); - } - }, 10) - ); - function throttle(fn, ms) { - let throttle = false; - let timer; - return (...args) => { - if(!throttle) { // first call gets through - fn.apply(this, args); - throttle = true; - } else { // all the others get throttled - if(timer) clearTimeout(timer); // cancel #2 - timer = setTimeout(() => { - fn.apply(this, args); - timer = throttle = false; - }, ms); - } - }; - } - // Attach click handler to the DT - const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); - for (const annoteDlNode of annoteDls) { - annoteDlNode.addEventListener('click', (event) => { - const clickedEl = event.target; - if (clickedEl !== selectedAnnoteEl) { - unselectCodeLines(); - const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active'); - if (activeEl) { - activeEl.classList.remove('code-annotation-active'); - } - selectCodeLines(clickedEl); - clickedEl.classList.add('code-annotation-active'); - } else { - // Unselect the line - unselectCodeLines(); - clickedEl.classList.remove('code-annotation-active'); - } - }); - } - const findCites = (el) => { - const parentEl = el.parentElement; - if (parentEl) { - const cites = parentEl.dataset.cites; - if (cites) { - return { - el, - cites: cites.split(' ') - }; - } else { - return findCites(el.parentElement) - } - } else { - return undefined; - } - }; - var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]'); - for (var i=0; i<bibliorefs.length; i++) { - const ref = bibliorefs[i]; - const citeInfo = findCites(ref); - if (citeInfo) { - tippyHover(citeInfo.el, function() { - var popup = window.document.createElement('div'); - citeInfo.cites.forEach(function(cite) { - var citeDiv = window.document.createElement('div'); - citeDiv.classList.add('hanging-indent'); - citeDiv.classList.add('csl-entry'); - var biblioDiv = window.document.getElementById('ref-' + cite); - if (biblioDiv) { - citeDiv.innerHTML = biblioDiv.innerHTML; - } - popup.appendChild(citeDiv); - }); - return popup.innerHTML; - }); - } - } -}); -</script> -<nav class="page-navigation"> - <div class="nav-page nav-page-previous"> - <a href="./probabilisticSystems.html" class="pagination-link" aria-label="Probabilistic systems"> - <i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">2</span> <span class="chapter-title">Probabilistic systems</span></span> - </a> - </div> - <div class="nav-page nav-page-next"> - </div> -</nav> -</div> <!-- /content --> - - - - -</body></html> \ No newline at end of file diff --git a/_book/robots.txt b/_book/robots.txt index bcbd197cb1a09be6137116d4c113c3386610c98c..44431c1463cc93536fe57776b8ae8129d1fb2448 100644 --- a/_book/robots.txt +++ b/_book/robots.txt @@ -1 +1 @@ -Sitemap: http://qis.rwth-aachen.de/sitemap.xml +Sitemap: https://qis.rwth-aachen.de/teaching/24ss/intro-quantum-computing/script/sitemap.xml diff --git a/_book/search.json b/_book/search.json index aa9bde4a86fe3beeb7953977092f0028ae012aa4..36571f8d807bca72ce65f3834835790a81695e14 100644 --- a/_book/search.json +++ b/_book/search.json @@ -4,7 +4,17 @@ "href": "index.html", "title": "Introduction to Quantum Computing", "section": "", - "text": "Welcome\nThese are the lecture notes for the “Introduction to Quantum Computing” lecture held by Dominique Unruh in the summer term 2024. The lecture notes are updated throughout the semester and should be viewed as an addition to the written notes and the lecture recordings.\nIf you prefer a .pdf or .epub file, there is a download available at the top left corner. Please note, that these files are autogenerated and some of the ebook readers have difficulties with the formulas.\nIf you spot an error or have any suggestions, please post them to the Moodle forum or send them to Jannik Hellenkamp. You can contact Jannik by sending an e-mail to my firstname.lastname@rwth-aachen.de (please replace first and lastname with my name).", + "text": "Welcome\nThese are the lecture notes for the “Introduction to Quantum Computing” lecture held by Dominique Unruh at RWTH Aachen in the summer term 2024. The lecture notes are updated throughout the semester and should be viewed as an addition to the handwritten notes and the lecture recordings.\nIf you prefer a .pdf or .epub file, there is a download available at the top left corner. Please note, that these files are autogenerated and some of the ebook readers have difficulties with the formulas. We are still working on a universal solution.\nIf you spot an error, please send Jannik Hellenkamp an e-mail. You can contact Jannik by sending an e-mail to firstname.lastname@rwth-aachen.de (please replace first and lastname with Jannik’s full name). If you have a question of understanding, please ask it in the Moodle forum.\nThese lecture notes are released under the CC BY-NC 4.0 license, which can be found here.", + "crumbs": [ + "Welcome" + ] + }, + { + "objectID": "index.html#changelog", + "href": "index.html#changelog", + "title": "Introduction to Quantum Computing", + "section": "Changelog", + "text": "Changelog\n\nVersion 0.1.1 (16.05.2024)\n\nStarted the lecture notes.", "crumbs": [ "Welcome" ] @@ -25,7 +35,7 @@ "href": "introduction.html#what-is-a-quantum-computer", "title": "1 Introduction", "section": "1.2 What is a quantum computer?", - "text": "1.2 What is a quantum computer?\nTo start into the topic of quantum computing and to understand the differences from classical computers, we first need to look at some of the basics of such classical computers.\nIn a classical computer the information is stored in bits which can either have the state \\(0\\) or the state \\(1\\). These bits can be manipulated through different classical operations and we can look at these bits and read them, without interfering with the system or changing any states.\nIn a quantum computer the information is stored in a qubit which is in a superposition between the state \\(0\\) and \\(1\\). Just as with classical computers, we can construct variables from these qubits to store bigger numbers. For example a 64-qubit integer would be described by 64 qubits is in a superposition between \\(0\\) and \\(2^{64}-1\\). This can be imagined best as variable where the universe has not yet decided on its value and therefor the variable has all possible values at the same time.\nWe can now use this superposition and manipulate it with different quantum operations. Contrary to a classical computer, in a quantum computer these operations are “applied” at all possible input values at the same time and the result is a superposition of all possible results of the operation. We call this effect quantum parallelism.\n\n\n\n\n\n\nExample: Quantum parallelism\n\n\n\nLet’s say you have a quantum variable \\(x\\) in a superposition between \\(0\\) and \\(2^{64}-1\\) (all possible 64-bit values) and some function \\(f(x)\\). You program a quantum computer to compute \\(f(x)\\).\nThe quantum computer would compute \\(f(x)\\) for \\(x=0,x=1,x=2,...\\) at the the same time and the result of this computation is a superposition of all possible values \\(f(x)\\).\n\n\nReading this one might be tempted to utilize quantum parallelism run any algorithm on a quantum computer in order to optimize runtime. Unfortunately there is a big catch with quantum computers: If we try to look at the state of a qubit (also called measuring), the universe decides randomly on a outcome and therefore when measuring we only get the result of one computation and all the rest of the information is lost.\n\n\n\n\n\n\nExample (continued): Quantum parallelism\n\n\n\nAfter your quantum computer has calculated a superposition of all possible values \\(f(x)\\), you want to get some information on the output and therefore you do a measurement on the resulting quantum state.\nYou will receive one random \\(f(x)\\) and all the other possible solutions are lost.\n\n\nDue to this restriction, naively running established algorithms on a quantum computer will not work. Fortunately there are some clever tricks to create some “interference” between different computations before measuring. This will give use useful information in some cases.", + "text": "1.2 What is a quantum computer?\nTo start into the topic of quantum computing and to understand the differences from classical computers, we first need to look at some of the basics of such classical computers.\nIn a classical computer the information is stored in bits which can either have the state \\(0\\) or the state \\(1\\). These bits can be manipulated through different classical operations and we can look at these bits and read them, without interfering with the system or changing any states.\nIn a quantum computer the information is stored in a qubit which is in a superposition between the state \\(0\\) and \\(1\\). Just as with classical computers, we can construct variables from these qubits to store bigger numbers. For example a 64-qubit integer would be described by 64 qubits is in a superposition between \\(0\\) and \\(2^{64}-1\\). This can be imagined best as variable where the universe has not yet decided on its value and therefor the variable has all possible values at the same time.\nWe can now use this superposition and manipulate it with different quantum operations. Contrary to a classical computer, in a quantum computer these operations are “applied” at all possible input values at the same time and the result is a superposition of all possible results of the operation. We call this effect quantum parallelism.\n\n\n\n\n\n\nExample: Quantum parallelism\n\n\n\nLet’s say you have a quantum variable \\(x\\) in a superposition of numbers between \\(0\\) and \\(2^{64}-1\\) (all possible 64-bit values) and some function \\(f(x)\\). You program a quantum computer to compute \\(f(x)\\).\nThe quantum computer would compute \\(f(x)\\) for \\(x=0,x=1,x=2,...\\) at the the same time and the result of this computation is a superposition of all possible values \\(f(x)\\).\n\n\nReading this one might be tempted to utilize quantum parallelism run any algorithm on a quantum computer in order to optimize runtime. Unfortunately there is a big catch with quantum computers: If we try to look at the state of a qubit (also called measuring), the universe decides randomly on a outcome and therefore when measuring we only get the result of one computation and all the rest of the information is lost.\n\n\n\n\n\n\nExample (continued): Quantum parallelism\n\n\n\nAfter your quantum computer has calculated a superposition of all possible values \\(f(x)\\), you want to get some information on the output and therefore you do a measurement on the resulting quantum state.\nYou will receive one random \\(f(x)\\) and all the other possible solutions are lost.\n\n\nDue to this restriction, naively running established algorithms on a quantum computer will not work. Fortunately there are some clever tricks to create some “interference” between different computations before measuring. This will give use useful information in some cases.", "crumbs": [ "Quantum Basics", "<span class='chapter-number'>1</span> <span class='chapter-title'>Introduction</span>" @@ -36,18 +46,18 @@ "href": "probabilisticSystems.html", "title": "2 Probabilistic systems", "section": "", - "text": "2.1 Deterministic possibilities\nAt first we need to define all the different possible outcomes of our system. For example for a coin flip this could be heads or tails or for a dice this could be the labels of the different sides. Note that there always has to be a finite number of possibilities.", + "text": "2.1 Deterministic (classical) possibilities\nAt first we need to define all the different possible outcomes of our system. For example for a coin flip this could be heads or tails or for a dice this could be the labels of the different sides. We call these possibilities classical possibilities. Note that we will only be using a finite number of possibilities.", "crumbs": [ "Quantum Basics", "<span class='chapter-number'>2</span> <span class='chapter-title'>Probabilistic systems</span>" ] }, { - "objectID": "probabilisticSystems.html#deterministic-possibilities", - "href": "probabilisticSystems.html#deterministic-possibilities", + "objectID": "probabilisticSystems.html#deterministic-classical-possibilities", + "href": "probabilisticSystems.html#deterministic-classical-possibilities", "title": "2 Probabilistic systems", "section": "", - "text": "Example: Random 2-bit number\n\n\n\nImagine you have a random number generator, which outputs 2-bit numbers. The possible outcomes of this generator are \\(00\\), \\(01\\), \\(10\\) and \\(11\\).", + "text": "Example: Random 2-bit number\n\n\n\nImagine you have a random number generator, which outputs 2-bit numbers. The classical possibilities of this generator are \\(00\\), \\(01\\), \\(10\\) and \\(11\\).", "crumbs": [ "Quantum Basics", "<span class='chapter-number'>2</span> <span class='chapter-title'>Probabilistic systems</span>" @@ -58,7 +68,7 @@ "href": "probabilisticSystems.html#probability-distribution", "title": "2 Probabilistic systems", "section": "2.2 Probability distribution", - "text": "2.2 Probability distribution\nNext, we need to give each possible outcome a probability. We write this \\(Pr[outcome]=p\\) where \\(p \\in [0,1]\\) is the probability of the \\(outcome\\).\n\n\n\n\n\n\nExample: Coin flip\n\n\n\nFor a coin flip the probability of heads would be \\(Pr[heads] = \\frac{1}{2}\\) and the probability for tails would be \\(Pr[tails] = \\frac{1}{2}\\).\n\n\nIf we combine all probabilities for all the possible outcomes and write them as a vector, we get a probability distribution.\n\nDefinition 2.1 (Probability distribution) A vector \\(M \\in \\mathbb{R}^n\\) is a valid probability distribution iff \\(\\sum M_i = 1\\) and \\(\\forall i\\) \\(M_i \\geq 0\\)", + "text": "2.2 Probability distribution\nNext, we need to give each possibility a probability. We write this \\(\\Pr[X]=p\\) where \\(p \\in [0,1]\\) is the probability of the classical possibility \\(X\\).\n\n\n\n\n\n\nExample: Coin flip\n\n\n\nFor a coin flip the probability of heads would be \\(\\Pr[\\text{heads}] = \\frac{1}{2}\\) and the probability for tails would be \\(\\Pr[\\text{tails}] = \\frac{1}{2}\\).\n\n\nIf we combine all probabilities for all the possible outcomes and write them as a vector, we get a probability distribution.\n\n\n\n\n\n\n\nDefinition 2.1 (Probability distribution) A vector \\(M \\in \\mathbb{R}^n\\) is a valid probability distribution iff \\(\\sum M_i = 1\\) and \\(\\forall i\\) \\(M_i \\geq 0\\)\n\n\n\n\nThis vector has \\(n\\) entries, where each entry corresponds to a classical possibility \\(X\\) and the probability of \\(X\\) is \\(\\Pr[X] = M_i\\). The sum over all probabilities has to be \\(1\\) and each entry needs to be nonnegative in order to be a valid probability.\n\n\n\n\n\n\nExample (continued): Coin flip\n\n\n\nFor a coin flip the probability distribution would be \\(M_{\\text{coin}} \\in \\mathbb{R}^2\\) with \\(M = \\begin{pmatrix}\\frac{1}{2}\\\\ \\frac{1}{2} \\end{pmatrix}\\)\n\n\n\n\n\n\n\n\nExample (continued): Random 2-bit number\n\n\n\nRecall your random 2-bit number generator from above. Imagine your generator outputs each classical possibility with equal probability, except for the possibility \\(00\\), which is never generated. The corresponding probability distribution would be \\[\nM_{\\text{2-bit}} = \\begin{pmatrix} 0 \\\\ \\frac{1}{3}\\\\ \\frac{1}{3} \\\\ \\frac{1}{3} \\end{pmatrix}\n\\]", "crumbs": [ "Quantum Basics", "<span class='chapter-number'>2</span> <span class='chapter-title'>Probabilistic systems</span>" @@ -69,21 +79,10 @@ "href": "probabilisticSystems.html#probabilistic-processes", "title": "2 Probabilistic systems", "section": "2.3 Probabilistic processes", - "text": "2.3 Probabilistic processes", + "text": "2.3 Probabilistic processes\nWith a probability distribution, we can only describe the probabilities of possibilities without any knowledge of a prior state. We therefore add another element to our toolbox of probabilistic systems called a probabilistic process.\nA probabilistic process is a collection of \\(n\\) probability distributions, where for each classical possibility there is a probability distribution. This distribution is the distribution under the condition, that the assigned classical possibility was the previous state. This lets us have conditional probabilities. We can write this as a matrix, where each column is a probability distribution.\n\n\n\n\n\n\n\nDefinition 2.2 (Probabilistic process) A matrix \\(A \\in \\mathbb{R}^{n\\times n}\\) is a valid probabilistic process iff for every column \\(a\\) of \\(A\\), \\(a\\) is a valid probability distribution.\n\n\n\n\nFrom Definition 2.1 we know that a valid probability distribution \\(a\\) has the properties \\(\\sum a_i = 1\\) and \\(\\forall i\\) \\(a_i \\geq 0\\), so a matrix \\(A \\in \\mathbb{R}^{n \\times n}\\) with \\(\\sum a_i = 1\\) and \\(\\forall i\\) \\(a_i \\geq 0\\) is a probabilistic process. This matrix is also called a stochastic matrix.\n\n\n\n\n\n\nExample (continued): Random 2-bit number\n\n\n\nImagine a second device, which receives a 2-bit number as an input and flips both bits with a probability of \\(\\frac{1}{3}\\). The probability distributions for each of the classical possibility would then be \\[\na_{00} = \\begin{pmatrix} \\frac{2}{3} \\\\ 0 \\\\ 0 \\\\ \\frac{1}{3} \\end{pmatrix}, a_{01} =\\begin{pmatrix} 0 \\\\ \\frac{2}{3} \\\\ \\frac{1}{3} \\\\ 0 \\end{pmatrix}, a_{10} =\\begin{pmatrix} 0 \\\\ \\frac{1}{3} \\\\ \\frac{2}{3} \\\\ 0 \\end{pmatrix}, a_{11} = \\begin{pmatrix} \\frac{1}{3} \\\\ 0 \\\\ 0 \\\\ \\frac{2}{3} \\end{pmatrix}\n\\] From this we can construct the process as a matrix from these processes as follows: \\[\nA_{\\text{flip}} = \\begin{pmatrix} a_{00} & a_{01} & a_{10} & a_{11} \\end{pmatrix} = \\begin{pmatrix} \\frac{2}{3} & 0 & 0 & \\frac{1}{3} \\\\ 0 & \\frac{2}{3} & \\frac{1}{3} & 0 \\\\ 0 & \\frac{1}{3} & \\frac{2}{3} & 0 \\\\ \\frac{1}{3} & 0 & 0 & \\frac{2}{3} \\end{pmatrix}\n\\]\n\n\n\nApplying a probabilistic process\nHaving defined probability distributions and probabilistic processes, we can now combine these two elements and apply a probabilistic process on a probability distribution.\n\n\n\n\n\n\n\nDefinition 2.3 (Applying a probabilistic process) Given an initial probability distribution \\(x\\) and a probabilistic process \\(A\\), the result \\(y\\) of applying the process \\(A\\) is defined as \\[\ny = Ax\n\\]\n\n\n\n\n\n\n\n\n\n\nExample (continued): Random 2-bit number\n\n\n\nRecall the 2-bit number generator and the bit flip from above. Imagine you would first draw a random 2-bit number from the generator and then run the bit flip device. We already know that the probability distribution of the generator is \\(M_\\text{2-bit}\\). Using \\(A_\\text{flip}\\) we can calculate the final probability distribution: \\[\nA_\\text{flip} \\cdot M_\\text{2-bit} = \\begin{pmatrix} \\frac{2}{3} & 0 & 0 & \\frac{1}{3} \\\\ 0 & \\frac{2}{3} & \\frac{1}{3} & 0 \\\\ 0 & \\frac{1}{3} & \\frac{2}{3} & 0 \\\\ \\frac{1}{3} & 0 & 0 & \\frac{2}{3} \\end{pmatrix}\\begin{pmatrix} 0 \\\\ \\frac{1}{3}\\\\ \\frac{1}{3} \\\\ \\frac{1}{3} \\end{pmatrix} = \\begin{pmatrix} \\frac{1}{9} \\\\ \\frac{1}{3}\\\\ \\frac{1}{3} \\\\ \\frac{2}{9} \\end{pmatrix}\n\\]", "crumbs": [ "Quantum Basics", "<span class='chapter-number'>2</span> <span class='chapter-title'>Probabilistic systems</span>" ] - }, - { - "objectID": "quantumStates.html", - "href": "quantumStates.html", - "title": "3 Quantum States", - "section": "", - "text": "Definition 3.1 (Quantum State) A quantum state is a vector \\(\\psi \\in \\mathbb{C}^n\\) with \\(\\sqrt{\\sum |\\psi|^2} = 1\\)", - "crumbs": [ - "Quantum Basics", - "<span class='chapter-number'>3</span> <span class='chapter-title'>Quantum States</span>" - ] } ] \ No newline at end of file diff --git a/_book/sitemap.xml b/_book/sitemap.xml index 5f848ae41e53c383f16439e8666abb68a03bda62..1ad7bbfa71d05ef2c0faf24b4c322aa1e45a9391 100644 --- a/_book/sitemap.xml +++ b/_book/sitemap.xml @@ -1,31 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> - <loc>http://qis.rwth-aachen.de/index.html</loc> - <lastmod>2024-05-14T11:15:53.005Z</lastmod> + <loc>https://qis.rwth-aachen.de/teaching/24ss/intro-quantum-computing/script/index.html</loc> + <lastmod>2024-05-16T20:04:26.408Z</lastmod> </url> <url> - <loc>http://qis.rwth-aachen.de/quantumBasics.html</loc> + <loc>https://qis.rwth-aachen.de/teaching/24ss/intro-quantum-computing/script/quantumBasics.html</loc> <lastmod>2024-05-06T10:45:40.810Z</lastmod> </url> <url> - <loc>http://qis.rwth-aachen.de/introduction.html</loc> - <lastmod>2024-05-14T11:18:56.656Z</lastmod> + <loc>https://qis.rwth-aachen.de/teaching/24ss/intro-quantum-computing/script/introduction.html</loc> + <lastmod>2024-05-14T11:33:58.110Z</lastmod> </url> <url> - <loc>http://qis.rwth-aachen.de/probabilisticSystems.html</loc> - <lastmod>2024-05-14T09:51:43.215Z</lastmod> + <loc>https://qis.rwth-aachen.de/teaching/24ss/intro-quantum-computing/script/probabilisticSystems.html</loc> + <lastmod>2024-05-16T12:50:31.651Z</lastmod> </url> <url> - <loc>http://qis.rwth-aachen.de/quantumStates.html</loc> - <lastmod>2024-05-06T11:24:25.051Z</lastmod> + <loc>https://qis.rwth-aachen.de/teaching/24ss/intro-quantum-computing/script/Introduction-to-Quantum-Computing.pdf</loc> + <lastmod>2024-05-16T20:23:02.450Z</lastmod> </url> <url> - <loc>http://qis.rwth-aachen.de/Introduction-to-Quantum-Computing.pdf</loc> - <lastmod>2024-05-14T11:24:22.549Z</lastmod> - </url> - <url> - <loc>http://qis.rwth-aachen.de/Introduction-to-Quantum-Computing.epub</loc> - <lastmod>2024-05-14T11:24:23.460Z</lastmod> + <loc>https://qis.rwth-aachen.de/teaching/24ss/intro-quantum-computing/script/Introduction-to-Quantum-Computing.epub</loc> + <lastmod>2024-05-16T20:23:37.384Z</lastmod> </url> </urlset> diff --git a/_quarto.yml b/_quarto.yml index a5a51ac726dea23b776ae2fab1cef35ac080f3f4..52be34a7cf347849f27593835ba066141ac3052a 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -4,12 +4,17 @@ project: book: title: "Introduction to Quantum Computing" subtitle: "Lecture notes for the summer term 2024" - author: "Jannik Hellenkamp" + author: + - name: Jannik Hellenkamp + - name: Dominique Unruh downloads: [pdf, epub] + version: 0.1.1 search: true page-navigation: true - site-url: http://qis.rwth-aachen.de/ + site-url: https://qis.rwth-aachen.de/teaching/24ss/intro-quantum-computing/script/ repo-url: https://git.rwth-aachen.de/j1/intro-qc/ + license: "CC BY-NC" + date: today image: tmp-cover.png chapters: - index.qmd @@ -17,19 +22,24 @@ book: chapters: - introduction.qmd - probabilisticSystems.qmd - - quantumStates.qmd bibliography: references.bib format: html: theme: cosmo + callout-appearance: simple pdf: - documentclass: report + documentclass: scrreprt + papersize: letter include-in-header: - text: | + text: | \usepackage{physics} - \usepackage{geometry} + \RedeclareSectionCommand[style=section]{chapter} + \renewcommand{\part}[1]{\empty} + epub: - toc: true \ No newline at end of file + callout-appearance: simple + toc: true + html-math-method: webtex \ No newline at end of file diff --git a/index.qmd b/index.qmd index 47a3978ffa2282da68e943038b9ba795676a28ec..a09cd380a0db842375b1b3c75df0965cd47c382c 100644 --- a/index.qmd +++ b/index.qmd @@ -1,9 +1,15 @@ # Welcome {.unnumbered} -These are the lecture notes for the "Introduction to Quantum Computing" lecture held by Dominique Unruh in the summer term 2024. The lecture notes are updated throughout the semester and should be viewed as an addition to the written notes and the lecture recordings. +These are the lecture notes for the "Introduction to Quantum Computing" lecture held by Dominique Unruh at RWTH Aachen in the summer term 2024. The lecture notes are updated throughout the semester and should be viewed as an addition to the handwritten notes and the lecture recordings. ::: {.content-visible when-format="html:js"} -If you prefer a `.pdf` or `.epub` file, there is a download available at the top left corner. Please note, that these files are autogenerated and some of the ebook readers have difficulties with the formulas. +If you prefer a `.pdf` or `.epub` file, there is a download available at the top left corner. Please note, that these files are autogenerated and some of the ebook readers have difficulties with the formulas. We are still working on a universal solution. ::: -If you spot an error or have any suggestions, please post them to the Moodle forum or send them to Jannik Hellenkamp. You can contact Jannik by sending an e-mail to my firstname.lastname\@rwth-aachen.de (please replace first and lastname with my name). +If you spot an error, please send Jannik Hellenkamp an e-mail. You can contact Jannik by sending an e-mail to firstname.lastname\@rwth-aachen.de (please replace first and lastname with Jannik's full name). If you have a question of understanding, please ask it in the Moodle forum. + +These lecture notes are released under the CC BY-NC 4.0 license, which can be found [here](https://creativecommons.org/licenses/by-nc/4.0/). + +## Changelog {.unnumbered} +#### Version 0.1.1 (16.05.2024) +- Started the lecture notes. diff --git a/introduction.qmd b/introduction.qmd index 100f2f0374c875d8d8a48f58bc8b4572928e40d4..ef4f0417134a469f7bf871494aeb6d4cb38f7b7c 100644 --- a/introduction.qmd +++ b/introduction.qmd @@ -18,7 +18,7 @@ We can now use this superposition and manipulate it with different quantum opera ## Example: Quantum parallelism -Let's say you have a quantum variable $x$ in a superposition between $0$ and $2^{64}-1$ (all possible 64-bit values) and some function $f(x)$. You program a quantum computer to compute $f(x)$. +Let's say you have a quantum variable $x$ in a superposition of numbers between $0$ and $2^{64}-1$ (all possible 64-bit values) and some function $f(x)$. You program a quantum computer to compute $f(x)$. The quantum computer would compute $f(x)$ for $x=0,x=1,x=2,...$ at the the same time and the result of this computation is a superposition of all possible values $f(x)$. diff --git a/probabilisticSystems.qmd b/probabilisticSystems.qmd index 357116a3bc52aaf6bc37f3c16bb442ff30426edc..432e96bc84b5c03114dc5594184633e9b37350e1 100644 --- a/probabilisticSystems.qmd +++ b/probabilisticSystems.qmd @@ -1,31 +1,103 @@ # Probabilistic systems To describe a quantum computer mathematically, we can do math similar to the known topic of probabilistic systems. We therefore first look into describing a probabilistic system. -## Deterministic possibilities -At first we need to define all the different possible outcomes of our system. For example for a coin flip this could be *heads* or *tails* or for a dice this could be the labels of the different sides. Note that there always has to be a *finite* number of possibilities. +## Deterministic (classical) possibilities +At first we need to define all the different possible outcomes of our system. For example for a coin flip this could be *heads* or *tails* or for a dice this could be the labels of the different sides. We call these possibilities *classical possibilities*. Note that we will only be using a *finite* number of possibilities. ::: {.callout-tip icon=false} ## Example: Random 2-bit number -Imagine you have a random number generator, which outputs 2-bit numbers. The possible outcomes of this generator are $00$, $01$, $10$ and $11$. +Imagine you have a random number generator, which outputs 2-bit numbers. The classical possibilities of this generator are $00$, $01$, $10$ and $11$. ::: ## Probability distribution -Next, we need to give each possible outcome a probability. We write this $Pr[outcome]=p$ where $p \in [0,1]$ is the probability of the $outcome$. +Next, we need to give each possibility a probability. We write this $\Pr[X]=p$ where $p \in [0,1]$ is the probability of the classical possibility $X$. ::: {.callout-tip icon=false} ## Example: Coin flip -For a coin flip the probability of heads would be $Pr[heads] = \frac{1}{2}$ and the probability for tails would be $Pr[tails] = \frac{1}{2}$. +For a coin flip the probability of heads would be $\Pr[\text{heads}] = \frac{1}{2}$ and the probability for tails would be $\Pr[\text{tails}] = \frac{1}{2}$. ::: If we combine all probabilities for all the possible outcomes and write them as a vector, we get a *probability distribution*. - + +::: {.callout-note appearance="minimal" icon=false} ::: {.definition #def-prob-distribution} ## Probability distribution A vector $M \in \mathbb{R}^n$ is a valid probability distribution iff $\sum M_i = 1$ and $\forall i$ $M_i \geq 0$ ::: +::: +This vector has $n$ entries, where each entry corresponds to a classical possibility $X$ and the probability of $X$ is $\Pr[X] = M_i$. The sum over all probabilities has to be $1$ and each entry needs to be nonnegative in order to be a valid probability. + +::: {.callout-tip icon=false} + +## Example (continued): Coin flip +For a coin flip the probability distribution would be $M_{\text{coin}} \in \mathbb{R}^2$ with $M = \begin{pmatrix}\frac{1}{2}\\ \frac{1}{2} \end{pmatrix}$ +::: + +::: {.callout-tip icon=false} + +## Example (continued): Random 2-bit number +Recall your random 2-bit number generator from above. Imagine your generator outputs each classical possibility with equal probability, except for the possibility $00$, which is never generated. The corresponding probability distribution would be +$$ +M_{\text{2-bit}} = \begin{pmatrix} 0 \\ \frac{1}{3}\\ \frac{1}{3} \\ \frac{1}{3} \end{pmatrix} +$$ +::: + +## Probabilistic processes +With a probability distribution, we can only describe the probabilities of possibilities without any knowledge of a prior state. We therefore add another element to our toolbox of probabilistic systems called a *probabilistic process*. + +A probabilistic process is a collection of $n$ probability distributions, where for each classical possibility there is a probability distribution. This distribution is the distribution under the condition, that the assigned classical possibility was the previous state. This lets us have conditional probabilities. We can write this as a matrix, where each column is a probability distribution. + +::: {.callout-note appearance="minimal" icon=false} +::: {.definition #def-prob-process} + +## Probabilistic process +A matrix $A \in \mathbb{R}^{n\times n}$ is a valid probabilistic process iff for every column $a$ of $A$, $a$ is a valid probability distribution. + +::: +::: + +From @def-prob-distribution we know that a valid probability distribution $a$ has the properties $\sum a_i = 1$ and $\forall i$ $a_i \geq 0$, so a matrix $A \in \mathbb{R}^{n \times n}$ with $\sum a_i = 1$ and $\forall i$ $a_i \geq 0$ is a probabilistic process. This matrix is also called a *stochastic matrix*. + + +::: {.callout-tip icon=false} + +## Example (continued): Random 2-bit number +Imagine a second device, which receives a 2-bit number as an input and flips both bits with a probability of $\frac{1}{3}$. The probability distributions for each of the classical possibility would then be +$$ +a_{00} = \begin{pmatrix} \frac{2}{3} \\ 0 \\ 0 \\ \frac{1}{3} \end{pmatrix}, a_{01} =\begin{pmatrix} 0 \\ \frac{2}{3} \\ \frac{1}{3} \\ 0 \end{pmatrix}, a_{10} =\begin{pmatrix} 0 \\ \frac{1}{3} \\ \frac{2}{3} \\ 0 \end{pmatrix}, a_{11} = \begin{pmatrix} \frac{1}{3} \\ 0 \\ 0 \\ \frac{2}{3} \end{pmatrix} +$$ +From this we can construct the process as a matrix from these processes as follows: +$$ +A_{\text{flip}} = \begin{pmatrix} a_{00} & a_{01} & a_{10} & a_{11} \end{pmatrix} = \begin{pmatrix} \frac{2}{3} & 0 & 0 & \frac{1}{3} \\ 0 & \frac{2}{3} & \frac{1}{3} & 0 \\ 0 & \frac{1}{3} & \frac{2}{3} & 0 \\ \frac{1}{3} & 0 & 0 & \frac{2}{3} \end{pmatrix} +$$ +::: + +### Applying a probabilistic process {.unnumbered} +Having defined probability distributions and probabilistic processes, we can now combine these two elements and apply a probabilistic process on a probability distribution. + +::: {.callout-note appearance="minimal" icon=false} +::: {.definition #def-prob-apply} + +## Applying a probabilistic process +Given an initial probability distribution $x$ and a probabilistic process $A$, the result $y$ of applying the process $A$ is defined as +$$ +y = Ax +$$ + +::: +::: + +::: {.callout-tip icon=false} + +## Example (continued): Random 2-bit number +Recall the 2-bit number generator and the bit flip from above. Imagine you would first draw a random 2-bit number from the generator and then run the bit flip device. We already know that the probability distribution of the generator is $M_\text{2-bit}$. Using $A_\text{flip}$ we can calculate the final probability distribution: +$$ +A_\text{flip} \cdot M_\text{2-bit} = \begin{pmatrix} \frac{2}{3} & 0 & 0 & \frac{1}{3} \\ 0 & \frac{2}{3} & \frac{1}{3} & 0 \\ 0 & \frac{1}{3} & \frac{2}{3} & 0 \\ \frac{1}{3} & 0 & 0 & \frac{2}{3} \end{pmatrix}\begin{pmatrix} 0 \\ \frac{1}{3}\\ \frac{1}{3} \\ \frac{1}{3} \end{pmatrix} = \begin{pmatrix} \frac{1}{9} \\ \frac{1}{3}\\ \frac{1}{3} \\ \frac{2}{9} \end{pmatrix} +$$ + +::: -## Probabilistic processes \ No newline at end of file diff --git a/quantumStates.qmd b/quantumStates.qmd deleted file mode 100644 index 7f453658cdd3b09f72c1185fd5325e9e618786b0..0000000000000000000000000000000000000000 --- a/quantumStates.qmd +++ /dev/null @@ -1,7 +0,0 @@ -## Quantum States -::: {.definition #def-quantum-state} - -## Quantum State - -A quantum state is a vector $\psi \in \mathbb{C}^n$ with $\sqrt{\sum |\psi|^2} = 1$ -::: \ No newline at end of file diff --git a/quantumSystems.qmd b/quantumSystems.qmd new file mode 100644 index 0000000000000000000000000000000000000000..00d590adfcb1c830b21a3e1f0d388ce7408c0f1b --- /dev/null +++ b/quantumSystems.qmd @@ -0,0 +1,16 @@ +# Quantum Systems +With the basics for a probabilistic system defined, we now look into describing a quantum computer mathematically. We first compare the probabilistic world with the quantum world: + +| Probabilistic world | Quantum world | +| --------- | ----------- | +| Header | Title | +| Paragraph | Text | + + +## Quantum states +::: {.definition #def-quantum-state} + +## Quantum State + +A quantum state is a vector $\psi \in \mathbb{C}^n$ with $\sqrt{\sum |\psi|^2} = 1$ +::: \ No newline at end of file