diff --git a/404.html b/404.html index 0feb38b..987f85c 100644 --- a/404.html +++ b/404.html @@ -14,8 +14,8 @@ - - + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

diff --git a/assets/images/final_state-b9b308ff455d826c302c8eab46a48e6e.png b/assets/images/final_state-b9b308ff455d826c302c8eab46a48e6e.png new file mode 100644 index 0000000..ac61f6b Binary files /dev/null and b/assets/images/final_state-b9b308ff455d826c302c8eab46a48e6e.png differ diff --git a/assets/images/gate_prune-70fa4724b0fda4adf77650b90817f835.png b/assets/images/gate_prune-70fa4724b0fda4adf77650b90817f835.png new file mode 100644 index 0000000..f653790 Binary files /dev/null and b/assets/images/gate_prune-70fa4724b0fda4adf77650b90817f835.png differ diff --git a/assets/images/overall_circuit-3f3f7791ae13cda95d1c8bd7a050e2b3.png b/assets/images/overall_circuit-3f3f7791ae13cda95d1c8bd7a050e2b3.png new file mode 100644 index 0000000..9c3c8b2 Binary files /dev/null and b/assets/images/overall_circuit-3f3f7791ae13cda95d1c8bd7a050e2b3.png differ diff --git a/assets/images/qft_state-d99e8e5415393d51d3edcb76368406e2.png b/assets/images/qft_state-d99e8e5415393d51d3edcb76368406e2.png new file mode 100644 index 0000000..4b1168d Binary files /dev/null and b/assets/images/qft_state-d99e8e5415393d51d3edcb76368406e2.png differ diff --git a/assets/images/r8and12-0adb4d33590944377ab6dae3d44b1956.png b/assets/images/r8and12-0adb4d33590944377ab6dae3d44b1956.png new file mode 100644 index 0000000..0418842 Binary files /dev/null and b/assets/images/r8and12-0adb4d33590944377ab6dae3d44b1956.png differ diff --git a/assets/js/143844fc.db684032.js b/assets/js/143844fc.db684032.js deleted file mode 100644 index 8febd7f..0000000 --- a/assets/js/143844fc.db684032.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[8884],{5653:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>r,metadata:()=>l,toc:()=>m});var a=t(4848),n=t(8453);const r={slug:"intro-to-qnn",title:"Introduction to Quantum Neural Networks",authors:"eason",tags:["intermediate","quantum","qnn","pytorch","tutorial"]},i=void 0,l={permalink:"/blog/intro-to-qnn",source:"@site/blog/2024-2-9-intro-to-qnn/index.md",title:"Introduction to Quantum Neural Networks",description:"Make a Quantum Neural Network (QNN) in PyTorch.",date:"2024-02-09T00:00:00.000Z",tags:[{label:"intermediate",permalink:"/blog/tags/intermediate"},{label:"quantum",permalink:"/blog/tags/quantum"},{label:"qnn",permalink:"/blog/tags/qnn"},{label:"pytorch",permalink:"/blog/tags/pytorch"},{label:"tutorial",permalink:"/blog/tags/tutorial"}],readingTime:9.51,hasTruncateMarker:!0,authors:[{name:"Eason Xie",title:"Website Owner",url:"https://easonoob.github.io",imageURL:"https://avatars.githubusercontent.com/u/100521878?v=4",key:"eason"}],frontMatter:{slug:"intro-to-qnn",title:"Introduction to Quantum Neural Networks",authors:"eason",tags:["intermediate","quantum","qnn","pytorch","tutorial"]},unlisted:!1,nextItem:{title:"Introduction to Quantum Computing",permalink:"/blog/intro-to-quantum-computing"}},c={authorsImageUrls:[void 0]},m=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Simulation",id:"simulation",level:2},{value:"Define Gate Matrices",id:"define-gate-matrices",level:3},{value:"Angle Encoding",id:"angle-encoding",level:3},{value:"Measurement",id:"measurement",level:3},{value:"Model",id:"model",level:3},{value:"Dataset",id:"dataset",level:3},{value:"Training Loop",id:"training-loop",level:3}];function h(e){const s={a:"a",annotation:"annotation",code:"code",h2:"h2",h3:"h3",li:"li",math:"math",mi:"mi",mn:"mn",mo:"mo",mrow:"mrow",msup:"msup",mtext:"mtext",munder:"munder",p:"p",path:"path",pre:"pre",semantics:"semantics",span:"span",svg:"svg",ul:"ul",...(0,n.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.p,{children:"Make a Quantum Neural Network (QNN) in PyTorch."}),"\n",(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"https://easonoob.github.io/blog/intro-to-quantum-computing",children:"last blog post"}),", we talked about the very basics of quantum computing, and tried a few examples with qiskit. In this post, we will try to build a QNN completely with PyTorch only, without quantum simulation / machine learning libraries like PennyLane or TorchQuantum, so we can know what really happens inside the simulation. Let's get started!"]}),"\n",(0,a.jsx)(s.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Read and Understand the last post"}),"\n",(0,a.jsx)(s.li,{children:"Basic Python & PyTorch"}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"simulation",children:"Simulation"}),"\n",(0,a.jsx)(s.p,{children:"Import necessary libraries:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"import torch, torch.nn as nn, torch.nn.functional as F\r\nfrom typing import Union, List\r\nimport numpy as np\r\nfrom torchvision import datasets, transforms\r\nfrom torch.utils.data import DataLoader\r\nimport matplotlib.pyplot as plt\n"})}),"\n",(0,a.jsxs)(s.p,{children:["We know a quantum state vector of a single qubit can be represented as ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mi,{children:"\u03c8"}),(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e9"}),(0,a.jsx)(s.mo,{children:"="}),(0,a.jsx)(s.mi,{children:"\u03b1"}),(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mn,{children:"0"}),(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e9"}),(0,a.jsx)(s.mo,{children:"+"}),(0,a.jsx)(s.mi,{children:"\u03b2"}),(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mn,{children:"1"}),(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e9"})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"|\\psi\\rangle = \\alpha |0\\rangle + \\beta |1\\rangle"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,a.jsx)(s.span,{className:"mord",children:"\u2223"}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c8"}),(0,a.jsx)(s.span,{className:"mclose",children:"\u27e9"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,a.jsx)(s.span,{className:"mrel",children:"="}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.0037em"},children:"\u03b1"}),(0,a.jsx)(s.span,{className:"mord",children:"\u22230"}),(0,a.jsx)(s.span,{className:"mclose",children:"\u27e9"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"+"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.05278em"},children:"\u03b2"}),(0,a.jsx)(s.span,{className:"mord",children:"\u22231"}),(0,a.jsx)(s.span,{className:"mclose",children:"\u27e9"})]})]})]}),", and numerous qubits can be combined into a large state of ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mi,{children:"n"})]})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"2^n"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6644em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.6644em"},children:(0,a.jsxs)(s.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"2.7em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]})]})})]})," propabilities. For the simulation, we will create a single large state vector ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsx)(s.mi,{children:"h"})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"h"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6944em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",children:"h"})]})})]})," which stores all qubits in the system (not very efficient but this is the easiest) with ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mi,{children:"h"}),(0,a.jsx)(s.mo,{children:"\u2208"}),(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mi,{mathvariant:"double-struck",children:"R"}),(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mi,{children:"b"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsxs)(s.munder,{children:[(0,a.jsxs)(s.munder,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mo,{children:"\u22ef"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mn,{children:"2"})]}),(0,a.jsx)(s.mo,{stretchy:"true",children:"\u23df"})]}),(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mi,{children:"n"}),(0,a.jsx)(s.mtext,{children:"\xa0times"})]})]})]})]})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"h \\in \\mathbb{R}^{b \\times \\underbrace{2 \\times 2 \\times \\cdots \\times 2}_{n \\text{ times}}}"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.7335em",verticalAlign:"-0.0391em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",children:"h"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,a.jsx)(s.span,{className:"mrel",children:"\u2208"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1.5797em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord mathbb",children:"R"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"1.5797em"},children:(0,a.jsxs)(s.span,{style:{top:"-4.0936em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsxs)(s.span,{className:"mord mtight",children:[(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"b"}),(0,a.jsx)(s.span,{className:"mbin mtight",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mord munder mtight",children:(0,a.jsxs)(s.span,{className:"vlist-t vlist-t2",children:[(0,a.jsxs)(s.span,{className:"vlist-r",children:[(0,a.jsxs)(s.span,{className:"vlist",style:{height:"0.6444em"},children:[(0,a.jsxs)(s.span,{style:{top:"-1.5916em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size3 size1 mtight",children:(0,a.jsxs)(s.span,{className:"mord mtight",children:[(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"}),(0,a.jsx)(s.span,{className:"mord text mtight",children:(0,a.jsx)(s.span,{className:"mord mtight",children:"\xa0times"})})]})})]}),(0,a.jsxs)(s.span,{style:{top:"-3em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsx)(s.span,{className:"mord munder mtight",children:(0,a.jsxs)(s.span,{className:"vlist-t vlist-t2",children:[(0,a.jsxs)(s.span,{className:"vlist-r",children:[(0,a.jsxs)(s.span,{className:"vlist",style:{height:"0.6444em"},children:[(0,a.jsxs)(s.span,{className:"svg-align",style:{top:"-2.2687em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsxs)(s.span,{className:"stretchy mtight",style:{height:"0.548em",minWidth:"1.6em"},children:[(0,a.jsx)(s.span,{className:"brace-left mtight",style:{height:"0.548em"},children:(0,a.jsx)(s.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"0.548em",viewBox:"0 0 400000 548",preserveAspectRatio:"xMinYMin slice",children:(0,a.jsx)(s.path,{d:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z"})})}),(0,a.jsx)(s.span,{className:"brace-center mtight",style:{height:"0.548em"},children:(0,a.jsx)(s.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"0.548em",viewBox:"0 0 400000 548",preserveAspectRatio:"xMidYMin slice",children:(0,a.jsx)(s.path,{d:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z"})})}),(0,a.jsx)(s.span,{className:"brace-right mtight",style:{height:"0.548em"},children:(0,a.jsx)(s.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"0.548em",viewBox:"0 0 400000 548",preserveAspectRatio:"xMaxYMin slice",children:(0,a.jsx)(s.path,{d:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z"})})})]})]}),(0,a.jsxs)(s.span,{style:{top:"-3em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"minner",children:"\u22ef"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mord",children:"2"})]})]})]}),(0,a.jsx)(s.span,{className:"vlist-s",children:"\u200b"})]}),(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.7313em"},children:(0,a.jsx)(s.span,{})})})]})})]})]}),(0,a.jsx)(s.span,{className:"vlist-s",children:"\u200b"})]}),(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"1.4084em"},children:(0,a.jsx)(s.span,{})})})]})})]})})]})})})})})]})]})]})]})," which ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsx)(s.mi,{children:"b"})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"b"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6944em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",children:"b"})]})})]})," is batch size, ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsx)(s.mi,{children:"n"})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"n"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.4306em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",children:"n"})]})})]})," is number of qubits so that for each batch, there are ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mi,{children:"n"})]})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"2^n"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6644em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.6644em"},children:(0,a.jsxs)(s.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"2.7em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]})]})})]})," propabilities."]}),"\n",(0,a.jsx)(s.p,{children:"To apply the gate to a specific qubit in the state vector, we can simply permute the target qubit dimension to the back, then multiply it with the gate matrix. For double qubits gates, we can permute the control and target to the back, combine the two dimensions, multiply the gate matrix, and reshape back. Here is a function that applied the gate to the state:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:'def apply_gate(state, mat, wires: Union[int, List[int]]):\r\n """\r\n Apply the gate matrix/matrices to the state vector using torch.bmm method.\r\n \r\n Args:\r\n state (torch.Tensor): The state vector.\r\n mat (torch.Tensor): The gate matrix/matrices.\r\n wires (int or List[int]): Which qubit(s) the operation is applied to.\r\n \r\n Returns:\r\n torch.Tensor: The updated state vector.\r\n """\r\n # Handle input for single qubit as a list for uniformity\r\n if isinstance(wires, int):\r\n wires = [wires]\r\n \r\n # Ensure the matrix is on the same device and dtype as the state\r\n mat = mat.to(state.device).to(state.dtype)\r\n \r\n # Calculate the new order of dimensions for the state to match matrix multiplication needs\r\n num_qubits = len(state.shape) - 1\r\n permute_order = list(range(1, num_qubits + 1)) # Start from 1 to account for batch dimension\r\n for index, wire in enumerate(wires):\r\n permute_order.remove(wire + 1) # Remove wire from its current place\r\n permute_order.insert(index, wire + 1) # Insert wire right after the batch dimension\r\n\r\n # Permute the state tensor to bring the target wire dimensions next to the batch dimension\r\n permuted_state = state.permute([0] + permute_order) # Batch dimension remains the first\r\n reshaped_state = permuted_state.reshape(state.shape[0], -1, mat.size(-1))\r\n \r\n # Apply the gate using matrix multiplication\r\n new_state = torch.bmm(reshaped_state, mat) if len(mat.shape) == 3 else reshaped_state @ mat\r\n \r\n # Reshape and permute back to the original shape and order\r\n final_state = new_state.view(state.shape).permute(list(np.argsort([0] + permute_order)))\r\n \r\n return final_state\n'})}),"\n",(0,a.jsx)(s.p,{children:"The reason for the input to accept batched gate matrices is for the angle encoding later, which encodes inputs into the state."}),"\n",(0,a.jsx)(s.h3,{id:"define-gate-matrices",children:"Define Gate Matrices"}),"\n",(0,a.jsx)(s.p,{children:"Now the gate matrix functions:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"def h_matrix():\r\n return 1 / np.sqrt(2) * torch.tensor([[1, 1], [1, -1]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef cnot_matrix():\r\n return torch.tensor([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef pauli_x_matrix():\r\n return torch.tensor([[0, 1], [1, 0]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef pauli_y_matrix():\r\n return torch.tensor([[0, -1j], [1j, 0]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef pauli_z_matrix():\r\n return torch.tensor([[1, 0], [0, -1]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef rx_matrix(theta):\r\n return torch.tensor([[torch.cos(theta / 2), -1j * torch.sin(theta / 2)],\r\n [-1j * torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef ry_matrix(theta):\r\n return torch.tensor([[torch.cos(theta / 2), -torch.sin(theta / 2)],\r\n [torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef rz_matrix(theta):\r\n return torch.tensor([[torch.exp(-1j * theta / 2), 0],\r\n [0, torch.exp(1j * theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef u3_matrix(theta, phi, lam):\r\n return torch.tensor([[torch.cos(theta / 2), -torch.exp(1j * lam) * torch.sin(theta / 2)],\r\n [torch.exp(1j * phi) * torch.sin(theta / 2), torch.exp(1j * (phi + lam)) * torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef crx_matrix(theta):\r\n return torch.tensor([[1, 0, 0, 0],\r\n [0, 1, 0, 0],\r\n [0, 0, torch.cos(theta / 2), -1j * torch.sin(theta / 2)],\r\n [0, 0, -1j * torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef cry_matrix(theta):\r\n return torch.tensor([[1, 0, 0, 0],\r\n [0, 1, 0, 0],\r\n [0, 0, torch.cos(theta / 2), -torch.sin(theta / 2)],\r\n [0, 0, torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef crz_matrix(theta):\r\n return torch.tensor([[1, 0, 0, 0],\r\n [0, 1, 0, 0],\r\n [0, 0, torch.exp(-1j * theta / 2), 0],\r\n [0, 0, 0, torch.exp(1j * theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef cu3_matrix(theta, phi, lam):\r\n return torch.tensor([[1, 0, 0, 0],\r\n [0, 1, 0, 0],\r\n [0, 0, torch.cos(theta / 2), -torch.exp(1j * lam) * torch.sin(theta / 2)],\r\n [0, 0, torch.exp(1j * phi) * torch.sin(theta / 2), torch.exp(1j * (phi + lam)) * torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\n"})}),"\n",(0,a.jsx)(s.p,{children:"Now the Gate class, which stores the parameters (if any) and qubits:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"class Gate(nn.Module):\r\n def __init__(self, gate_matrix_fn, wires: list, n_params: int):\r\n super(Gate, self).__init__()\r\n self.wires = wires\r\n self.n_params = n_params\r\n self.gate_matrix_fn = gate_matrix_fn\r\n self.params = nn.Parameter(torch.randn(n_params, dtype=torch.float32)).uniform_(-np.pi, np.pi) # Unifrom distribution between -pi and pi\r\n \r\n def forward(self, state):\r\n gate_matrix = self.gate_matrix_fn(*self.params)\r\n return apply_gate(state, gate_matrix, self.wires)\n"})}),"\n",(0,a.jsx)(s.h3,{id:"angle-encoding",children:"Angle Encoding"}),"\n",(0,a.jsx)(s.p,{children:"Angle encoding, as mentioned above, encodes the input tensor into the state vector using rotation gates (rx, ry, u3, etc)."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:'class AngleEncoding(nn.Module):\r\n """\r\n Example functions list:\r\n [{"gate": \'rx\', "wires": 0, "input_idx": 0},\r\n {"gate": \'ry\', "wires": 1, "input_idx": 1},\r\n {"gate": \'rz\', "wires": 2, "input_idx": 2},]\r\n or\r\n [{"gate": \'u3\', "wires": 0, "input_idx": [0, 1, 2]},\r\n {"gate": \'rx\', "wires": 1, "input_idx": 1},\r\n {"gate": \'cu3\', "wires": [1, 2], "input_idx": [0, 1, 2]},]\r\n """\r\n def __init__(self, func_list):\r\n super().__init__()\r\n self.func_list = func_list\r\n\r\n def forward(self, state, x):\r\n for info in self.func_list:\r\n params = x[:, [info["input_idx"]]] if len(x.shape) > 1 else x[info["input_idx"]]\r\n gate = info["gate"] + \'_matrix\'\r\n fn = globals()[gate] # Get the function from the globals\r\n mat = torch.stack([fn(*p) for p in params], dim=0) if len(x.shape) > 1 else fn(*params) # Gate matrix\r\n state = apply_gate(\r\n state,\r\n mat=mat,\r\n wires=info["wires"],\r\n )\r\n return state\n'})}),"\n",(0,a.jsx)(s.h3,{id:"measurement",children:"Measurement"}),"\n",(0,a.jsxs)(s.p,{children:["For the measurement, we will measure the expected values of all qubits based on a observable matrix of size ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mi,{children:"n"})]}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mi,{children:"n"})]})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"2^n \\times 2^n"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.7477em",verticalAlign:"-0.0833em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.6644em"},children:(0,a.jsxs)(s.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"2.7em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6644em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.6644em"},children:(0,a.jsxs)(s.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"2.7em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]})]})]})]}),", which typically is either Pauli-X, Pauli-Y, or Pauli-Z. Mathematically it is ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e8"}),(0,a.jsx)(s.mi,{children:"\u03c8"}),(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mi,{children:"O"}),(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mi,{children:"\u03c8"}),(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e9"})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"\\langle\\psi|O|\\psi\\rangle"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,a.jsx)(s.span,{className:"mopen",children:"\u27e8"}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c8"}),(0,a.jsx)(s.span,{className:"mord",children:"\u2223"}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"O"}),(0,a.jsx)(s.span,{className:"mord",children:"\u2223"}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c8"}),(0,a.jsx)(s.span,{className:"mclose",children:"\u27e9"})]})})]}),"."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"def measure_pauli_expectations(state, observable_matrix):\r\n num_qubits = len(state.shape) - 1\r\n batch_size = state.shape[0]\r\n expected_values = torch.empty((batch_size, num_qubits), dtype=state.real.dtype, device=state.device)\r\n observable_matrix = observable_matrix.to(state.device).to(state.dtype)\r\n\r\n # Compute the expectation value for each qubit\r\n for qubit in range(num_qubits):\r\n # Permute to bring the qubit of interest to the last position\r\n dims = list(range(1, num_qubits + 1))\r\n dims.append(dims.pop(qubit)) # Move the qubit index to the end\r\n permuted_state = state.permute([0] + dims)\r\n \r\n # Reshape to combine all other dimensions except the last two\r\n reshaped_state = permuted_state.reshape(batch_size, -1, 2)\r\n \r\n # Apply observable and calculate expectation value\r\n # Here we calculate for the current qubit\r\n measured_state = torch.matmul(reshaped_state, observable_matrix)\r\n probabilities = torch.matmul(measured_state, reshaped_state.transpose(-2, -1)).diagonal(dim1=-2, dim2=-1)\r\n expected_value = probabilities.sum(dim=-1) # Sum over the states to get the expectation\r\n\r\n # Store the computed expected value for the current qubit\r\n expected_values[:, qubit] = expected_value.real\r\n\r\n return expected_values\n"})}),"\n",(0,a.jsx)(s.h3,{id:"model",children:"Model"}),"\n",(0,a.jsxs)(s.p,{children:["We will use the MNIST dataset for the testing. We will only use the first 5 numbers (0, 1, 2, 3, 4) and the image size will be reduced to ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mn,{children:"5"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mn,{children:"5"})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"5 \\times 5"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,a.jsx)(s.span,{className:"mord",children:"5"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6444em"}}),(0,a.jsx)(s.span,{className:"mord",children:"5"})]})]})]})," to reduce complexity. The Variational Quantum Circuit (VQC) consists 4 blocks of single and double qubits parameterized gates."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:'class VQC(nn.Module):\r\n def __init__(self):\r\n super(VQC, self).__init__()\r\n self.n_wires = 5 # Number of qubits in the circuit\r\n self.encoding = AngleEncoding([\r\n {"input_idx": [0], "gate": "ry", "wires": [0]},\r\n {"input_idx": [1], "gate": "ry", "wires": [1]},\r\n {"input_idx": [2], "gate": "ry", "wires": [2]},\r\n {"input_idx": [3], "gate": "ry", "wires": [3]},\r\n {"input_idx": [4], "gate": "ry", "wires": [4]},\r\n {"input_idx": [5], "gate": "rz", "wires": [0]},\r\n {"input_idx": [6], "gate": "rz", "wires": [1]},\r\n {"input_idx": [7], "gate": "rz", "wires": [2]},\r\n {"input_idx": [8], "gate": "rz", "wires": [3]},\r\n {"input_idx": [9], "gate": "rz", "wires": [4]},\r\n {"input_idx": [10], "gate": "rx", "wires": [0]},\r\n {"input_idx": [11], "gate": "rx", "wires": [1]},\r\n {"input_idx": [12], "gate": "rx", "wires": [2]},\r\n {"input_idx": [13], "gate": "rx", "wires": [3]},\r\n {"input_idx": [14], "gate": "rx", "wires": [4]},\r\n {"input_idx": [15], "gate": "ry", "wires": [0]},\r\n {"input_idx": [16], "gate": "ry", "wires": [1]},\r\n {"input_idx": [17], "gate": "ry", "wires": [2]},\r\n {"input_idx": [18], "gate": "ry", "wires": [3]},\r\n {"input_idx": [19], "gate": "ry", "wires": [4]},\r\n {"input_idx": [20], "gate": "rz", "wires": [0]},\r\n {"input_idx": [21], "gate": "rz", "wires": [1]},\r\n {"input_idx": [22], "gate": "rz", "wires": [2]},\r\n {"input_idx": [23], "gate": "rz", "wires": [3]},\r\n {"input_idx": [24], "gate": "rz", "wires": [4]},\r\n ]) # Encode 16 features into 4 qubits\r\n \r\n layers = []\r\n for _ in range(4):\r\n layers.extend([\r\n Gate(cnot_matrix, [0, 1], 0),\r\n Gate(cnot_matrix, [1, 2], 0),\r\n Gate(cnot_matrix, [2, 3], 0),\r\n Gate(cnot_matrix, [3, 4], 0),\r\n Gate(cnot_matrix, [4, 0], 0),\r\n Gate(rx_matrix, [0], 1),\r\n Gate(rx_matrix, [1], 1),\r\n Gate(rx_matrix, [2], 1),\r\n Gate(rx_matrix, [3], 1),\r\n Gate(rx_matrix, [4], 1),\r\n Gate(cu3_matrix, [1, 0], 3),\r\n Gate(cu3_matrix, [2, 1], 3),\r\n Gate(cu3_matrix, [3, 2], 3),\r\n Gate(cu3_matrix, [4, 3], 3),\r\n Gate(cu3_matrix, [0, 4], 3),\r\n Gate(u3_matrix, [0], 3),\r\n Gate(u3_matrix, [1], 3),\r\n Gate(u3_matrix, [2], 3),\r\n Gate(u3_matrix, [3], 3),\r\n Gate(u3_matrix, [4], 3),\r\n ])\r\n self.qnn = nn.Sequential(*layers)\r\n \r\n def forward(self, x):\r\n state = torch.zeros(x.shape[0], 2**self.n_wires, dtype=torch.complex64, device=x.device).reshape(x.shape[0], 2, 2, 2, 2, 2)\r\n state[:, 0, 0, 0, 0, 0] = 1 # Initialize the state to |0001>\r\n state = self.encoding(state, x.view(x.shape[0], -1)) # Encode the input features\r\n state = self.qnn(state)\r\n measured = measure_pauli_expectations(state, pauli_z_matrix())\r\n return F.log_softmax(measured, dim=-1)\n'})}),"\n",(0,a.jsx)(s.h3,{id:"dataset",children:"Dataset"}),"\n",(0,a.jsxs)(s.p,{children:["We will process the MNIST to include only first 5 digits and resize it to ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mn,{children:"5"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mn,{children:"5"})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"5 \\times 5"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,a.jsx)(s.span,{className:"mord",children:"5"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6444em"}}),(0,a.jsx)(s.span,{className:"mord",children:"5"})]})]})]}),"."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"class MNISTDigitsDataset(datasets.MNIST):\r\n def __init__(self, root, train=True, transform=None, target_transform=None, download=False):\r\n super().__init__(root, train=train, transform=transform, target_transform=target_transform, download=download)\r\n # Filter indices for digits 0 to 3\r\n indices = [i for i, label in enumerate(self.targets) if label in [0, 1, 2, 3, 4]]\r\n self.data = self.data[indices]\r\n self.targets = self.targets[indices]\r\n\r\n def __getitem__(self, index):\r\n with torch.no_grad():\r\n # Get the image and target label\r\n img, target = self.data[index], int(self.targets[index])\r\n \r\n # Convert image to PIL for transformations\r\n img = transforms.functional.to_pil_image(img)\r\n \r\n # Apply transformations if any\r\n if self.transform:\r\n img = self.transform(img)\r\n \r\n if self.target_transform:\r\n target = self.target_transform(target)\r\n \r\n return img, target\r\n\r\n def __len__(self):\r\n return len(self.data)\r\n\r\ntransform = transforms.Compose([\r\n transforms.Resize((5, 5)), # Resize the image to 5x5\r\n transforms.ToTensor() # Convert the image to a PyTorch tensor\r\n])\r\n\r\n# Initialize the dataset\r\ntrain_dataset = MNISTDigitsDataset(root='./data', train=True, transform=transform, download=True)\r\nvalid_dataset = MNISTDigitsDataset(root='./data', train=False, transform=transform, download=True)\r\n\r\n# Create the DataLoader\r\nbatch_size = 32\r\ntrain_dataloader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True)\r\nvalid_dataloader = DataLoader(valid_dataset, batch_size=batch_size, shuffle=False)\n"})}),"\n",(0,a.jsx)(s.h3,{id:"training-loop",children:"Training Loop"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\r\nmodel = VQC().to(device)\r\n\r\nloss_fn = nn.NLLLoss()\r\noptimizer = torch.optim.Adam(model.parameters(), lr=0.01)\r\n\r\n# Training loop\r\nnum_epochs = 5\r\ntrain_losses = []\r\nvalid_losses = []\r\nvalid_accuracies = []\r\nfor epoch in range(num_epochs):\r\n for batch, (images, labels) in enumerate(train_dataloader):\r\n images, labels = images.to(device), labels.to(device)\r\n optimizer.zero_grad()\r\n outputs = model(images)\r\n loss = loss_fn(outputs, labels)\r\n loss.backward()\r\n optimizer.step()\r\n train_losses.append(loss.item())\r\n \r\n if (batch + 1) % 50 == 0:\r\n print(f\"Epoch {epoch + 1}/{num_epochs}, Iteration: {batch+1}, Loss: {loss.item()}\")\r\n if batch == 500:\r\n break # Stop early to speed up the training process\r\n \r\n # Validation loop\r\n model.eval()\r\n with torch.no_grad():\r\n total = 0\r\n correct = 0\r\n for batch, (images, labels) in enumerate(valid_dataloader):\r\n images, labels = images.to(device), labels.to(device)\r\n outputs = model(images)\r\n loss = loss_fn(outputs, labels)\r\n valid_losses.append(loss.item())\r\n \r\n _, predicted = torch.max(outputs, 1)\r\n total += labels.size(0)\r\n correct += (predicted == labels).sum().item()\r\n\r\n if batch == 100:\r\n break # Stop early to speed up the validation process\r\n \r\n accuracy = correct / total\r\n valid_accuracies.append(accuracy)\r\n print(f\"Validation accuracy: {accuracy}, Loss: {loss.item()}\")\r\n model.train()\n"})}),"\n",(0,a.jsx)(s.p,{children:"And finally plot the result:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"# plot\r\nplt.plot(train_losses, label='Training loss')\r\nplt.plot(valid_losses, label='Validation loss')\r\nplt.xlabel('Iterations')\r\nplt.ylabel('Loss')\r\nplt.legend()\r\nplt.title('Training and Validation Loss')\r\nplt.show()\r\n\r\nplt.plot(valid_accuracies)\r\nplt.xlabel('Iterations')\r\nplt.ylabel('Accuracy')\r\nplt.title('Validation Accuracy')\r\nplt.show()\n"})})]})}function o(e={}){const{wrapper:s}={...(0,n.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>i,x:()=>l});var a=t(6540);const n={},r=a.createContext(n);function i(e){const s=a.useContext(r);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),a.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/143844fc.fead2dc2.js b/assets/js/143844fc.fead2dc2.js new file mode 100644 index 0000000..bcf6f82 --- /dev/null +++ b/assets/js/143844fc.fead2dc2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[8884],{5653:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>r,metadata:()=>l,toc:()=>m});var a=t(4848),n=t(8453);const r={slug:"intro-to-qnn",title:"Introduction to Quantum Neural Networks",authors:"eason",tags:["intermediate","quantum","qnn","pytorch","tutorial"]},i=void 0,l={permalink:"/blog/intro-to-qnn",source:"@site/blog/2024-2-9-intro-to-qnn/index.md",title:"Introduction to Quantum Neural Networks",description:"Make a Quantum Neural Network (QNN) in PyTorch.",date:"2024-02-09T00:00:00.000Z",tags:[{label:"intermediate",permalink:"/blog/tags/intermediate"},{label:"quantum",permalink:"/blog/tags/quantum"},{label:"qnn",permalink:"/blog/tags/qnn"},{label:"pytorch",permalink:"/blog/tags/pytorch"},{label:"tutorial",permalink:"/blog/tags/tutorial"}],readingTime:9.51,hasTruncateMarker:!0,authors:[{name:"Eason Xie",title:"Website Owner",url:"https://easonoob.github.io",imageURL:"https://avatars.githubusercontent.com/u/100521878?v=4",key:"eason"}],frontMatter:{slug:"intro-to-qnn",title:"Introduction to Quantum Neural Networks",authors:"eason",tags:["intermediate","quantum","qnn","pytorch","tutorial"]},unlisted:!1,prevItem:{title:"Preparing a Gaussian State in the Symmetrical Domain",permalink:"/blog/mit-iquhack-solution"},nextItem:{title:"Introduction to Quantum Computing",permalink:"/blog/intro-to-quantum-computing"}},c={authorsImageUrls:[void 0]},m=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Simulation",id:"simulation",level:2},{value:"Define Gate Matrices",id:"define-gate-matrices",level:3},{value:"Angle Encoding",id:"angle-encoding",level:3},{value:"Measurement",id:"measurement",level:3},{value:"Model",id:"model",level:3},{value:"Dataset",id:"dataset",level:3},{value:"Training Loop",id:"training-loop",level:3}];function h(e){const s={a:"a",annotation:"annotation",code:"code",h2:"h2",h3:"h3",li:"li",math:"math",mi:"mi",mn:"mn",mo:"mo",mrow:"mrow",msup:"msup",mtext:"mtext",munder:"munder",p:"p",path:"path",pre:"pre",semantics:"semantics",span:"span",svg:"svg",ul:"ul",...(0,n.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.p,{children:"Make a Quantum Neural Network (QNN) in PyTorch."}),"\n",(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"https://easonoob.github.io/blog/intro-to-quantum-computing",children:"last blog post"}),", we talked about the very basics of quantum computing, and tried a few examples with qiskit. In this post, we will try to build a QNN completely with PyTorch only, without quantum simulation / machine learning libraries like PennyLane or TorchQuantum, so we can know what really happens inside the simulation. Let's get started!"]}),"\n",(0,a.jsx)(s.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Read and Understand the last post"}),"\n",(0,a.jsx)(s.li,{children:"Basic Python & PyTorch"}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"simulation",children:"Simulation"}),"\n",(0,a.jsx)(s.p,{children:"Import necessary libraries:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"import torch, torch.nn as nn, torch.nn.functional as F\r\nfrom typing import Union, List\r\nimport numpy as np\r\nfrom torchvision import datasets, transforms\r\nfrom torch.utils.data import DataLoader\r\nimport matplotlib.pyplot as plt\n"})}),"\n",(0,a.jsxs)(s.p,{children:["We know a quantum state vector of a single qubit can be represented as ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mi,{children:"\u03c8"}),(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e9"}),(0,a.jsx)(s.mo,{children:"="}),(0,a.jsx)(s.mi,{children:"\u03b1"}),(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mn,{children:"0"}),(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e9"}),(0,a.jsx)(s.mo,{children:"+"}),(0,a.jsx)(s.mi,{children:"\u03b2"}),(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mn,{children:"1"}),(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e9"})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"|\\psi\\rangle = \\alpha |0\\rangle + \\beta |1\\rangle"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,a.jsx)(s.span,{className:"mord",children:"\u2223"}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c8"}),(0,a.jsx)(s.span,{className:"mclose",children:"\u27e9"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,a.jsx)(s.span,{className:"mrel",children:"="}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.0037em"},children:"\u03b1"}),(0,a.jsx)(s.span,{className:"mord",children:"\u22230"}),(0,a.jsx)(s.span,{className:"mclose",children:"\u27e9"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"+"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.05278em"},children:"\u03b2"}),(0,a.jsx)(s.span,{className:"mord",children:"\u22231"}),(0,a.jsx)(s.span,{className:"mclose",children:"\u27e9"})]})]})]}),", and numerous qubits can be combined into a large state of ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mi,{children:"n"})]})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"2^n"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6644em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.6644em"},children:(0,a.jsxs)(s.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"2.7em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]})]})})]})," propabilities. For the simulation, we will create a single large state vector ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsx)(s.mi,{children:"h"})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"h"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6944em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",children:"h"})]})})]})," which stores all qubits in the system (not very efficient but this is the easiest) with ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mi,{children:"h"}),(0,a.jsx)(s.mo,{children:"\u2208"}),(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mi,{mathvariant:"double-struck",children:"R"}),(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mi,{children:"b"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsxs)(s.munder,{children:[(0,a.jsxs)(s.munder,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mo,{children:"\u22ef"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mn,{children:"2"})]}),(0,a.jsx)(s.mo,{stretchy:"true",children:"\u23df"})]}),(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mi,{children:"n"}),(0,a.jsx)(s.mtext,{children:"\xa0times"})]})]})]})]})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"h \\in \\mathbb{R}^{b \\times \\underbrace{2 \\times 2 \\times \\cdots \\times 2}_{n \\text{ times}}}"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.7335em",verticalAlign:"-0.0391em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",children:"h"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,a.jsx)(s.span,{className:"mrel",children:"\u2208"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1.5797em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord mathbb",children:"R"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"1.5797em"},children:(0,a.jsxs)(s.span,{style:{top:"-4.0936em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsxs)(s.span,{className:"mord mtight",children:[(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"b"}),(0,a.jsx)(s.span,{className:"mbin mtight",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mord munder mtight",children:(0,a.jsxs)(s.span,{className:"vlist-t vlist-t2",children:[(0,a.jsxs)(s.span,{className:"vlist-r",children:[(0,a.jsxs)(s.span,{className:"vlist",style:{height:"0.6444em"},children:[(0,a.jsxs)(s.span,{style:{top:"-1.5916em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size3 size1 mtight",children:(0,a.jsxs)(s.span,{className:"mord mtight",children:[(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"}),(0,a.jsx)(s.span,{className:"mord text mtight",children:(0,a.jsx)(s.span,{className:"mord mtight",children:"\xa0times"})})]})})]}),(0,a.jsxs)(s.span,{style:{top:"-3em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsx)(s.span,{className:"mord munder mtight",children:(0,a.jsxs)(s.span,{className:"vlist-t vlist-t2",children:[(0,a.jsxs)(s.span,{className:"vlist-r",children:[(0,a.jsxs)(s.span,{className:"vlist",style:{height:"0.6444em"},children:[(0,a.jsxs)(s.span,{className:"svg-align",style:{top:"-2.2687em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsxs)(s.span,{className:"stretchy mtight",style:{height:"0.548em",minWidth:"1.6em"},children:[(0,a.jsx)(s.span,{className:"brace-left mtight",style:{height:"0.548em"},children:(0,a.jsx)(s.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"0.548em",viewBox:"0 0 400000 548",preserveAspectRatio:"xMinYMin slice",children:(0,a.jsx)(s.path,{d:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z"})})}),(0,a.jsx)(s.span,{className:"brace-center mtight",style:{height:"0.548em"},children:(0,a.jsx)(s.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"0.548em",viewBox:"0 0 400000 548",preserveAspectRatio:"xMidYMin slice",children:(0,a.jsx)(s.path,{d:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z"})})}),(0,a.jsx)(s.span,{className:"brace-right mtight",style:{height:"0.548em"},children:(0,a.jsx)(s.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"0.548em",viewBox:"0 0 400000 548",preserveAspectRatio:"xMaxYMin slice",children:(0,a.jsx)(s.path,{d:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z"})})})]})]}),(0,a.jsxs)(s.span,{style:{top:"-3em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"minner",children:"\u22ef"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mord",children:"2"})]})]})]}),(0,a.jsx)(s.span,{className:"vlist-s",children:"\u200b"})]}),(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.7313em"},children:(0,a.jsx)(s.span,{})})})]})})]})]}),(0,a.jsx)(s.span,{className:"vlist-s",children:"\u200b"})]}),(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"1.4084em"},children:(0,a.jsx)(s.span,{})})})]})})]})})]})})})})})]})]})]})]})," which ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsx)(s.mi,{children:"b"})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"b"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6944em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",children:"b"})]})})]})," is batch size, ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsx)(s.mi,{children:"n"})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"n"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.4306em"}}),(0,a.jsx)(s.span,{className:"mord mathnormal",children:"n"})]})})]})," is number of qubits so that for each batch, there are ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsx)(s.mrow,{children:(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mi,{children:"n"})]})}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"2^n"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6644em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.6644em"},children:(0,a.jsxs)(s.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"2.7em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]})]})})]})," propabilities."]}),"\n",(0,a.jsx)(s.p,{children:"To apply the gate to a specific qubit in the state vector, we can simply permute the target qubit dimension to the back, then multiply it with the gate matrix. For double qubits gates, we can permute the control and target to the back, combine the two dimensions, multiply the gate matrix, and reshape back. Here is a function that applied the gate to the state:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:'def apply_gate(state, mat, wires: Union[int, List[int]]):\r\n """\r\n Apply the gate matrix/matrices to the state vector using torch.bmm method.\r\n \r\n Args:\r\n state (torch.Tensor): The state vector.\r\n mat (torch.Tensor): The gate matrix/matrices.\r\n wires (int or List[int]): Which qubit(s) the operation is applied to.\r\n \r\n Returns:\r\n torch.Tensor: The updated state vector.\r\n """\r\n # Handle input for single qubit as a list for uniformity\r\n if isinstance(wires, int):\r\n wires = [wires]\r\n \r\n # Ensure the matrix is on the same device and dtype as the state\r\n mat = mat.to(state.device).to(state.dtype)\r\n \r\n # Calculate the new order of dimensions for the state to match matrix multiplication needs\r\n num_qubits = len(state.shape) - 1\r\n permute_order = list(range(1, num_qubits + 1)) # Start from 1 to account for batch dimension\r\n for index, wire in enumerate(wires):\r\n permute_order.remove(wire + 1) # Remove wire from its current place\r\n permute_order.insert(index, wire + 1) # Insert wire right after the batch dimension\r\n\r\n # Permute the state tensor to bring the target wire dimensions next to the batch dimension\r\n permuted_state = state.permute([0] + permute_order) # Batch dimension remains the first\r\n reshaped_state = permuted_state.reshape(state.shape[0], -1, mat.size(-1))\r\n \r\n # Apply the gate using matrix multiplication\r\n new_state = torch.bmm(reshaped_state, mat) if len(mat.shape) == 3 else reshaped_state @ mat\r\n \r\n # Reshape and permute back to the original shape and order\r\n final_state = new_state.view(state.shape).permute(list(np.argsort([0] + permute_order)))\r\n \r\n return final_state\n'})}),"\n",(0,a.jsx)(s.p,{children:"The reason for the input to accept batched gate matrices is for the angle encoding later, which encodes inputs into the state."}),"\n",(0,a.jsx)(s.h3,{id:"define-gate-matrices",children:"Define Gate Matrices"}),"\n",(0,a.jsx)(s.p,{children:"Now the gate matrix functions:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"def h_matrix():\r\n return 1 / np.sqrt(2) * torch.tensor([[1, 1], [1, -1]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef cnot_matrix():\r\n return torch.tensor([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef pauli_x_matrix():\r\n return torch.tensor([[0, 1], [1, 0]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef pauli_y_matrix():\r\n return torch.tensor([[0, -1j], [1j, 0]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef pauli_z_matrix():\r\n return torch.tensor([[1, 0], [0, -1]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef rx_matrix(theta):\r\n return torch.tensor([[torch.cos(theta / 2), -1j * torch.sin(theta / 2)],\r\n [-1j * torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef ry_matrix(theta):\r\n return torch.tensor([[torch.cos(theta / 2), -torch.sin(theta / 2)],\r\n [torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef rz_matrix(theta):\r\n return torch.tensor([[torch.exp(-1j * theta / 2), 0],\r\n [0, torch.exp(1j * theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef u3_matrix(theta, phi, lam):\r\n return torch.tensor([[torch.cos(theta / 2), -torch.exp(1j * lam) * torch.sin(theta / 2)],\r\n [torch.exp(1j * phi) * torch.sin(theta / 2), torch.exp(1j * (phi + lam)) * torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef crx_matrix(theta):\r\n return torch.tensor([[1, 0, 0, 0],\r\n [0, 1, 0, 0],\r\n [0, 0, torch.cos(theta / 2), -1j * torch.sin(theta / 2)],\r\n [0, 0, -1j * torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef cry_matrix(theta):\r\n return torch.tensor([[1, 0, 0, 0],\r\n [0, 1, 0, 0],\r\n [0, 0, torch.cos(theta / 2), -torch.sin(theta / 2)],\r\n [0, 0, torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef crz_matrix(theta):\r\n return torch.tensor([[1, 0, 0, 0],\r\n [0, 1, 0, 0],\r\n [0, 0, torch.exp(-1j * theta / 2), 0],\r\n [0, 0, 0, torch.exp(1j * theta / 2)]], dtype=torch.complex64, requires_grad=True)\r\n\r\ndef cu3_matrix(theta, phi, lam):\r\n return torch.tensor([[1, 0, 0, 0],\r\n [0, 1, 0, 0],\r\n [0, 0, torch.cos(theta / 2), -torch.exp(1j * lam) * torch.sin(theta / 2)],\r\n [0, 0, torch.exp(1j * phi) * torch.sin(theta / 2), torch.exp(1j * (phi + lam)) * torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\n"})}),"\n",(0,a.jsx)(s.p,{children:"Now the Gate class, which stores the parameters (if any) and qubits:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"class Gate(nn.Module):\r\n def __init__(self, gate_matrix_fn, wires: list, n_params: int):\r\n super(Gate, self).__init__()\r\n self.wires = wires\r\n self.n_params = n_params\r\n self.gate_matrix_fn = gate_matrix_fn\r\n self.params = nn.Parameter(torch.randn(n_params, dtype=torch.float32)).uniform_(-np.pi, np.pi) # Unifrom distribution between -pi and pi\r\n \r\n def forward(self, state):\r\n gate_matrix = self.gate_matrix_fn(*self.params)\r\n return apply_gate(state, gate_matrix, self.wires)\n"})}),"\n",(0,a.jsx)(s.h3,{id:"angle-encoding",children:"Angle Encoding"}),"\n",(0,a.jsx)(s.p,{children:"Angle encoding, as mentioned above, encodes the input tensor into the state vector using rotation gates (rx, ry, u3, etc)."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:'class AngleEncoding(nn.Module):\r\n """\r\n Example functions list:\r\n [{"gate": \'rx\', "wires": 0, "input_idx": 0},\r\n {"gate": \'ry\', "wires": 1, "input_idx": 1},\r\n {"gate": \'rz\', "wires": 2, "input_idx": 2},]\r\n or\r\n [{"gate": \'u3\', "wires": 0, "input_idx": [0, 1, 2]},\r\n {"gate": \'rx\', "wires": 1, "input_idx": 1},\r\n {"gate": \'cu3\', "wires": [1, 2], "input_idx": [0, 1, 2]},]\r\n """\r\n def __init__(self, func_list):\r\n super().__init__()\r\n self.func_list = func_list\r\n\r\n def forward(self, state, x):\r\n for info in self.func_list:\r\n params = x[:, [info["input_idx"]]] if len(x.shape) > 1 else x[info["input_idx"]]\r\n gate = info["gate"] + \'_matrix\'\r\n fn = globals()[gate] # Get the function from the globals\r\n mat = torch.stack([fn(*p) for p in params], dim=0) if len(x.shape) > 1 else fn(*params) # Gate matrix\r\n state = apply_gate(\r\n state,\r\n mat=mat,\r\n wires=info["wires"],\r\n )\r\n return state\n'})}),"\n",(0,a.jsx)(s.h3,{id:"measurement",children:"Measurement"}),"\n",(0,a.jsxs)(s.p,{children:["For the measurement, we will measure the expected values of all qubits based on a observable matrix of size ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mi,{children:"n"})]}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsxs)(s.msup,{children:[(0,a.jsx)(s.mn,{children:"2"}),(0,a.jsx)(s.mi,{children:"n"})]})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"2^n \\times 2^n"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.7477em",verticalAlign:"-0.0833em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.6644em"},children:(0,a.jsxs)(s.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"2.7em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6644em"}}),(0,a.jsxs)(s.span,{className:"mord",children:[(0,a.jsx)(s.span,{className:"mord",children:"2"}),(0,a.jsx)(s.span,{className:"msupsub",children:(0,a.jsx)(s.span,{className:"vlist-t",children:(0,a.jsx)(s.span,{className:"vlist-r",children:(0,a.jsx)(s.span,{className:"vlist",style:{height:"0.6644em"},children:(0,a.jsxs)(s.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,a.jsx)(s.span,{className:"pstrut",style:{height:"2.7em"}}),(0,a.jsx)(s.span,{className:"sizing reset-size6 size3 mtight",children:(0,a.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]})]})]})]}),", which typically is either Pauli-X, Pauli-Y, or Pauli-Z. Mathematically it is ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e8"}),(0,a.jsx)(s.mi,{children:"\u03c8"}),(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mi,{children:"O"}),(0,a.jsx)(s.mi,{mathvariant:"normal",children:"\u2223"}),(0,a.jsx)(s.mi,{children:"\u03c8"}),(0,a.jsx)(s.mo,{stretchy:"false",children:"\u27e9"})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"\\langle\\psi|O|\\psi\\rangle"})]})})}),(0,a.jsx)(s.span,{className:"katex-html","aria-hidden":"true",children:(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,a.jsx)(s.span,{className:"mopen",children:"\u27e8"}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c8"}),(0,a.jsx)(s.span,{className:"mord",children:"\u2223"}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"O"}),(0,a.jsx)(s.span,{className:"mord",children:"\u2223"}),(0,a.jsx)(s.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c8"}),(0,a.jsx)(s.span,{className:"mclose",children:"\u27e9"})]})})]}),"."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"def measure_pauli_expectations(state, observable_matrix):\r\n num_qubits = len(state.shape) - 1\r\n batch_size = state.shape[0]\r\n expected_values = torch.empty((batch_size, num_qubits), dtype=state.real.dtype, device=state.device)\r\n observable_matrix = observable_matrix.to(state.device).to(state.dtype)\r\n\r\n # Compute the expectation value for each qubit\r\n for qubit in range(num_qubits):\r\n # Permute to bring the qubit of interest to the last position\r\n dims = list(range(1, num_qubits + 1))\r\n dims.append(dims.pop(qubit)) # Move the qubit index to the end\r\n permuted_state = state.permute([0] + dims)\r\n \r\n # Reshape to combine all other dimensions except the last two\r\n reshaped_state = permuted_state.reshape(batch_size, -1, 2)\r\n \r\n # Apply observable and calculate expectation value\r\n # Here we calculate for the current qubit\r\n measured_state = torch.matmul(reshaped_state, observable_matrix)\r\n probabilities = torch.matmul(measured_state, reshaped_state.transpose(-2, -1)).diagonal(dim1=-2, dim2=-1)\r\n expected_value = probabilities.sum(dim=-1) # Sum over the states to get the expectation\r\n\r\n # Store the computed expected value for the current qubit\r\n expected_values[:, qubit] = expected_value.real\r\n\r\n return expected_values\n"})}),"\n",(0,a.jsx)(s.h3,{id:"model",children:"Model"}),"\n",(0,a.jsxs)(s.p,{children:["We will use the MNIST dataset for the testing. We will only use the first 5 numbers (0, 1, 2, 3, 4) and the image size will be reduced to ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mn,{children:"5"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mn,{children:"5"})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"5 \\times 5"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,a.jsx)(s.span,{className:"mord",children:"5"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6444em"}}),(0,a.jsx)(s.span,{className:"mord",children:"5"})]})]})]})," to reduce complexity. The Variational Quantum Circuit (VQC) consists 4 blocks of single and double qubits parameterized gates."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:'class VQC(nn.Module):\r\n def __init__(self):\r\n super(VQC, self).__init__()\r\n self.n_wires = 5 # Number of qubits in the circuit\r\n self.encoding = AngleEncoding([\r\n {"input_idx": [0], "gate": "ry", "wires": [0]},\r\n {"input_idx": [1], "gate": "ry", "wires": [1]},\r\n {"input_idx": [2], "gate": "ry", "wires": [2]},\r\n {"input_idx": [3], "gate": "ry", "wires": [3]},\r\n {"input_idx": [4], "gate": "ry", "wires": [4]},\r\n {"input_idx": [5], "gate": "rz", "wires": [0]},\r\n {"input_idx": [6], "gate": "rz", "wires": [1]},\r\n {"input_idx": [7], "gate": "rz", "wires": [2]},\r\n {"input_idx": [8], "gate": "rz", "wires": [3]},\r\n {"input_idx": [9], "gate": "rz", "wires": [4]},\r\n {"input_idx": [10], "gate": "rx", "wires": [0]},\r\n {"input_idx": [11], "gate": "rx", "wires": [1]},\r\n {"input_idx": [12], "gate": "rx", "wires": [2]},\r\n {"input_idx": [13], "gate": "rx", "wires": [3]},\r\n {"input_idx": [14], "gate": "rx", "wires": [4]},\r\n {"input_idx": [15], "gate": "ry", "wires": [0]},\r\n {"input_idx": [16], "gate": "ry", "wires": [1]},\r\n {"input_idx": [17], "gate": "ry", "wires": [2]},\r\n {"input_idx": [18], "gate": "ry", "wires": [3]},\r\n {"input_idx": [19], "gate": "ry", "wires": [4]},\r\n {"input_idx": [20], "gate": "rz", "wires": [0]},\r\n {"input_idx": [21], "gate": "rz", "wires": [1]},\r\n {"input_idx": [22], "gate": "rz", "wires": [2]},\r\n {"input_idx": [23], "gate": "rz", "wires": [3]},\r\n {"input_idx": [24], "gate": "rz", "wires": [4]},\r\n ]) # Encode 16 features into 4 qubits\r\n \r\n layers = []\r\n for _ in range(4):\r\n layers.extend([\r\n Gate(cnot_matrix, [0, 1], 0),\r\n Gate(cnot_matrix, [1, 2], 0),\r\n Gate(cnot_matrix, [2, 3], 0),\r\n Gate(cnot_matrix, [3, 4], 0),\r\n Gate(cnot_matrix, [4, 0], 0),\r\n Gate(rx_matrix, [0], 1),\r\n Gate(rx_matrix, [1], 1),\r\n Gate(rx_matrix, [2], 1),\r\n Gate(rx_matrix, [3], 1),\r\n Gate(rx_matrix, [4], 1),\r\n Gate(cu3_matrix, [1, 0], 3),\r\n Gate(cu3_matrix, [2, 1], 3),\r\n Gate(cu3_matrix, [3, 2], 3),\r\n Gate(cu3_matrix, [4, 3], 3),\r\n Gate(cu3_matrix, [0, 4], 3),\r\n Gate(u3_matrix, [0], 3),\r\n Gate(u3_matrix, [1], 3),\r\n Gate(u3_matrix, [2], 3),\r\n Gate(u3_matrix, [3], 3),\r\n Gate(u3_matrix, [4], 3),\r\n ])\r\n self.qnn = nn.Sequential(*layers)\r\n \r\n def forward(self, x):\r\n state = torch.zeros(x.shape[0], 2**self.n_wires, dtype=torch.complex64, device=x.device).reshape(x.shape[0], 2, 2, 2, 2, 2)\r\n state[:, 0, 0, 0, 0, 0] = 1 # Initialize the state to |0001>\r\n state = self.encoding(state, x.view(x.shape[0], -1)) # Encode the input features\r\n state = self.qnn(state)\r\n measured = measure_pauli_expectations(state, pauli_z_matrix())\r\n return F.log_softmax(measured, dim=-1)\n'})}),"\n",(0,a.jsx)(s.h3,{id:"dataset",children:"Dataset"}),"\n",(0,a.jsxs)(s.p,{children:["We will process the MNIST to include only first 5 digits and resize it to ",(0,a.jsxs)(s.span,{className:"katex",children:[(0,a.jsx)(s.span,{className:"katex-mathml",children:(0,a.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,a.jsxs)(s.semantics,{children:[(0,a.jsxs)(s.mrow,{children:[(0,a.jsx)(s.mn,{children:"5"}),(0,a.jsx)(s.mo,{children:"\xd7"}),(0,a.jsx)(s.mn,{children:"5"})]}),(0,a.jsx)(s.annotation,{encoding:"application/x-tex",children:"5 \\times 5"})]})})}),(0,a.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,a.jsx)(s.span,{className:"mord",children:"5"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,a.jsx)(s.span,{className:"mbin",children:"\xd7"}),(0,a.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,a.jsxs)(s.span,{className:"base",children:[(0,a.jsx)(s.span,{className:"strut",style:{height:"0.6444em"}}),(0,a.jsx)(s.span,{className:"mord",children:"5"})]})]})]}),"."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"class MNISTDigitsDataset(datasets.MNIST):\r\n def __init__(self, root, train=True, transform=None, target_transform=None, download=False):\r\n super().__init__(root, train=train, transform=transform, target_transform=target_transform, download=download)\r\n # Filter indices for digits 0 to 3\r\n indices = [i for i, label in enumerate(self.targets) if label in [0, 1, 2, 3, 4]]\r\n self.data = self.data[indices]\r\n self.targets = self.targets[indices]\r\n\r\n def __getitem__(self, index):\r\n with torch.no_grad():\r\n # Get the image and target label\r\n img, target = self.data[index], int(self.targets[index])\r\n \r\n # Convert image to PIL for transformations\r\n img = transforms.functional.to_pil_image(img)\r\n \r\n # Apply transformations if any\r\n if self.transform:\r\n img = self.transform(img)\r\n \r\n if self.target_transform:\r\n target = self.target_transform(target)\r\n \r\n return img, target\r\n\r\n def __len__(self):\r\n return len(self.data)\r\n\r\ntransform = transforms.Compose([\r\n transforms.Resize((5, 5)), # Resize the image to 5x5\r\n transforms.ToTensor() # Convert the image to a PyTorch tensor\r\n])\r\n\r\n# Initialize the dataset\r\ntrain_dataset = MNISTDigitsDataset(root='./data', train=True, transform=transform, download=True)\r\nvalid_dataset = MNISTDigitsDataset(root='./data', train=False, transform=transform, download=True)\r\n\r\n# Create the DataLoader\r\nbatch_size = 32\r\ntrain_dataloader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True)\r\nvalid_dataloader = DataLoader(valid_dataset, batch_size=batch_size, shuffle=False)\n"})}),"\n",(0,a.jsx)(s.h3,{id:"training-loop",children:"Training Loop"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\r\nmodel = VQC().to(device)\r\n\r\nloss_fn = nn.NLLLoss()\r\noptimizer = torch.optim.Adam(model.parameters(), lr=0.01)\r\n\r\n# Training loop\r\nnum_epochs = 5\r\ntrain_losses = []\r\nvalid_losses = []\r\nvalid_accuracies = []\r\nfor epoch in range(num_epochs):\r\n for batch, (images, labels) in enumerate(train_dataloader):\r\n images, labels = images.to(device), labels.to(device)\r\n optimizer.zero_grad()\r\n outputs = model(images)\r\n loss = loss_fn(outputs, labels)\r\n loss.backward()\r\n optimizer.step()\r\n train_losses.append(loss.item())\r\n \r\n if (batch + 1) % 50 == 0:\r\n print(f\"Epoch {epoch + 1}/{num_epochs}, Iteration: {batch+1}, Loss: {loss.item()}\")\r\n if batch == 500:\r\n break # Stop early to speed up the training process\r\n \r\n # Validation loop\r\n model.eval()\r\n with torch.no_grad():\r\n total = 0\r\n correct = 0\r\n for batch, (images, labels) in enumerate(valid_dataloader):\r\n images, labels = images.to(device), labels.to(device)\r\n outputs = model(images)\r\n loss = loss_fn(outputs, labels)\r\n valid_losses.append(loss.item())\r\n \r\n _, predicted = torch.max(outputs, 1)\r\n total += labels.size(0)\r\n correct += (predicted == labels).sum().item()\r\n\r\n if batch == 100:\r\n break # Stop early to speed up the validation process\r\n \r\n accuracy = correct / total\r\n valid_accuracies.append(accuracy)\r\n print(f\"Validation accuracy: {accuracy}, Loss: {loss.item()}\")\r\n model.train()\n"})}),"\n",(0,a.jsx)(s.p,{children:"And finally plot the result:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-python",children:"# plot\r\nplt.plot(train_losses, label='Training loss')\r\nplt.plot(valid_losses, label='Validation loss')\r\nplt.xlabel('Iterations')\r\nplt.ylabel('Loss')\r\nplt.legend()\r\nplt.title('Training and Validation Loss')\r\nplt.show()\r\n\r\nplt.plot(valid_accuracies)\r\nplt.xlabel('Iterations')\r\nplt.ylabel('Accuracy')\r\nplt.title('Validation Accuracy')\r\nplt.show()\n"})})]})}function o(e={}){const{wrapper:s}={...(0,n.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>i,x:()=>l});var a=t(6540);const n={},r=a.createContext(n);function i(e){const s=a.useContext(r);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),a.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4d4c33e9.a870a56d.js b/assets/js/4d4c33e9.a870a56d.js new file mode 100644 index 0000000..fec1551 --- /dev/null +++ b/assets/js/4d4c33e9.a870a56d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[3160],{8989:(t,e,a)=>{a.r(e),a.d(e,{assets:()=>u,contentTitle:()=>r,default:()=>m,frontMatter:()=>i,metadata:()=>s,toc:()=>l});var n=a(4848),o=a(8453);const i={slug:"mit-iquhack-solution",title:"Preparing a Gaussian State in the Symmetrical Domain",authors:"eason",tags:["advanced","quantum","state-preparation"]},r=void 0,s={permalink:"/blog/mit-iquhack-solution",source:"@site/blog/2024-2-12-mit-iquhack-2025-experience/index.md",title:"Preparing a Gaussian State in the Symmetrical Domain",description:"Explanation of Our Solution at MIT iQuHACK",date:"2024-02-12T00:00:00.000Z",tags:[{label:"advanced",permalink:"/blog/tags/advanced"},{label:"quantum",permalink:"/blog/tags/quantum"},{label:"state-preparation",permalink:"/blog/tags/state-preparation"}],readingTime:8.395,hasTruncateMarker:!0,authors:[{name:"Eason Xie",title:"Website Owner",url:"https://easonoob.github.io",imageURL:"https://avatars.githubusercontent.com/u/100521878?v=4",key:"eason"}],frontMatter:{slug:"mit-iquhack-solution",title:"Preparing a Gaussian State in the Symmetrical Domain",authors:"eason",tags:["advanced","quantum","state-preparation"]},unlisted:!1,nextItem:{title:"Introduction to Quantum Neural Networks",permalink:"/blog/intro-to-qnn"}},u={authorsImageUrls:[void 0]},l=[];function c(t){const e={p:"p",...(0,o.R)(),...t.components};return(0,n.jsx)(e.p,{children:"Explanation of Our Solution at MIT iQuHACK"})}function m(t={}){const{wrapper:e}={...(0,o.R)(),...t.components};return e?(0,n.jsx)(e,{...t,children:(0,n.jsx)(c,{...t})}):c(t)}},8453:(t,e,a)=>{a.d(e,{R:()=>r,x:()=>s});var n=a(6540);const o={},i=n.createContext(o);function r(t){const e=n.useContext(i);return n.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function s(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(o):t.components||o:r(t.components),n.createElement(i.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/564be568.05d174fc.js b/assets/js/564be568.05d174fc.js new file mode 100644 index 0000000..27c397a --- /dev/null +++ b/assets/js/564be568.05d174fc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[4224],{2154:s=>{s.exports=JSON.parse('{"permalink":"/blog/tags/advanced","page":1,"postsPerPage":10,"totalPages":1,"totalCount":1,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/5f629cfb.4f61544d.js b/assets/js/5f629cfb.4f61544d.js new file mode 100644 index 0000000..864bb70 --- /dev/null +++ b/assets/js/5f629cfb.4f61544d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[154],{9659:(s,e,a)=>{a.r(e),a.d(e,{assets:()=>c,contentTitle:()=>m,default:()=>d,frontMatter:()=>i,metadata:()=>t,toc:()=>r});var l=a(4848),n=a(8453);const i={slug:"mit-iquhack-solution",title:"Preparing a Gaussian State in the Symmetrical Domain",authors:"eason",tags:["advanced","quantum","state-preparation"]},m=void 0,t={permalink:"/blog/mit-iquhack-solution",source:"@site/blog/2024-2-12-mit-iquhack-2025-experience/index.md",title:"Preparing a Gaussian State in the Symmetrical Domain",description:"Explanation of Our Solution at MIT iQuHACK",date:"2024-02-12T00:00:00.000Z",tags:[{label:"advanced",permalink:"/blog/tags/advanced"},{label:"quantum",permalink:"/blog/tags/quantum"},{label:"state-preparation",permalink:"/blog/tags/state-preparation"}],readingTime:8.395,hasTruncateMarker:!0,authors:[{name:"Eason Xie",title:"Website Owner",url:"https://easonoob.github.io",imageURL:"https://avatars.githubusercontent.com/u/100521878?v=4",key:"eason"}],frontMatter:{slug:"mit-iquhack-solution",title:"Preparing a Gaussian State in the Symmetrical Domain",authors:"eason",tags:["advanced","quantum","state-preparation"]},unlisted:!1,nextItem:{title:"Introduction to Quantum Neural Networks",permalink:"/blog/intro-to-qnn"}},c={authorsImageUrls:[void 0]},r=[{value:"Introduction",id:"introduction",level:2},{value:"Our Solution",id:"our-solution",level:2},{value:"First Step",id:"first-step",level:3},{value:"Second Step",id:"second-step",level:3},{value:"Scalability of Our Solution",id:"scalability-of-our-solution",level:3},{value:"Code of Our Solution",id:"code-of-our-solution",level:3},{value:"Conclusion",id:"conclusion",level:2}];function h(s){const e={annotation:"annotation",code:"code",h2:"h2",h3:"h3",img:"img",math:"math",mfrac:"mfrac",mi:"mi",mn:"mn",mo:"mo",mrow:"mrow",mspace:"mspace",msqrt:"msqrt",msub:"msub",msubsup:"msubsup",msup:"msup",mtext:"mtext",munder:"munder",munderover:"munderover",p:"p",path:"path",pre:"pre",semantics:"semantics",span:"span",svg:"svg",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,n.R)(),...s.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e.p,{children:"Explanation of Our Solution at MIT iQuHACK"}),"\n",(0,l.jsx)(e.h2,{id:"introduction",children:"Introduction"}),"\n",(0,l.jsx)(e.p,{children:"In this blog post, I will explain the solution of our team to the Classiq track at MIT iQuHACK 2025, including why it works and how it scales."}),"\n",(0,l.jsx)(e.p,{children:"Gaussian state preparation is essential for simulating physical systems and tackling problems in quantum chemistry, machine learning, and optimization. Gaussian states, characterized by their Gaussian-shaped wavefunctions, are powerful tools for encoding probability distributions and modeling quantum systems."}),"\n",(0,l.jsx)(e.p,{children:"With the scaling of quantum hardware, achieving efficient and precise Gaussian state preparation could improve the costs of quantum algorithms and enhance impactful applications like option pricing in finance, molecular simulations in quantum chemistry, and data analysis in machine learning, among others."}),"\n",(0,l.jsx)(e.p,{children:"At the competition, our challenge was to prepare a Gaussian state in the symmetrical domain"}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{children:"\u2208"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"["}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mo,{separator:"true",children:","}),(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"x \\in [-2, 2)"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.5782em",verticalAlign:"-0.0391em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u2208"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mopen",children:"["}),(0,l.jsx)(e.span,{className:"mord",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord",children:"2"}),(0,l.jsx)(e.span,{className:"mpunct",children:","}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"2"}),(0,l.jsx)(e.span,{className:"mclose",children:")"})]})]})]})}),"\n",(0,l.jsx)(e.p,{children:"using a quantum circuit. The target state is defined as:"}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mi,{children:"N"})]}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mi,{children:"N"})]}),(0,l.jsx)(e.mo,{children:"\u27f6"}),(0,l.jsxs)(e.munder,{children:[(0,l.jsx)(e.mo,{children:"\u2211"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{children:"\u2208"}),(0,l.jsx)(e.mtext,{children:"domain"})]})]}),(0,l.jsx)(e.msqrt,{children:(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"G"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"})]})}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mi,{children:"N"})]}),(0,l.jsx)(e.mo,{separator:"true",children:","})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"|x_0\\rangle_N = |0\\rangle_N \\longrightarrow \\sum_{x\\in \\text{domain}} \\sqrt{G(x)}\\,|x\\rangle_N,"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u2223"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3011em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"0"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsxs)(e.span,{className:"mclose",children:[(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3283em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u22230"}),(0,l.jsxs)(e.span,{className:"mclose",children:[(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3283em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u27f6"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.3795em",verticalAlign:"-1.3295em"}}),(0,l.jsx)(e.span,{className:"mop op-limits",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.05em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.8479em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"x"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"\u2208"}),(0,l.jsx)(e.span,{className:"mord text mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"domain"})})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{children:(0,l.jsx)(e.span,{className:"mop op-symbol large-op",children:"\u2211"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.3295em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.9839em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3.2em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.2em"}}),(0,l.jsxs)(e.span,{className:"mord",style:{paddingLeft:"1em"},children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"G"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"mclose",children:")"})]})]}),(0,l.jsxs)(e.span,{style:{top:"-2.9439em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.2em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"1.02em",height:"1.28em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.28em",viewBox:"0 0 400000 1296",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M263,681c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl0 -0\nc4.7,-7.3,11,-11,19,-11\nH40000v40H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM1001 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.2561em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u2223"}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsxs)(e.span,{className:"mclose",children:[(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3283em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mpunct",children:","})]})]})]})}),"\n",(0,l.jsx)(e.p,{children:"with"}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"G"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"exp"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mi,{children:"\u03bb"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.munder,{children:[(0,l.jsx)(e.mo,{children:"\u2211"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{mathvariant:"normal",lspace:"0em",rspace:"0em",children:"\u2032"})]}),(0,l.jsx)(e.mo,{children:"\u2208"}),(0,l.jsx)(e.mtext,{children:"domain"})]})]}),(0,l.jsx)(e.mi,{children:"exp"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mi,{children:"\u03bb"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{mathvariant:"normal",lspace:"0em",rspace:"0em",children:"\u2032"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"})]})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"G(x) = \\frac{\\exp(-\\lambda x^2)}{\\sum_{x'\\in \\text{domain}} \\exp(-\\lambda {x'}^2)}."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"G"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"mclose",children:")"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.5901em",verticalAlign:"-1.099em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.4911em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.2281em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsxs)(e.span,{className:"mop",children:[(0,l.jsx)(e.span,{className:"mop op-symbol small-op",style:{position:"relative",top:"0em"},children:"\u2211"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.1864em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.4003em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"x"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.6828em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.786em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2032"})})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"\u2208"}),(0,l.jsx)(e.span,{className:"mord text mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"domain"})})]})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3271em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mop",children:"exp"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"\u03bb"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.6779em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.989em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2032"})})})]})})})})})]})}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8819em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.1308em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mclose",children:")"})]})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mop",children:"exp"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"\u03bb"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mclose",children:")"})]})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.099em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["Here, ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"\u03bb"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\lambda"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"\u03bb"})]})})]})," (represented by ",(0,l.jsx)(e.code,{children:"EXP_RATE"})," in our code) controls the decay of the Gaussian, and the domain discretization is determined by the ",(0,l.jsx)(e.code,{children:"resolution"})," variable. Our task was to design a quantum circuit that not only achieves a small mean squared error (MSE) compared to the ideal Gaussian state but also scales efficiently as the resolution increases."]}),"\n",(0,l.jsxs)(e.p,{children:["There are of course many solutions to this problem. For example, the easiest way is to first prepare a Gaussian state as an amplitude list of length ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"n"})]})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"2^n"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6644em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"2"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.6644em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]})]})})]})," (where ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"n"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"n"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"})]})})]})," is the number of qubits or ",(0,l.jsx)(e.code,{children:"resolution"}),"), then encode this list of amplitudes into the state vector using amplitude encoding. However, this method is costly, requiring ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"script",children:"O"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"n"})]}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\mathcal{O}(2^n)"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord mathcal",style:{marginRight:"0.02778em"},children:"O"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"2"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.6644em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mclose",children:")"})]})})]})," complexity in the worst case scenario. Another method might be using Hamiltonian simulation with trotterization to calculate the exponentila part of the Gaussian, although it results in a true Gaussian, it is also pretty costly. Our solution is not perfect \u2014 it only approximates the Gaussian to an extent, but this approximation is good enough for the MSE error and most importantly, it scales almost linearly to the ",(0,l.jsx)(e.code,{children:"resolution"})," or number of qubits, i.e. ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"script",children:"O"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\mathcal{O}(n)"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord mathcal",style:{marginRight:"0.02778em"},children:"O"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"}),(0,l.jsx)(e.span,{className:"mclose",children:")"})]})})]})," complexity."]}),"\n",(0,l.jsx)(e.h2,{id:"our-solution",children:"Our Solution"}),"\n",(0,l.jsx)(e.p,{children:"Our solution is based on two key steps: first, preparing a state using RY rotations that encodes an exponential factor on each qubit, and second, applying the Quantum Fourier Transform (QFT) to convert that state into one with a Gaussian amplitude distribution."}),"\n",(0,l.jsx)(e.h3,{id:"first-step",children:"First Step"}),"\n",(0,l.jsxs)(e.p,{children:["When we apply an RY gate with angle ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"\u03b8"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\theta"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"})]})})]})," to a qubit initially in ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"|0\\rangle"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u22230"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"})]})})]}),", we obtain"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mtext,{children:"RY"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mi,{children:"cos"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsx)(e.mi,{children:"sin"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\text{RY}(\\theta)|0\\rangle = \\cos\\Bigl(\\frac{\\theta}{2}\\Bigr)|0\\rangle + \\sin\\Bigl(\\frac{\\theta}{2}\\Bigr)|1\\rangle."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord text",children:(0,l.jsx)(e.span,{className:"mord",children:"RY"})}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"mclose",children:")"}),(0,l.jsx)(e.span,{className:"mord",children:"\u22230"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.0574em",verticalAlign:"-0.686em"}}),(0,l.jsx)(e.span,{className:"mop",children:"cos"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mord",children:"\u22230"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.0574em",verticalAlign:"-0.686em"}}),(0,l.jsx)(e.span,{className:"mop",children:"sin"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mord",children:"\u22231"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["In our code, for each qubit indexed by ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"i"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"i"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6595em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"i"})]})})]})," we set"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsx)(e.mi,{children:"arctan"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mo,{separator:"true",children:","})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\theta_i = 2\\,\\arctan\\Bigl(e^{-\\frac{i^2}{2\\sigma^2}}\\Bigr),"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8444em",verticalAlign:"-0.15em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0278em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.8965em",verticalAlign:"-0.65em"}}),(0,l.jsx)(e.span,{className:"mord",children:"2"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mop",children:"arctan"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mpunct",children:","})]})]})]})}),"\n",(0,l.jsx)(e.p,{children:"with"}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mtext,{children:"EXP_RATE"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsx)(e.mn,{children:"5"})})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\sigma = \\frac{\\text{EXP\\_RATE}}{\\sqrt{5}}."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.3133em",verticalAlign:"-0.93em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3833em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.2028em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.9072em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",style:{paddingLeft:"0.833em"},children:(0,l.jsx)(e.span,{className:"mord",children:"5"})})]}),(0,l.jsxs)(e.span,{style:{top:"-2.8672em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"0.853em",height:"1.08em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.08em",viewBox:"0 0 400000 1080",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M95,702\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl0 -0\nc5.3,-9.3,12,-14,20,-14\nH400000v40H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM834 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.1328em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.7em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord text",children:(0,l.jsx)(e.span,{className:"mord",children:"EXP_RATE"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.93em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["Thus, for the ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"i"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"i"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6595em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"i"})]})})]}),"th qubit,"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mi,{children:"arctan"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\frac{\\theta_i}{2} = \\arctan\\Bigl(e^{-\\frac{i^2}{2\\sigma^2}}\\Bigr)."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.0574em",verticalAlign:"-0.686em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0278em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.8965em",verticalAlign:"-0.65em"}}),(0,l.jsx)(e.span,{className:"mop",children:"arctan"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["Using the trigonometric identities ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"cos"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"arctan"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mn,{children:"2"})]})]})})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\cos(\\arctan(x)) = \\frac{1}{\\sqrt{1+x^2}}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mop",children:"cos"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mop",children:"arctan"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"mclose",children:"))"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.3831em",verticalAlign:"-0.538em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.8451em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5445em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord sqrt mtight",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.9221em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsxs)(e.span,{className:"mord mtight",style:{paddingLeft:"0.833em"},children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"1"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"+"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"x"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.7463em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.786em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]})]})]}),(0,l.jsxs)(e.span,{style:{top:"-2.8821em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"hide-tail mtight",style:{minWidth:"0.853em",height:"1.08em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.08em",viewBox:"0 0 400000 1080",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M95,702\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl0 -0\nc5.3,-9.3,12,-14,20,-14\nH400000v40H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM834 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.1179em"},children:(0,l.jsx)(e.span,{})})})]})})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.394em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.538em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]})]})]})]})," and ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"sin"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"arctan"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mn,{children:"2"})]})]})})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\sin(\\arctan(x)) = \\frac{x}{\\sqrt{1+x^2}}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mop",children:"sin"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mop",children:"arctan"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"mclose",children:"))"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2334em",verticalAlign:"-0.538em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.6954em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5445em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord sqrt mtight",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.9221em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsxs)(e.span,{className:"mord mtight",style:{paddingLeft:"0.833em"},children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"1"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"+"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"x"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.7463em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.786em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]})]})]}),(0,l.jsxs)(e.span,{style:{top:"-2.8821em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"hide-tail mtight",style:{minWidth:"0.853em",height:"1.08em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.08em",viewBox:"0 0 400000 1080",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M95,702\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl0 -0\nc5.3,-9.3,12,-14,20,-14\nH400000v40H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM834 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.1179em"},children:(0,l.jsx)(e.span,{})})})]})})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.394em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"x"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.538em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]})]})]})]}),", with ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"x = e^{-\\frac{i^2}{2\\sigma^2}}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2464em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})]})]})]}),", we find"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"cos"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]})})]}),(0,l.jsx)(e.mo,{separator:"true",children:","}),(0,l.jsx)(e.mspace,{width:"1em"}),(0,l.jsx)(e.mi,{children:"sin"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]}),(0,l.jsx)(e.msqrt,{children:(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]})})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\cos\\Bigl(\\frac{\\theta_i}{2}\\Bigr) = \\frac{1}{\\sqrt{1+e^{-\\frac{i^2}{\\sigma^2}}}}, \\quad \\sin\\Bigl(\\frac{\\theta_i}{2}\\Bigr) = \\frac{e^{-\\frac{i^2}{2\\sigma^2}}}{\\sqrt{1+e^{-\\frac{i^2}{\\sigma^2}}}}."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.0574em",verticalAlign:"-0.686em"}}),(0,l.jsx)(e.span,{className:"mop",children:"cos"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0278em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.1014em",verticalAlign:"-1.73em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.11em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.5391em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3.8em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsxs)(e.span,{className:"mord",style:{paddingLeft:"1em"},children:[(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.1914em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.0543em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})]})]}),(0,l.jsxs)(e.span,{style:{top:"-3.4991em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"1.02em",height:"1.88em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.88em",viewBox:"0 0 400000 1944",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M983 90\nl0 -0\nc4,-6.7,10,-10,18,-10 H400000v40\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM1001 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3009em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.7691em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-4.2161em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"1"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.73em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mpunct",children:","}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"1em"}}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mop",children:"sin"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0278em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.6534em",verticalAlign:"-1.73em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.9234em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.11em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.5391em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3.8em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsxs)(e.span,{className:"mord",style:{paddingLeft:"1em"},children:[(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.1914em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.0543em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})]})]}),(0,l.jsxs)(e.span,{style:{top:"-3.4991em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"1.02em",height:"1.88em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.88em",viewBox:"0 0 400000 1944",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M983 90\nl0 -0\nc4,-6.7,10,-10,18,-10 H400000v40\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM1001 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3009em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.7691em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-4.2161em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.73em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["For large ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"i"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"i"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6595em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"i"})]})})]}),", ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"e^{-\\frac{i^2}{2\\sigma^2}}"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2464em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})]})})]})," is very small, so the amplitude in ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"|1\\rangle"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u22231"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"})]})})]})," is approximately"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"sin"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mo,{children:"\u2248"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\sin\\Bigl(\\frac{\\theta_i}{2}\\Bigr) \\approx e^{-\\frac{i^2}{2\\sigma^2}}."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.0574em",verticalAlign:"-0.686em"}}),(0,l.jsx)(e.span,{className:"mop",children:"sin"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0278em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u2248"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2464em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["By applying these rotations to each of the ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"n"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"n"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"})]})})]})," qubits, the overall state becomes the tensor product"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mi,{children:"\u03c8"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.munderover,{children:[(0,l.jsx)(e.mo,{children:"\u2a02"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"1"})]})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{fence:"true",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]})})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]}),(0,l.jsx)(e.msqrt,{children:(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]})})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mo,{fence:"true",children:")"})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"|\\psi\\rangle = \\bigotimes_{i=0}^{n-1}\\left(\\frac{1}{\\sqrt{1+e^{-\\frac{i^2}{\\sigma^2}}}}|0\\rangle_i + \\frac{e^{-\\frac{i^2}{2\\sigma^2}}}{\\sqrt{1+e^{-\\frac{i^2}{\\sigma^2}}}}|1\\rangle_i\\right)."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u2223"}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c8"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.78em",verticalAlign:"-1.73em"}}),(0,l.jsx)(e.span,{className:"mop op-limits",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.8011em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.8723em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"="}),(0,l.jsx)(e.span,{className:"mord mtight",children:"0"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{children:(0,l.jsx)(e.span,{className:"mop op-symbol large-op",children:"\u2a02"})})]}),(0,l.jsxs)(e.span,{style:{top:"-4.3em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"n"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2777em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"minner",children:[(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing mult",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"2.05em"},children:(0,l.jsxs)(e.span,{style:{top:"-4.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"5.6em"}}),(0,l.jsx)(e.span,{style:{width:"0.875em",height:"3.600em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"0.875em",height:"3.600em",viewBox:"0 0 875 3600",children:(0,l.jsx)(e.path,{d:"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,84c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-92c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z"})})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.55em"},children:(0,l.jsx)(e.span,{})})})]})})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.11em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.5391em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3.8em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsxs)(e.span,{className:"mord",style:{paddingLeft:"1em"},children:[(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.1914em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.0543em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})]})]}),(0,l.jsxs)(e.span,{style:{top:"-3.4991em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"1.02em",height:"1.88em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.88em",viewBox:"0 0 400000 1944",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M983 90\nl0 -0\nc4,-6.7,10,-10,18,-10 H400000v40\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM1001 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3009em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.7691em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-4.2161em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"1"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.73em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mord",children:"\u22230"}),(0,l.jsxs)(e.span,{className:"mclose",children:[(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.9234em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.11em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.5391em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3.8em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsxs)(e.span,{className:"mord",style:{paddingLeft:"1em"},children:[(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.1914em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.0543em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})]})]}),(0,l.jsxs)(e.span,{style:{top:"-3.4991em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"1.02em",height:"1.88em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.88em",viewBox:"0 0 400000 1944",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M983 90\nl0 -0\nc4,-6.7,10,-10,18,-10 H400000v40\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM1001 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3009em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.7691em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-4.2161em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.73em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mord",children:"\u22231"}),(0,l.jsxs)(e.span,{className:"mclose",children:[(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing mult",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"2.05em"},children:(0,l.jsxs)(e.span,{style:{top:"-4.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"5.6em"}}),(0,l.jsx)(e.span,{style:{width:"0.875em",height:"3.600em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"0.875em",height:"3.600em",viewBox:"0 0 875 3600",children:(0,l.jsx)(e.path,{d:"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,9\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-144c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z"})})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.55em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["When this state is expressed in the computational basis, a basis state ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"|j\\rangle"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u2223"}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"})]})})]})," (with ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"j"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"j"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.854em",verticalAlign:"-0.1944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"})]})})]})," written in binary as ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.msubsup,{children:[(0,l.jsx)(e.mo,{children:"\u2211"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"1"})]})]}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"i"})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"j=\\sum_{i=0}^{n-1}j_i2^i"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.854em",verticalAlign:"-0.1944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2537em",verticalAlign:"-0.2997em"}}),(0,l.jsxs)(e.span,{className:"mop",children:[(0,l.jsx)(e.span,{className:"mop op-symbol small-op",style:{position:"relative",top:"0em"},children:"\u2211"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.954em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.4003em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"="}),(0,l.jsx)(e.span,{className:"mord mtight",children:"0"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2029em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"n"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.2997em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0572em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"2"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8247em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})})})})})]})]})]})]})," where each ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mo,{children:"\u2208"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"{"}),(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsx)(e.mo,{separator:"true",children:","}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"}"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"j_i\\in\\{0,1\\}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.854em",verticalAlign:"-0.1944em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0572em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u2208"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mopen",children:"{"}),(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"mpunct",children:","}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mclose",children:"}"})]})]})]}),") has amplitude"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"a"}),(0,l.jsx)(e.mi,{children:"j"})]}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.munderover,{children:[(0,l.jsx)(e.mo,{children:"\u220f"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"1"})]})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{fence:"true",children:"["}),(0,l.jsx)(e.mi,{children:"cos"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mo,{fence:"true",children:"]"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mi,{children:"i"})]})]})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{fence:"true",children:"["}),(0,l.jsx)(e.mi,{children:"sin"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mo,{fence:"true",children:"]"})]}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mi,{children:"i"})]})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"a_j = \\prod_{i=0}^{n-1}\\left[\\cos\\Bigl(\\frac{\\theta_i}{2}\\Bigr)\\right]^{1-j_i}\\left[\\sin\\Bigl(\\frac{\\theta_i}{2}\\Bigr)\\right]^{j_i}."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7167em",verticalAlign:"-0.2861em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"a"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.05724em"},children:"j"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.2861em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.0788em",verticalAlign:"-1.2777em"}}),(0,l.jsx)(e.span,{className:"mop op-limits",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.8011em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.8723em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"="}),(0,l.jsx)(e.span,{className:"mord mtight",children:"0"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{children:(0,l.jsx)(e.span,{className:"mop op-symbol large-op",children:"\u220f"})})]}),(0,l.jsxs)(e.span,{style:{top:"-4.3em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"n"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2777em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"minner",children:[(0,l.jsxs)(e.span,{className:"minner",children:[(0,l.jsx)(e.span,{className:"mopen delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size3",children:"["})}),(0,l.jsx)(e.span,{className:"mop",children:"cos"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0278em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mclose delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size3",children:"]"})})]}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.6646em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.9029em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"1"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3281em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.357em",marginLeft:"-0.0572em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.143em"},children:(0,l.jsx)(e.span,{})})})]})})]})]})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"minner",children:[(0,l.jsxs)(e.span,{className:"minner",children:[(0,l.jsx)(e.span,{className:"mopen delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size3",children:"["})}),(0,l.jsx)(e.span,{className:"mop",children:"sin"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0278em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mclose delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size3",children:"]"})})]}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.6646em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.9029em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3281em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.357em",marginLeft:"-0.0572em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.143em"},children:(0,l.jsx)(e.span,{})})})]})})]})})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["Because ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"sin"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mo,{children:"\u2248"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\sin(\\frac{\\theta_i}{2})\\approx e^{-\\frac{i^2}{2\\sigma^2}}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2412em",verticalAlign:"-0.345em"}}),(0,l.jsx)(e.span,{className:"mop",children:"sin"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.8962em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.655em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.4101em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3281em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.357em",marginLeft:"-0.0278em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.143em"},children:(0,l.jsx)(e.span,{})})})]})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.345em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:")"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u2248"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2464em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})]})]})]}),", the amplitude ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"a"}),(0,l.jsx)(e.mi,{children:"j"})]})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"a_j"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7167em",verticalAlign:"-0.2861em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"a"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.05724em"},children:"j"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.2861em"},children:(0,l.jsx)(e.span,{})})})]})})]})]})})]})," is a product of factors that decay exponentially with ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"i"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"i"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6595em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"i"})]})})]}),". This product structure means that the probability distribution over ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"j"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"j"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.854em",verticalAlign:"-0.1944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"})]})})]})," appears as a steep exponential drop in the contributions of higher-index qubits rather than as a smooth Gaussian curve. This is shown in the figure below (only the first few amplitudes are shown):"]}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"initial_state",src:a(5145).A+"",width:"572",height:"338"})}),"\n",(0,l.jsx)(e.h3,{id:"second-step",children:"Second Step"}),"\n",(0,l.jsx)(e.p,{children:"The next step is to apply the QFT, which acts on computational basis states as"}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mtext,{children:"QFT"}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsx)(e.mi,{children:"N"})})]}),(0,l.jsxs)(e.munderover,{children:[(0,l.jsx)(e.mo,{children:"\u2211"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"N"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"1"})]})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"\u03c0"}),(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"/"}),(0,l.jsx)(e.mi,{children:"N"})]})]}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mo,{separator:"true",children:","})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\text{QFT}\\,|j\\rangle = \\frac{1}{\\sqrt{N}}\\sum_{k=0}^{N-1} e^{2\\pi i\\,jk/N}\\,|k\\rangle,"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord text",children:(0,l.jsx)(e.span,{className:"mord",children:"QFT"})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u2223"}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.1304em",verticalAlign:"-1.3021em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.1833em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.9267em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",style:{paddingLeft:"0.833em"},children:(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10903em"},children:"N"})})]}),(0,l.jsxs)(e.span,{style:{top:"-2.8867em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"0.853em",height:"1.08em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.08em",viewBox:"0 0 400000 1080",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M95,702\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl0 -0\nc5.3,-9.3,12,-14,20,-14\nH400000v40H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM834 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.1133em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"1"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.93em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mop op-limits",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.8283em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.8479em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"="}),(0,l.jsx)(e.span,{className:"mord mtight",children:"0"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{children:(0,l.jsx)(e.span,{className:"mop op-symbol large-op",children:"\u2211"})})]}),(0,l.jsxs)(e.span,{style:{top:"-4.3em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.3021em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.938em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.113em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"\u03c0i"}),(0,l.jsx)(e.span,{className:"mspace mtight",style:{marginRight:"0.1952em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"jk"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"/"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"})]})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u2223"}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.03148em"},children:"k"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"mpunct",children:","})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["with ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"N"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"n"})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"N=2^n"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10903em"},children:"N"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6644em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"2"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.6644em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"n"})})]})})})})})]})]})]})]}),". After applying the QFT, the final state becomes"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mtext,{children:"QFT"}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mi,{children:"\u03c8"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.munderover,{children:[(0,l.jsx)(e.mo,{children:"\u2211"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"N"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"1"})]})]}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"b"}),(0,l.jsx)(e.mi,{children:"k"})]}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"}),(0,l.jsx)(e.mo,{separator:"true",children:","})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\text{QFT}\\,|\\psi\\rangle = \\sum_{k=0}^{N-1} b_k\\,|k\\rangle,"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord text",children:(0,l.jsx)(e.span,{className:"mord",children:"QFT"})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u2223"}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c8"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.1304em",verticalAlign:"-1.3021em"}}),(0,l.jsx)(e.span,{className:"mop op-limits",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.8283em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.8479em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"="}),(0,l.jsx)(e.span,{className:"mord mtight",children:"0"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{children:(0,l.jsx)(e.span,{className:"mop op-symbol large-op",children:"\u2211"})})]}),(0,l.jsxs)(e.span,{style:{top:"-4.3em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.3021em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"b"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3361em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u2223"}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.03148em"},children:"k"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"}),(0,l.jsx)(e.span,{className:"mpunct",children:","})]})]})]})}),"\n",(0,l.jsx)(e.p,{children:"where"}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"b"}),(0,l.jsx)(e.mi,{children:"k"})]}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsx)(e.mi,{children:"N"})})]}),(0,l.jsxs)(e.munderover,{children:[(0,l.jsx)(e.mo,{children:"\u2211"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"N"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"1"})]})]}),(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"a"}),(0,l.jsx)(e.mi,{children:"j"})]}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"\u03c0"}),(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"/"}),(0,l.jsx)(e.mi,{children:"N"})]})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"b_k = \\frac{1}{\\sqrt{N}}\\sum_{j=0}^{N-1} a_j\\,e^{2\\pi i\\,jk/N}."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8444em",verticalAlign:"-0.15em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"b"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3361em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.2421em",verticalAlign:"-1.4138em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.1833em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.9267em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",style:{paddingLeft:"0.833em"},children:(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10903em"},children:"N"})})]}),(0,l.jsxs)(e.span,{style:{top:"-2.8867em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"0.853em",height:"1.08em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.08em",viewBox:"0 0 400000 1080",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M95,702\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl0 -0\nc5.3,-9.3,12,-14,20,-14\nH400000v40H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM834 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.1133em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"1"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.93em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mop op-limits",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.8283em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.8723em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"="}),(0,l.jsx)(e.span,{className:"mord mtight",children:"0"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{children:(0,l.jsx)(e.span,{className:"mop op-symbol large-op",children:"\u2211"})})]}),(0,l.jsxs)(e.span,{style:{top:"-4.3em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.4138em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"a"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.05724em"},children:"j"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.2861em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.938em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.113em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"\u03c0i"}),(0,l.jsx)(e.span,{className:"mspace mtight",style:{marginRight:"0.1952em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"jk"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"/"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"})]})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["We can express the sum over ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"j"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"j"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.854em",verticalAlign:"-0.1944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"})]})})]})," in terms of the binary digits ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mi,{children:"i"})]})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"j_i"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.854em",verticalAlign:"-0.1944em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0572em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})]})})]}),". Since ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"a"}),(0,l.jsx)(e.mi,{children:"j"})]})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"a_j"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7167em",verticalAlign:"-0.2861em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"a"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.05724em"},children:"j"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.2861em"},children:(0,l.jsx)(e.span,{})})})]})})]})]})})]})," is a product over qubit contributions, the sum factorizes, and we have"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"b"}),(0,l.jsx)(e.mi,{children:"k"})]}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsx)(e.mi,{children:"N"})})]}),(0,l.jsxs)(e.munderover,{children:[(0,l.jsx)(e.mo,{children:"\u220f"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"1"})]})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{fence:"true",children:"["}),(0,l.jsx)(e.mi,{children:"cos"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"\u03c0"}),(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mi,{children:"k"})]}),(0,l.jsx)(e.mi,{children:"N"})]})]}),(0,l.jsx)(e.mi,{children:"sin"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.8em",maxsize:"1.8em",children:")"}),(0,l.jsx)(e.mo,{fence:"true",children:"]"})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"b_k = \\frac{1}{\\sqrt{N}}\\prod_{i=0}^{n-1}\\left[\\cos\\Bigl(\\frac{\\theta_i}{2}\\Bigr) + e^{\\frac{2\\pi i\\,2^ik}{N}}\\sin\\Bigl(\\frac{\\theta_i}{2}\\Bigr)\\right]."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8444em",verticalAlign:"-0.15em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"b"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3361em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.0788em",verticalAlign:"-1.2777em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.1833em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.9267em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",style:{paddingLeft:"0.833em"},children:(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10903em"},children:"N"})})]}),(0,l.jsxs)(e.span,{style:{top:"-2.8867em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"0.853em",height:"1.08em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.08em",viewBox:"0 0 400000 1080",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M95,702\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl0 -0\nc5.3,-9.3,12,-14,20,-14\nH400000v40H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM834 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.1133em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"1"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.93em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mop op-limits",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.8011em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.8723em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"="}),(0,l.jsx)(e.span,{className:"mord mtight",children:"0"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{children:(0,l.jsx)(e.span,{className:"mop op-symbol large-op",children:"\u220f"})})]}),(0,l.jsxs)(e.span,{style:{top:"-4.3em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"n"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2777em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"minner",children:[(0,l.jsx)(e.span,{className:"mopen delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size3",children:"["})}),(0,l.jsx)(e.span,{className:"mop",children:"cos"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0278em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2136em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.413em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1437em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.656em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"\u03c0i"}),(0,l.jsx)(e.span,{className:"mspace mtight",style:{marginRight:"0.2453em"}}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0635em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0635em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6595em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})]})})})})})]}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.344em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mop",children:"sin"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3714em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3117em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"-0.0278em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:")"})}),(0,l.jsx)(e.span,{className:"mclose delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size3",children:"]"})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["Substituting the approximate forms for ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"cos"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\cos(\\frac{\\theta_i}{2})"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2412em",verticalAlign:"-0.345em"}}),(0,l.jsx)(e.span,{className:"mop",children:"cos"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.8962em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.655em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.4101em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3281em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.357em",marginLeft:"-0.0278em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.143em"},children:(0,l.jsx)(e.span,{})})})]})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.345em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:")"})]})})]})," and ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"sin"}),(0,l.jsx)(e.mo,{children:"\u2061"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\sin(\\frac{\\theta_i}{2})"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2412em",verticalAlign:"-0.345em"}}),(0,l.jsx)(e.span,{className:"mop",children:"sin"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.8962em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.655em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.4101em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3281em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.357em",marginLeft:"-0.0278em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.143em"},children:(0,l.jsx)(e.span,{})})})]})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.345em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose",children:")"})]})})]}),", this becomes"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"b"}),(0,l.jsx)(e.mi,{children:"k"})]}),(0,l.jsx)(e.mo,{children:"\u2248"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsx)(e.mi,{children:"N"})})]}),(0,l.jsxs)(e.munderover,{children:[(0,l.jsx)(e.mo,{children:"\u220f"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"1"})]})]}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.msqrt,{children:(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]})})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{fence:"true",children:"["}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"\u03c0"}),(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"i"})]}),(0,l.jsx)(e.mi,{children:"k"})]}),(0,l.jsx)(e.mi,{children:"N"})]})]}),(0,l.jsx)(e.mo,{fence:"true",children:"]"})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"b_k \\approx \\frac{1}{\\sqrt{N}}\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{1+e^{-\\frac{i^2}{\\sigma^2}}}}\\left[1 + e^{-\\frac{i^2}{2\\sigma^2}}e^{\\frac{2\\pi i\\,2^ik}{N}}\\right]."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8444em",verticalAlign:"-0.15em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"b"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3361em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u2248"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.5311em",verticalAlign:"-1.73em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.1833em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"0.9267em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",style:{paddingLeft:"0.833em"},children:(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10903em"},children:"N"})})]}),(0,l.jsxs)(e.span,{style:{top:"-2.8867em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"0.853em",height:"1.08em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.08em",viewBox:"0 0 400000 1080",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M95,702\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl0 -0\nc5.3,-9.3,12,-14,20,-14\nH400000v40H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM834 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.1133em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"1"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.93em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mop op-limits",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.8011em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.8723em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"="}),(0,l.jsx)(e.span,{className:"mord mtight",children:"0"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{children:(0,l.jsx)(e.span,{className:"mop op-symbol large-op",children:"\u220f"})})]}),(0,l.jsxs)(e.span,{style:{top:"-4.3em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"n"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2777em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.11em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord sqrt",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.5391em"},children:[(0,l.jsxs)(e.span,{className:"svg-align",style:{top:"-3.8em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsxs)(e.span,{className:"mord",style:{paddingLeft:"1em"},children:[(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.1914em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.0543em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]})]})]}),(0,l.jsxs)(e.span,{style:{top:"-3.4991em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.8em"}}),(0,l.jsx)(e.span,{className:"hide-tail",style:{minWidth:"1.02em",height:"1.88em"},children:(0,l.jsx)(e.svg,{xmlns:"http://www.w3.org/2000/svg",width:"400em",height:"1.88em",viewBox:"0 0 400000 1944",preserveAspectRatio:"xMinYMin slice",children:(0,l.jsx)(e.path,{d:"M983 90\nl0 -0\nc4,-6.7,10,-10,18,-10 H400000v40\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM1001 80h400000v40h-400000z"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3009em"},children:(0,l.jsx)(e.span,{})})})]})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.7691em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-4.2161em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.5391em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"1"})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.73em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"minner",children:[(0,l.jsx)(e.span,{className:"mopen delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"["})}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2136em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.413em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1437em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.656em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"})})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"\u03c0i"}),(0,l.jsx)(e.span,{className:"mspace mtight",style:{marginRight:"0.2453em"}}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0635em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0635em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6595em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"i"})]})})})})})]}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"})]})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.344em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mclose delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size2",children:"]"})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["In the large-",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"N"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"N"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6833em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.10903em"},children:"N"})]})})]})," limit and with appropriate scaling of ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"\u03c3"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\sigma"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c3"})]})})]}),", the sum over ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"j"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"j"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.854em",verticalAlign:"-0.1944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"})]})})]})," approximates the discrete Fourier transform of a Gaussian function. It is a well-known fact that the Fourier transform of a Gaussian is another Gaussian:"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msubsup,{children:[(0,l.jsx)(e.mo,{children:"\u222b"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u221e"})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u221e"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]})]})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"\u03c0"}),(0,l.jsx)(e.mi,{children:"i"}),(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"/"}),(0,l.jsx)(e.mi,{children:"N"})]})]}),(0,l.jsx)(e.mtext,{children:"\u2009"}),(0,l.jsx)(e.mi,{children:"d"}),(0,l.jsx)(e.mi,{children:"x"}),(0,l.jsx)(e.mo,{children:"\u221d"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c0"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"\u03c3"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"/"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"N"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]}),(0,l.jsx)(e.mo,{separator:"true",children:","})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\int_{-\\infty}^{\\infty} e^{-\\frac{x^2}{2\\sigma^2}} e^{2\\pi i x k/N}\\,dx \\propto e^{-2\\pi^2 \\sigma^2 k^2/N^2},"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.3846em",verticalAlign:"-0.9703em"}}),(0,l.jsxs)(e.span,{className:"mop",children:[(0,l.jsx)(e.span,{className:"mop op-symbol large-op",style:{marginRight:"0.44445em",position:"relative",top:"-0.0011em"},children:"\u222b"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.4143em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.7881em",marginLeft:"-0.4445em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"\u221e"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.8129em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"\u221e"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9703em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.2464em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.4534em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter sizing reset-size3 size6"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.1329em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.5062em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.9384em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.9384em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.2255em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.384em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"x"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0484em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.0484em",marginRight:"0.1em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.6444em"}}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})})})})]})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.4938em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter sizing reset-size3 size6"})]})]})})]})})})})})]}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.938em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.113em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"\u03c0i"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"x"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"/"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"})]})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"d"}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"x"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u221d"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2314em",verticalAlign:"-0.1944em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0369em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.113em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8913em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.931em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03588em"},children:"\u03c3"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8913em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.931em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8913em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.931em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mord mtight",children:"/"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.10903em"},children:"N"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8913em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.931em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]})]})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mpunct",children:","})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["which implies that the amplitudes ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"b"}),(0,l.jsx)(e.mi,{children:"k"})]})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"b_k"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8444em",verticalAlign:"-0.15em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"b"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3361em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]})]})})]})," in the Fourier basis take the form"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msub,{children:[(0,l.jsx)(e.mi,{children:"b"}),(0,l.jsx)(e.mi,{children:"k"})]}),(0,l.jsx)(e.mo,{children:"\u223c"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"e"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mi,{children:"\u03b1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]}),(0,l.jsx)(e.mo,{separator:"true",children:","})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"b_k \\sim e^{-\\alpha k^2},"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8444em",verticalAlign:"-0.15em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"b"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.3361em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.55em",marginLeft:"0em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"})})]})}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.15em"},children:(0,l.jsx)(e.span,{})})})]})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u223c"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2314em",verticalAlign:"-0.1944em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"e"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.0369em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.113em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.0037em"},children:"\u03b1"}),(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8913em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.931em",marginRight:"0.0714em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.5em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size3 size1 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]})]})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mpunct",children:","})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["up to normalization and a rescaling of parameters, where ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"\u03b1"}),(0,l.jsx)(e.mo,{children:">"}),(0,l.jsx)(e.mn,{children:"0"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\alpha>0"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.5782em",verticalAlign:"-0.0391em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.0037em"},children:"\u03b1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:">"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6444em"}}),(0,l.jsx)(e.span,{className:"mord",children:"0"})]})]})]}),". Thus, although the original state ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"normal",children:"\u2223"}),(0,l.jsx)(e.mi,{children:"\u03c8"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"\u27e9"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"|\\psi\\rangle"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord",children:"\u2223"}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c8"}),(0,l.jsx)(e.span,{className:"mclose",children:"\u27e9"})]})})]})," in the computational basis exhibits an exponential decay coming from the product of bitwise factors, the QFT maps these amplitudes into a smooth Gaussian distribution in the Fourier basis. This transformation from a steep, exponential drop to a Gaussian envelope is a direct consequence of the Fourier transform properties of the Gaussian function. Showing this transformation visually, the amplitudes after QFT are:"]}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"amplitudes_after_qft",src:a(727).A+"",width:"604",height:"355"})}),"\n",(0,l.jsx)(e.p,{children:'Note that the Gaussian is "inverted". To turn it back to a normal Gaussian, we can apply the X gate on the 0th qubit. The final result is:'}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"final_state",src:a(6468).A+"",width:"604",height:"355"})}),"\n",(0,l.jsxs)(e.p,{children:["Using the method described above, we can reach a MSE error of ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2.230"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"8"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"2.230\\times10^{-8}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"2.230"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"8"})]})})]})})})})})]})]})]})]}),"."]}),"\n",(0,l.jsx)(e.p,{children:"The overall circuit is:"}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"overall_circuit",src:a(3942).A+"",width:"4920",height:"556"})}),"\n",(0,l.jsx)(e.h3,{id:"scalability-of-our-solution",children:"Scalability of Our Solution"}),"\n",(0,l.jsx)(e.p,{children:"The Phase 2 of the challenge is to maximize the scalability of our solution, i.e. make our solution works at the highest resolution with the least number of gates possible. The bottleneck of our solution described above was the QFT part, the number of gates in a regular QFT grows quadratically as the number of qubits increases:"}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"script",children:"O"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{fence:"true",children:"("}),(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsx)(e.mi,{children:"n"})]}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{fence:"true",children:")"})]}),(0,l.jsx)(e.mo,{children:"\u2248"}),(0,l.jsx)(e.mi,{mathvariant:"script",children:"O"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mn,{children:"2"})]}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\mathcal{O}\\left(\\frac{n^2+n}{2}\\right) \\approx \\mathcal{O}(n^2)."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.4411em",verticalAlign:"-0.95em"}}),(0,l.jsx)(e.span,{className:"mord mathcal",style:{marginRight:"0.02778em"},children:"O"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsxs)(e.span,{className:"minner",children:[(0,l.jsx)(e.span,{className:"mopen delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size3",children:"("})}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.4911em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsx)(e.span,{className:"mord",children:"2"})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"})]})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mclose delimcenter",style:{top:"0em"},children:(0,l.jsx)(e.span,{className:"delimsizing size3",children:")"})})]}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u2248"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.1141em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord mathcal",style:{marginRight:"0.02778em"},children:"O"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8641em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.113em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})})]})})})})})]}),(0,l.jsx)(e.span,{className:"mclose",children:")"}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["We observed that the gate angles of the CPhase gates used in QFT decreases exponentially! The gate angle for the CPhase gate with layer number ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"j"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"j"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.854em",verticalAlign:"-0.1944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"})]})})]})," and qubit number ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"k"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"k"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.03148em"},children:"k"})]})})]})," is"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsxs)(e.mfrac,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsx)(e.mi,{children:"\u03c0"})]}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"2"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"k"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsx)(e.mn,{children:"1"})]})]})]}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\frac{2\\pi}{2^{k-j+1}}."})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"2.0074em",verticalAlign:"-0.686em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mopen nulldelimiter"}),(0,l.jsx)(e.span,{className:"mfrac",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.3214em"},children:[(0,l.jsxs)(e.span,{style:{top:"-2.314em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"mord",children:(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"2"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.7751em"},children:(0,l.jsxs)(e.span,{style:{top:"-2.989em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.03148em"},children:"k"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"mbin mtight",children:"+"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})})})})})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.23em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsx)(e.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,l.jsxs)(e.span,{style:{top:"-3.677em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3em"}}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"2"}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.03588em"},children:"\u03c0"})]})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.686em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mclose nulldelimiter"})]}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})})]})}),"\n",(0,l.jsxs)(e.p,{children:["When there are many qubits, the majority of the gate angles often become very small (e.g. less than ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"3"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"1\\times10^{-3}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"3"})]})})]})})})})})]})]})]})]}),"), which have negligible effects on the overall state vector. Therefore, we pruned any gates with angle smaller than a threshold ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"\u03b8"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\theta"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"})]})})]})," as shown in the diagram below:"]}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"gate_prune",src:a(7260).A+"",width:"2702",height:"1012"})}),"\n",(0,l.jsxs)(e.p,{children:["Now the number of gates in the approximated QFT with qubit number ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"n"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"n"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"})]})})]})," and ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\theta=1\\times10^{-2}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})]})})})})})]})]})]})]})," is"]}),"\n",(0,l.jsx)(e.span,{className:"katex-display",children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"script",children:"O"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.2em",maxsize:"1.2em",children:"("}),(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{children:"+"}),(0,l.jsxs)(e.munderover,{children:[(0,l.jsx)(e.mo,{children:"\u2211"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"1"})]}),(0,l.jsx)(e.mi,{children:"n"})]}),(0,l.jsx)(e.mtext,{children:"min"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mn,{children:"8"}),(0,l.jsx)(e.mo,{separator:"true",children:","}),(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mi,{children:"j"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mo,{fence:"true",stretchy:"true",minsize:"1.2em",maxsize:"1.2em",children:")"}),(0,l.jsx)(e.mo,{children:"\u2248"}),(0,l.jsx)(e.mi,{mathvariant:"script",children:"O"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"}),(0,l.jsx)(e.mi,{mathvariant:"normal",children:"."})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\mathcal{O}\\bigl(n+\\sum_{j=1}^{n}\\text{min}(8,n-j)\\bigr) \\approx \\mathcal{O}(n)."})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2em",verticalAlign:"-0.35em"}}),(0,l.jsx)(e.span,{className:"mord mathcal",style:{marginRight:"0.02778em"},children:"O"}),(0,l.jsx)(e.span,{className:"mopen",children:(0,l.jsx)(e.span,{className:"delimsizing size1",children:"("})}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"+"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"3.0652em",verticalAlign:"-1.4138em"}}),(0,l.jsx)(e.span,{className:"mop op-limits",children:(0,l.jsxs)(e.span,{className:"vlist-t vlist-t2",children:[(0,l.jsxs)(e.span,{className:"vlist-r",children:[(0,l.jsxs)(e.span,{className:"vlist",style:{height:"1.6514em"},children:[(0,l.jsxs)(e.span,{style:{top:"-1.8723em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mathnormal mtight",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"mrel mtight",children:"="}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]}),(0,l.jsxs)(e.span,{style:{top:"-3.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{children:(0,l.jsx)(e.span,{className:"mop op-symbol large-op",children:"\u2211"})})]}),(0,l.jsxs)(e.span,{style:{top:"-4.3em",marginLeft:"0em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"3.05em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsx)(e.span,{className:"mord mtight",children:(0,l.jsx)(e.span,{className:"mord mathnormal mtight",children:"n"})})})]})]}),(0,l.jsx)(e.span,{className:"vlist-s",children:"\u200b"})]}),(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"1.4138em"},children:(0,l.jsx)(e.span,{})})})]})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord text",children:(0,l.jsx)(e.span,{className:"mord",children:"min"})}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord",children:"8"}),(0,l.jsx)(e.span,{className:"mpunct",children:","}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.1667em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1.2em",verticalAlign:"-0.35em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.05724em"},children:"j"}),(0,l.jsx)(e.span,{className:"mclose",children:")"}),(0,l.jsx)(e.span,{className:"mclose",children:(0,l.jsx)(e.span,{className:"delimsizing size1",children:")"})}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"\u2248"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord mathcal",style:{marginRight:"0.02778em"},children:"O"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"}),(0,l.jsx)(e.span,{className:"mclose",children:")"}),(0,l.jsx)(e.span,{className:"mord",children:"."})]})]})]})}),"\n",(0,l.jsxs)(e.p,{children:["We did an experiment to compare the effect of different choices of ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"\u03b8"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\theta"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"})]})})]})," with 18 qubits (",(0,l.jsx)(e.code,{children:"resolution = 18"}),"), below is a table summarising the results:"]}),"\n",(0,l.jsxs)(e.table,{children:[(0,l.jsx)(e.thead,{children:(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.th,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"\u03b8"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\theta"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"})]})})]})}),(0,l.jsx)(e.th,{children:"Number of CX Gates"}),(0,l.jsx)(e.th,{children:"MSE error"})]})}),(0,l.jsxs)(e.tbody,{children:[(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"3"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"1\\times10^{-3}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"3"})]})})]})})})})})]})]})]})]})}),(0,l.jsx)(e.td,{children:"293"}),(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1.564"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"14"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"1.564\\times10^{-14}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1.564"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"14"})]})})]})})})})})]})]})]})]})})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"1\\times10^{-2}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})]})})})})})]})]})]})]})}),(0,l.jsx)(e.td,{children:"245"}),(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1.601"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"14"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"1.601\\times10^{-14}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1.601"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"14"})]})})]})})})})})]})]})]})]})})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"1"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"1\\times10^{-1}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"1"})]})})]})})})})})]})]})]})]})}),(0,l.jsx)(e.td,{children:"153"}),(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1.098"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"13"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"1.098\\times10^{-13}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1.098"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"13"})]})})]})})})})})]})]})]})]})})]})]})]}),"\n",(0,l.jsxs)(e.p,{children:["We chose ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\theta=1\\times10^{-2}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})]})})})})})]})]})]})]})," in our final submission for a balance of complexity and accuracy. The figure below shows the ratio between the number of CX gates and the resolution, which can be seen that the relation becomes linear if the resolution is large enough."]}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{src:"https://docs.google.com/spreadsheets/d/e/2PACX-1vRSAaAXzWFhnhRiy2nwQ4QAfic7GpYxCQGUsp-dkcqI05yOARGQ_1d5sF5zOA_qDN43n2GGEPpsXER3/pubchart?oid=941513203&format=image",alt:"scalability"})}),"\n",(0,l.jsxs)(e.p,{children:["Here is an additional table summarising another experiment that compares the difference in MSE error when we change the resolution ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"n"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"n"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"})]})})]})," from 5 to 18 (",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{children:"\u03b8"}),(0,l.jsx)(e.mo,{children:"="}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"2"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\theta=1\\times10^{-2}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6944em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",style:{marginRight:"0.02778em"},children:"\u03b8"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}}),(0,l.jsx)(e.span,{className:"mrel",children:"="}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"2"})]})})]})})})})})]})]})]})]}),"):"]}),"\n",(0,l.jsxs)(e.table,{children:[(0,l.jsx)(e.thead,{children:(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.th,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"n"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"n"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"})]})})]})}),(0,l.jsx)(e.th,{children:"Number of CX Gates"}),(0,l.jsx)(e.th,{children:"MSE error"})]})}),(0,l.jsxs)(e.tbody,{children:[(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mn,{children:"5"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"5"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6444em"}}),(0,l.jsx)(e.span,{className:"mord",children:"5"})]})})]})}),(0,l.jsx)(e.td,{children:"28"}),(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2.515"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"5"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"2.515\\times10^{-5}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"2.515"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"5"})]})})]})})})})})]})]})]})]})})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mn,{children:"8"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"8"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6444em"}}),(0,l.jsx)(e.span,{className:"mord",children:"8"})]})})]})}),(0,l.jsx)(e.td,{children:"70"}),(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2.230"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"8"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"2.230\\times10^{-8}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"2.230"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"8"})]})})]})})})})})]})]})]})]})})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mn,{children:"12"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"12"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6444em"}}),(0,l.jsx)(e.span,{className:"mord",children:"12"})]})})]})}),(0,l.jsx)(e.td,{children:"140"}),(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"6.526"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"11"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"6.526\\times10^{-11}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"6.526"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"11"})]})})]})})})})})]})]})]})]})})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mn,{children:"15"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"15"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6444em"}}),(0,l.jsx)(e.span,{className:"mord",children:"15"})]})})]})}),(0,l.jsx)(e.td,{children:"191"}),(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1.024"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"12"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"1.024\\times10^{-12}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1.024"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"12"})]})})]})})})})})]})]})]})]})})]}),(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mn,{children:"18"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"18"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.6444em"}}),(0,l.jsx)(e.span,{className:"mord",children:"18"})]})})]})}),(0,l.jsx)(e.td,{children:"245"}),(0,l.jsx)(e.td,{children:(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"1.601"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"14"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"1.601\\times10^{-14}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1.601"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"14"})]})})]})})})})})]})]})]})]})})]})]})]}),"\n",(0,l.jsx)(e.p,{children:"The MSE decreases as the resolution increases. This is because the overall probability scale is smaller when resolution is higher, leading to decreasing MSE. The Gaussian is also more fine-grained as resolution increases, as shown in the following figure:"}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"r8and12",src:a(2042).A+"",width:"2626",height:"969"})}),"\n",(0,l.jsx)(e.h3,{id:"code-of-our-solution",children:"Code of Our Solution"}),"\n",(0,l.jsx)(e.p,{children:"Below is the code we used for submission that includes all the things stated above:"}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{className:"language-python",children:"def create_solution(resolution: int): # Don't change!\r\n fraction_digits = resolution - 2 # Don't change!\r\n EXP_RATE = 1 # Don't change!\r\n \r\n import math\r\n \r\n @qfunc\r\n def single_X(x_arr: QArray[QBit]):\r\n X(x_arr[0])\r\n\r\n @qfunc\r\n def prepare_state(q: QArray[QBit]) :\r\n for i in range(resolution):\r\n exp = (i ** 2)/(-2 * (EXP_RATE / math.sqrt(5)) ** 2)\r\n angle = 2.0 * math.atan(math.exp(exp))\r\n if angle > 1e-6:\r\n RY(angle, q[i])\r\n CRY(-math.pi/42, q[0], q[1])\r\n\r\n @qfunc\r\n def approx_qft(target: QArray[QBit]):\r\n for i in range(resolution // 2):\r\n SWAP(target[i], target[resolution - i - 1])\r\n \r\n for j in range(resolution):\r\n H(target[j])\r\n \r\n for k in range(j+1, resolution):\r\n theta = 2 * math.pi / (2 ** (k - j + 1))\r\n if theta > 1e-2: # 9 qubits\r\n CPHASE(theta, target[k], target[j])\r\n \r\n @qfunc\r\n def prepare_gaussian(x: QNum): \r\n prepare_state(x)\r\n approx_qft(x)\r\n single_X(x)\r\n \r\n return prepare_gaussian\n"})}),"\n",(0,l.jsx)(e.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,l.jsxs)(e.p,{children:["In this post, we have explained our solution to the MIT iQuHACK 2025 challenge, where we were tasked with preparing a Gaussian state in the symmetrical domain using a quantum circuit. Our approach efficiently scales with increasing resolution, achieving a low mean squared error (MSE) with a complexity of ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mi,{mathvariant:"script",children:"O"}),(0,l.jsx)(e.mo,{stretchy:"false",children:"("}),(0,l.jsx)(e.mi,{children:"n"}),(0,l.jsx)(e.mo,{stretchy:"false",children:")"})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"\\mathcal{O}(n)"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"1em",verticalAlign:"-0.25em"}}),(0,l.jsx)(e.span,{className:"mord mathcal",style:{marginRight:"0.02778em"},children:"O"}),(0,l.jsx)(e.span,{className:"mopen",children:"("}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"}),(0,l.jsx)(e.span,{className:"mclose",children:")"})]})})]}),", making it feasible even for high-resolution cases. By applying RY rotations to encode an exponential factor and then using the Quantum Fourier Transform (QFT) to map the state into a Gaussian distribution, we were able to achieve a smooth Gaussian amplitude distribution, as required by the challenge."]}),"\n",(0,l.jsxs)(e.p,{children:["Furthermore, to maximize scalability, we pruned redundant gates in the QFT, significantly reducing the gate count while maintaining the accuracy of the result. Our final circuit balances gate complexity and error, with a small MSE error of ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mn,{children:"2.230"}),(0,l.jsx)(e.mo,{children:"\xd7"}),(0,l.jsx)(e.mn,{children:"1"}),(0,l.jsxs)(e.msup,{children:[(0,l.jsx)(e.mn,{children:"0"}),(0,l.jsxs)(e.mrow,{children:[(0,l.jsx)(e.mo,{children:"\u2212"}),(0,l.jsx)(e.mn,{children:"8"})]})]})]}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"2.230\\times10^{-8}"})]})})}),(0,l.jsxs)(e.span,{className:"katex-html","aria-hidden":"true",children:[(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.7278em",verticalAlign:"-0.0833em"}}),(0,l.jsx)(e.span,{className:"mord",children:"2.230"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,l.jsx)(e.span,{className:"mbin",children:"\xd7"}),(0,l.jsx)(e.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.8141em"}}),(0,l.jsx)(e.span,{className:"mord",children:"1"}),(0,l.jsxs)(e.span,{className:"mord",children:[(0,l.jsx)(e.span,{className:"mord",children:"0"}),(0,l.jsx)(e.span,{className:"msupsub",children:(0,l.jsx)(e.span,{className:"vlist-t",children:(0,l.jsx)(e.span,{className:"vlist-r",children:(0,l.jsx)(e.span,{className:"vlist",style:{height:"0.8141em"},children:(0,l.jsxs)(e.span,{style:{top:"-3.063em",marginRight:"0.05em"},children:[(0,l.jsx)(e.span,{className:"pstrut",style:{height:"2.7em"}}),(0,l.jsx)(e.span,{className:"sizing reset-size6 size3 mtight",children:(0,l.jsxs)(e.span,{className:"mord mtight",children:[(0,l.jsx)(e.span,{className:"mord mtight",children:"\u2212"}),(0,l.jsx)(e.span,{className:"mord mtight",children:"8"})]})})]})})})})})]})]})]})]})," and a gate count that grows linearly with the resolution for large ",(0,l.jsxs)(e.span,{className:"katex",children:[(0,l.jsx)(e.span,{className:"katex-mathml",children:(0,l.jsx)(e.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,l.jsxs)(e.semantics,{children:[(0,l.jsx)(e.mrow,{children:(0,l.jsx)(e.mi,{children:"n"})}),(0,l.jsx)(e.annotation,{encoding:"application/x-tex",children:"n"})]})})}),(0,l.jsx)(e.span,{className:"katex-html","aria-hidden":"true",children:(0,l.jsxs)(e.span,{className:"base",children:[(0,l.jsx)(e.span,{className:"strut",style:{height:"0.4306em"}}),(0,l.jsx)(e.span,{className:"mord mathnormal",children:"n"})]})})]}),". This optimization makes our solution highly scalable, capable of handling large-scale quantum computations efficiently."]}),"\n",(0,l.jsx)(e.p,{children:"Overall, our solution demonstrates that by combining clever state preparation techniques and efficient quantum circuits, we can solve complex problems with scalability and precision, even within the constraints of quantum hardware limitations. We hope this approach can serve as a reference for future quantum state preparation tasks and inspire further advancements in quantum algorithm design."})]})}function d(s={}){const{wrapper:e}={...(0,n.R)(),...s.components};return e?(0,l.jsx)(e,{...s,children:(0,l.jsx)(h,{...s})}):h(s)}},5145:(s,e,a)=>{a.d(e,{A:()=>l});const l="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjwAAAFSCAYAAAD2GQUtAAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAA0dEVYdENyZWF0aW9uIFRpbWUAVGh1cnNkYXksIEZlYnJ1YXJ5IDA2LCAyMDI1IFBNMTA6Mzk6NTJEUREoAAAaCUlEQVR4nO3db0yV9/3/8deF53D8g+UcEBVR0CN2tlTUKtop7WgN6W/tKa5q+msN2AFzfrvExZmYZXM0Gy5d03Trf5s0jQPHpO3WG0NWZl1mCyaiRoVqZKzgRIpFhXLEopU/53xv+PWkFG17DuDRD8/HLa5zrnN4N7nKeXpd17kuKzEx0S8AAACDRYR7AAAAgOFG8AAAAOMRPAAAwHgEDwAAMB7BAwAAjEfwAAAA4xE8AADAeAQPAAAwHsEDAACMZwv1hd/5znf02GOPacuWLQOesyxLK1eu1Ny5c+X3+1VaWqq6urpBDQoAABCqkPbwPPjgg8rMzJTD4bjm8/PmzdOkSZNUUFCgrVu3au3atbLb7YMaFAAAIFQhBU9jY6Nee+012WzX3kE0f/587d27V5LU2tqqlpYWTZ8+PeQhAQAABiOkQ1oNDQ1f+7zT6VRHR0dg+dy5c3I6nZKk8vLyAet7PJ5QxgAAAPhWQj6H5+tYljVgube3V9K146a8vJzoAQAAw2ZYgqejo0MTJkzQqVOnJEkul0ter3fI3t9vt6t3ygT5x44esvfE0LJ6emQ73Sbr4hfhHgUAgKENHrfbrebmZtXW1iojI0NHjhxRTEyMJk6cqJMnTw7Z7+mLj9Vnhf+jy6mzhuw9MbRsp1oVW/C6HB99HO5RAAAI7aTlhx56SM8++6xiYmL07LPPaunSpZKk7OxsTZs2TYcPH1ZbW5uee+45rV+/Xtu2bZPf7x/SwQEAAL6tkPbwvPfee3rvvfcGPF5YWBj4efv27aFPBQAAMIS40jIAADAewQMAAIxH8AAAAOMRPAAAwHgEDwAAMB7BAwAAjEfwAAAA4xE8AADAeAQPAAAwHsEDAACMR/AAAADjETwAAMB4BA8AADAewQMAAIxH8AAAAOMRPAAAwHgEDwAAMB7BAwAAjEfwAAAA4xE8AADAeAQPAAAwHsEDAACMR/AAAADjETwAAMB4BA8AADAewQMAAIxH8AAAAOMRPAAAwHgEDwAAMB7BAwAAjEfwAAAA4xE8AADAeAQPAAAwHsEDAACMR/AAAADjETwAAMB4BA8AADAewQMAAIxH8AAAAOMRPAAAwHgEDwAAMB7BAwAAjEfwAAAA4xE8AADAeAQPAAAwHsEDAACMR/AAAADj2UJ5UUJCgnJzc+VwONTU1KSioiL19vb2W+eJJ57QnXfeKb/fr3fffVe1tbVDMjAAAECwQtrDk5+fr+LiYhUUFKivr0+ZmZn9nk9OTlZ8fLyefvppvfTSS1q1atWQDAsAABCKoIMnNjZWktTc3CxJqqysVEpKSr91uru7FRkZKUkaNWqUOjs7BzsnAABAyII+pBUdHa2Ojo7Acltbm5xOZ791Tp06pePHj2vTpk3q7e3Vn/70p8Bz5eXlgxgXAAAgeEEHj2VZA5a/ev5OZGSkkpKSVFVVpUWLFmnRokUqKyuTJHk8ngHvSQQBAIDhFPQhLa/Xq7i4uMCyy+WS1+vtt87ixYvV1NSkffv26dVXX1V6errsdvvgpwUAAAhB0MHT3t4u6cqJyZKUnp6umpoaSZLb7Q6EzdXDXGPGjJHf7x+wFwgAAOBGCelr6cXFxcrLy5PP51NDQ4OqqqokSdnZ2SopKVF1dbXuuusubdmyRX19fSotLZXf7x/SwQEAAL6tkIKnsbFRmzdvHvB4YWFh4OfXX3899KkAAACGEFdaBgAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPGGPXimTJmicePGDfevAQAAuC5bKC9KSEhQbm6uHA6HmpqaVFRUpN7e3v5vbLMpNzdX0dHRKikpUVdX15AMDAAAEKyQ9vDk5+eruLhYBQUF6uvrU2Zm5oB1Vq1apXPnzun5559Xa2vroAcFAAAIVdDBExsbK0lqbm6WJFVWViolJaXfOuPHj9fMmTP1t7/9bQhGBAAAGJygD2lFR0ero6MjsNzW1ian09lvnfnz5+vixYv6xS9+ocjISFVUVGj//v2SpPLy8kGODAAAEJygg8eyrAHLXz1/Z9KkSWpvb1dJSYmioqJUUFCg48eP68KFC/J4PAPekwgCAADDKehDWl6vV3FxcYFll8slr9fbbx2fz6e6ujr5fD51dnaqpaVFEyZMGPy0AAAAIQg6eNrb2yVJycnJkqT09HTV1NRIktxut+x2u06cOKF77rlHlmUpKipKCQkJOnPmzBCODQAA8O2F9LX04uJi5eXlyefzqaGhQVVVVZKk7OxslZSU6MiRI5o1a5YKCwslSe+8844uXrw4dFMDAAAEwUpMTPSHe4jy8vJrnttzPb2Jk9W+5SldTp01jFNhMGynWhVb8LocH30c7lEAAODWEgAAwHwEDwAAMB7BAwAAjEfwAAAA4xE8AADAeAQPAAAwHsEDAACMR/AAAADjETwAAMB4BA8AADAewQMAAIxH8AAAAOMRPAAAwHgEDwAAMB7BAwAAjEfwAAAA4xE8AADAeAQPAAAwHsEDAACMR/AAAADjETwAAMB4BA8AADAewQMAAIxH8AAAAOMRPAAAwHgEDwAAMB7BAwAAjEfwAAAA4xE8AADAeAQPAAAwHsEDAACMR/AAAADjETwAAMB4BA8AADAewQMAAIxH8AAAAOMRPAAAwHgEDwAAMB7BAwAAjEfwAAAA4xE8AADAeAQPAAAwHsEDAACMR/AAAADjETwAAMB4BA8AADAewQMAAIxnC+VFCQkJys3NlcPhUFNTk4qKitTb23vNddetW6fq6mrV1tYOalAAAIBQhbSHJz8/X8XFxSooKFBfX58yMzOvud6CBQs0Z86cQQ0IAAAwWEEHT2xsrCSpublZklRZWamUlJQB640fP17Lly9XTU3NIEcEAAAYnKAPaUVHR6ujoyOw3NbWJqfTOWC9nJwcvfvuuwP28JSXl4cwJgAAQOiCDh7LsgYsf/X8ncWLF+vChQuqra0dEDwej2fAexJBAABgOAUdPF6vV3FxcYFll8slr9cbWI6IiJDH41F3d7d+85vfyOVyKTU1VUlJSSorKxuaqQEAAIIQdPC0t7dLkpKTk9XQ0KD09PTAeTput1vNzc0qKCgIrJ+dna2jR4/yLS0AABA2IX1Lq7i4WLm5udqyZYsiIiJUVVUl6UrcTJs2bUgHBAAAGKyQrsPT2NiozZs3D3i8sLBwwGMlJSWh/AoAAIAhw5WWAQCA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGM8WyosSEhKUm5srh8OhpqYmFRUVqbe3N/C80+nUk08+KZfLJcuy9MYbb6ilpWXIhgYAAAhGSHt48vPzVVxcrIKCAvX19SkzM7Pf811dXdqxY4d+/etfa9euXXr44YeHZFgAAIBQBB08sbGxkqTm5mZJUmVlpVJSUvqt09PTo3PnzkmSvF6v+vr6BjsnAABAyII+pBUdHa2Ojo7Acltbm5xO53XXnzt3rj766KPAcnl5ebC/EgAAYFCCDh7LsgYsf/n8nS+LiYnRzJkz9fbbbwce83g8A9YjggAAwHAK+pCW1+tVXFxcYNnlcsnr9Q5Yz7Is5eTkaMeOHfL5fIObEgAAYBCCDp729nZJUnJysiQpPT1dNTU1kiS32y273S5JWr58uerr63XixImhmhUAACAkIX0tvbi4WHl5efL5fGpoaFBVVZUkKTs7WyUlJZo4caK+//3vq62tTRkZGTp//rx+97vfDengAAAA31ZIwdPY2KjNmzcPeLywsFCSdOLECVVXVw9uMgAAgCHClZYBAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYj+ABAADGI3gAAIDxCB4AAGA8ggcAABiP4AEAAMYjeAAAgPEIHgAAYDyCBwAAGI/gAQAAxiN4AACA8QgeAABgPIIHAAAYzxbKixISEpSbmyuHw6GmpiYVFRWpt7c38LxlWVq5cqXmzp0rv9+v0tJS1dXVDdnQAAAAwQhpD09+fr6Ki4tVUFCgvr4+ZWZm9nt+3rx5mjRpkgoKCrR161atXbtWdrt9SAYGAAAIVtB7eGJjYyVJzc3NkqTKyko9+uijqqioCKwzf/587d27V5LU2tqqlpYWTZ8+XR9//PFQzAz0c2H1/1PPzKnhHgNfY/yOf8je+Em4xwAwggUdPNHR0ero6Agst7W1yel09lvH6XT2W+fcuXOBdcrLywe8Z3Jy8jUfvx6/bZR8zvHy+0I6IocbwIpPUsTzKbK6e4b9d/VNipFvtGPYfw9CZ8v4/7IuXQ73GAAM4PF4Qnpd0MVgWdaA5S+fv/NN61xr0PLy8pD/A2AWtgVcxbaAq9gW8GXl5eXasGGDGhoagnpd0OfweL1excXFBZZdLpe8Xm+/dTo6OjRhwoSvXQcAAOBGCTp42tvbJV05DCVJ6enpqqmpkSS53W7Z7XbV1tYqIyNDlmUpNjZWEydO1MmTJ4duagAAgCCEdBJMcXGx8vLy5PP51NDQoKqqKklSdna2SkpKdPjwYaWkpOi5555TV1eXtm3bJr/fP6SDAwAAfFshBU9jY6M2b9484PHCwsLAz9u3bw99KgAAgCFkJSYmsusFAAAYjVtLAAAA4xE8AADAeAQPAAAwHpcqvgksWLBA8+bN09mzZ1VRUTHgQo4YOWbMmKH09HT19fWpoqKi3xXLMbK4XC498MADio6O1gcffKATJ06EeySECdvC0GAPTxhFRkZq/fr1uu+++7Rv3z5ZlqW8vLxwj4UwycrKUl5enurr6/Xxxx9r48aN3HR3hJo7d65++ctf6sKFC6qurtaaNWs0dSr3ixuJ2BaGDnt4wsRms2nDhg06efKk/vKXv8jv9+v48eN69dVXZVkW1y0aYVasWCG3261nnnlGly5dkiQtWbJEbrdb9fX1YZ4ON1JqaqpWr16tF154QadPn5Yk7du3T3fffbc++YQbsI4kbAtDiz08YfKDH/xAZ8+e1TvvvBOIm9tvv13t7e3EzggzZ84cpaam6pVXXgnEztixY5WUlKRPP/00zNPhRoqOjlZOTo5eeumlwAecdGUbaW5uDuNkuNHYFoYewRMGdrtdS5Ys0VtvvRV4bPz48crNzQ08Nnv27HCNhxvsoYce0o4dO3T58pW7iVuWpfz8fH344Yfq7OzUrFmzFBHB/6ojQUZGhqqqqvp9wD344IOKiIhQTU2NJk6cKJfLFcYJcaN807Yg8TkRLP6KhsHo0aN16dIlffHFF5KkmJgYbdq0Se+//77q6uokSQsXLgzniLiBoqKidObMGUlXDnWuW7dO3d3dKisrk3TlpHbLssI5Im6Q2267LbAtSFc+4NLT07V161b5/X4lJCQoPj4+jBPiRvmmbWHs2LG68847wzjhrWdUdHT0r8M9xEjT3d2tpKQk3X333Zo5c6Yef/xxlZWVqbq6Wvfff7/mz5+vlJQUxcfHKyIiot9GD/NcvnxZK1eulNPp1Jo1a3Ty5EmVlJRo4cKFSktLU2pqqiZPnqz4+Hg1NjaGe1wMo7a2Nq1evVpjx47V8uXLNXHiRL344ouaNGmSli5dqgULFighIUEzZsxQQ0OD+vr6wj0yhsn1tgWHw6Hvfe97SktL04wZM5SYmKhz587p888/D/fINz1uLREmlmVp3rx5ioqKUk1NjS5cuCDpynHby5cva9WqVSopKZF05XBXXl6e/vrXv6qlpSWcY2OYuN1uJSUlqb6+PrALe9y4cfL7/Vq1alXg3nQRERHKycnRv//9b+3fvz+cI2OYxMbGKjU1Va2trYE9vpGRkRo9erQeeOAB/etf/1JnZ6ck6f7771dcXFzgiw8wy7W2Bcuy5HK5NHnyZEVFRenAgQOSrvwNefjhh/Xmm28GzgVEfxzSChO/368jR46oqqoqEDuSdP78eUVERMjr9QYeW7NmjXbu3KklS5YoISEhHONimJ04cUJ79uzpd7y+q6tLFy9eDBz6lKRly5aptbVVNptNixcvDseoGGbt7e3as2dP4ANOurJXuLOzU3a7PfD3Yvr06UpJSdH+/fv16KOPhmtcDKNrbQt+v1+fffaZIiMjdf78eUlXTpNYvXq1duzYoVWrVmnMmDHhGvmmxh6em5TdbldsbKxaW1vlcDj0xBNPqLi4WLfddltgI8fIYLfbFRUVpa6uLnV3d+vxxx9XRUWFIiIiuDDhCGO32+Xz+eR0OtXe3q6lS5fq/PnzamlpYVsYYSzLks1mC3xOTJkyRWlpafrnP/+pnp4edXd3h3vEmw57eG5SPT09SkpK0qJFi3T58mWNGTNGY8aMIXZGoJ6eHkVGRiorK0uWZenMmTNyu918wI1APT09sixLHo9HDodD//3vf3XXXXexLYxAfr9fPT09Wrp0qeLj43XmzBlNnz498A8jDMQenpvc0qVLlZqaqpaWFpWVlXEbihHM7XZr2bJlkqQ//vGPmjZtGrehGKGio6O1fPlyOZ1OvfXWW/J6vYqJiVFbWxt/E0aYUaNG6ZFHHlFSUpI++OAD1dXVsS1cB8Fzi4iMjNS6detks9m0a9cuJScna/LkyXrjjTfCPRrCICsrS2lpadq5c6f8fr+ysrJUWFionp6ecI+GMIiJiZHH41FiYqJGjx6tLVu2BK7rhJGFbeH6OKR1C7h6G4ozZ87oxRdf1PHjx1VWVqbU1FSuzzICrVixQrfffrueeeYZHThwQAcPHlRbW5vcbne4R0OYfPbZZ9q9e7fGjh2rbdu28QE3grEtXB/BcwvgNhS4ittQ4Fri4+O1fv16vfnmm9xJe4RjW7g+gucm9023oXA4HEpLS9OCBQs0atSoME6KG+GbbkOBkePqV4+v9wGXmJioe++9V5MmTQrXiLhBvmlbwBXcLf0md63bUGzYsEHvv/++JOm3v/2tjh49Kr/fr/T0dL388svs9THYV29D8aMf/ShwG4rJkycrJydHPp9PnZ2d2r59O7uzDWWz2bRp0ybt3r1bjzzySL8POLvdrieffFJTp07V4cOH9dRTT6m0tFT19fVhnhrD4eu2hatWrFihWbNm6eLFizpw4MCIvWgpt5a4yV3vNhRdXV3KycnRyy+/rKqqKn300Ue699571drayrd1DHa921D4/X59/vnnOnTokO655x4dO3ZMDQ0N4R4Xw8Tn8+nYsWNau3at/vGPf+jIkSOSrsTOxo0b1dbWptdee0319fX65JNP5PF4VF1dHeapMRyuty18WV1dnS5fvqw5c+Zo586dI/Zr6wTPLaC2tlbSlWtwvP3227p06ZJ+/OMf6/nnnw+ctxERESGPx6O9e/dyTxWDNTc369NPP9W4ceNUUVGh6urqwB49h8Ohn/3sZzp48KD27NkT5kkx3C5duqTDhw/rscce08GDB9XT06Mf/vCHam9vV2lpaWC92bNny+Vy6dChQ2GcFsPpWtvCly1cuFAej0cvvPBCvyv7jzR8Lf0W9NRTT+nIkSP9/sWWlZWlqVOnauvWrWGcDOFyNXb2799P7IwwNptNvb29mjJlin7yk5/o6aefls/nk3Tlej2/+tWv9Morr+jUqVNhnhTD7eq28GVXY+f3v//9iI4diZOWb0lJSUk6evRoYHnZsmVKS0tTUVFR+IbCDWez2fTTn/5UEyZMIHZGsKsfcImJiTp+/Hi/2Nm4caP+/ve/EzsjxNVt4b777lNGRgax8xUc0roFxcTEaPbs2bp06ZJWrFihO+64Q3/4wx/U1dUV7tFwA/l8PnV1dennP/+5KisrtXv37nCPhDDq6upSVlaWzpw5o+TkZK1du1a7du3Shx9+GO7RcIOdPn1ay5cv13e/+109++yzxM7/IXhuQXV1dUpISNDChQv1n//8R3/+85/73VEbI8fZs2fV1NSkZcuW6eDBg1xKfgT74osv1NDQoIyMDEVHR6u0tFTHjh0L91gIA5/Pp0OHDumOO+6Qz+djD9//4RwewAAJCQk6ffo0lyQAEGC32xUTExO4lMVIR/AAAADjcdIyAAAwHsEDAACMR/AAAADjETwAAMB4BA8AADAewQMAAIxH8AAAAOMRPAAAwHgEDwAAMB7BAwAAjPe/+P+2MFH1aV4AAAAASUVORK5CYII="},6468:(s,e,a)=>{a.d(e,{A:()=>l});const l=a.p+"assets/images/final_state-b9b308ff455d826c302c8eab46a48e6e.png"},7260:(s,e,a)=>{a.d(e,{A:()=>l});const l=a.p+"assets/images/gate_prune-70fa4724b0fda4adf77650b90817f835.png"},3942:(s,e,a)=>{a.d(e,{A:()=>l});const l=a.p+"assets/images/overall_circuit-3f3f7791ae13cda95d1c8bd7a050e2b3.png"},727:(s,e,a)=>{a.d(e,{A:()=>l});const l=a.p+"assets/images/qft_state-d99e8e5415393d51d3edcb76368406e2.png"},2042:(s,e,a)=>{a.d(e,{A:()=>l});const l=a.p+"assets/images/r8and12-0adb4d33590944377ab6dae3d44b1956.png"},8453:(s,e,a)=>{a.d(e,{R:()=>m,x:()=>t});var l=a(6540);const n={},i=l.createContext(n);function m(s){const e=l.useContext(i);return l.useMemo((function(){return"function"==typeof s?s(e):{...e,...s}}),[e,s])}function t(s){let e;return e=s.disableParentContext?"function"==typeof s.components?s.components(n):s.components||n:m(s.components),l.createElement(i.Provider,{value:e},s.children)}}}]); \ No newline at end of file diff --git a/assets/js/6ef99908.e05ea6e2.js b/assets/js/6ef99908.e05ea6e2.js new file mode 100644 index 0000000..9b2de50 --- /dev/null +++ b/assets/js/6ef99908.e05ea6e2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[7197],{8448:s=>{s.exports=JSON.parse('{"permalink":"/blog/tags/state-preparation","page":1,"postsPerPage":10,"totalPages":1,"totalCount":1,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/7094d9aa.67465d0c.js b/assets/js/7094d9aa.db315291.js similarity index 76% rename from assets/js/7094d9aa.67465d0c.js rename to assets/js/7094d9aa.db315291.js index 7afad5c..bd50c06 100644 --- a/assets/js/7094d9aa.67465d0c.js +++ b/assets/js/7094d9aa.db315291.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[9082],{8303:s=>{s.exports=JSON.parse('{"permalink":"/blog/tags/quantum","page":1,"postsPerPage":10,"totalPages":1,"totalCount":2,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[9082],{8303:s=>{s.exports=JSON.parse('{"permalink":"/blog/tags/quantum","page":1,"postsPerPage":10,"totalPages":1,"totalCount":3,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/814f3328.b0cbb069.js b/assets/js/814f3328.b0cbb069.js deleted file mode 100644 index 1c91a41..0000000 --- a/assets/js/814f3328.b0cbb069.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[7472],{5513:t=>{t.exports=JSON.parse('{"title":"Recent posts","items":[{"title":"Introduction to Quantum Neural Networks","permalink":"/blog/intro-to-qnn","unlisted":false},{"title":"Introduction to Quantum Computing","permalink":"/blog/intro-to-quantum-computing","unlisted":false},{"title":"Introduction to PyTorch","permalink":"/blog/intro-to-pytorch","unlisted":false},{"title":"The Most Basics of Neural Networks","permalink":"/blog/basic-of-nn","unlisted":false},{"title":"Website Launch!","permalink":"/blog/website-launch","unlisted":false}]}')}}]); \ No newline at end of file diff --git a/assets/js/814f3328.fc1875b7.js b/assets/js/814f3328.fc1875b7.js new file mode 100644 index 0000000..837b379 --- /dev/null +++ b/assets/js/814f3328.fc1875b7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[7472],{5513:t=>{t.exports=JSON.parse('{"title":"Recent posts","items":[{"title":"Preparing a Gaussian State in the Symmetrical Domain","permalink":"/blog/mit-iquhack-solution","unlisted":false},{"title":"Introduction to Quantum Neural Networks","permalink":"/blog/intro-to-qnn","unlisted":false},{"title":"Introduction to Quantum Computing","permalink":"/blog/intro-to-quantum-computing","unlisted":false},{"title":"Introduction to PyTorch","permalink":"/blog/intro-to-pytorch","unlisted":false},{"title":"The Most Basics of Neural Networks","permalink":"/blog/basic-of-nn","unlisted":false}]}')}}]); \ No newline at end of file diff --git a/assets/js/98b1a88b.c09459e2.js b/assets/js/98b1a88b.cadd4898.js similarity index 56% rename from assets/js/98b1a88b.c09459e2.js rename to assets/js/98b1a88b.cadd4898.js index d4d852c..eedec48 100644 --- a/assets/js/98b1a88b.c09459e2.js +++ b/assets/js/98b1a88b.cadd4898.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[4410],{7831:(t,n,e)=>{e.r(n),e.d(n,{assets:()=>s,contentTitle:()=>u,default:()=>m,frontMatter:()=>r,metadata:()=>i,toc:()=>l});var o=e(4848),a=e(8453);const r={slug:"intro-to-qnn",title:"Introduction to Quantum Neural Networks",authors:"eason",tags:["intermediate","quantum","qnn","pytorch","tutorial"]},u=void 0,i={permalink:"/blog/intro-to-qnn",source:"@site/blog/2024-2-9-intro-to-qnn/index.md",title:"Introduction to Quantum Neural Networks",description:"Make a Quantum Neural Network (QNN) in PyTorch.",date:"2024-02-09T00:00:00.000Z",tags:[{label:"intermediate",permalink:"/blog/tags/intermediate"},{label:"quantum",permalink:"/blog/tags/quantum"},{label:"qnn",permalink:"/blog/tags/qnn"},{label:"pytorch",permalink:"/blog/tags/pytorch"},{label:"tutorial",permalink:"/blog/tags/tutorial"}],readingTime:9.51,hasTruncateMarker:!0,authors:[{name:"Eason Xie",title:"Website Owner",url:"https://easonoob.github.io",imageURL:"https://avatars.githubusercontent.com/u/100521878?v=4",key:"eason"}],frontMatter:{slug:"intro-to-qnn",title:"Introduction to Quantum Neural Networks",authors:"eason",tags:["intermediate","quantum","qnn","pytorch","tutorial"]},unlisted:!1,nextItem:{title:"Introduction to Quantum Computing",permalink:"/blog/intro-to-quantum-computing"}},s={authorsImageUrls:[void 0]},l=[];function c(t){const n={p:"p",...(0,a.R)(),...t.components};return(0,o.jsx)(n.p,{children:"Make a Quantum Neural Network (QNN) in PyTorch."})}function m(t={}){const{wrapper:n}={...(0,a.R)(),...t.components};return n?(0,o.jsx)(n,{...t,children:(0,o.jsx)(c,{...t})}):c(t)}},8453:(t,n,e)=>{e.d(n,{R:()=>u,x:()=>i});var o=e(6540);const a={},r=o.createContext(a);function u(t){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof t?t(n):{...n,...t}}),[n,t])}function i(t){let n;return n=t.disableParentContext?"function"==typeof t.components?t.components(a):t.components||a:u(t.components),o.createElement(r.Provider,{value:n},t.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[4410],{7831:(t,n,e)=>{e.r(n),e.d(n,{assets:()=>s,contentTitle:()=>u,default:()=>m,frontMatter:()=>r,metadata:()=>i,toc:()=>l});var o=e(4848),a=e(8453);const r={slug:"intro-to-qnn",title:"Introduction to Quantum Neural Networks",authors:"eason",tags:["intermediate","quantum","qnn","pytorch","tutorial"]},u=void 0,i={permalink:"/blog/intro-to-qnn",source:"@site/blog/2024-2-9-intro-to-qnn/index.md",title:"Introduction to Quantum Neural Networks",description:"Make a Quantum Neural Network (QNN) in PyTorch.",date:"2024-02-09T00:00:00.000Z",tags:[{label:"intermediate",permalink:"/blog/tags/intermediate"},{label:"quantum",permalink:"/blog/tags/quantum"},{label:"qnn",permalink:"/blog/tags/qnn"},{label:"pytorch",permalink:"/blog/tags/pytorch"},{label:"tutorial",permalink:"/blog/tags/tutorial"}],readingTime:9.51,hasTruncateMarker:!0,authors:[{name:"Eason Xie",title:"Website Owner",url:"https://easonoob.github.io",imageURL:"https://avatars.githubusercontent.com/u/100521878?v=4",key:"eason"}],frontMatter:{slug:"intro-to-qnn",title:"Introduction to Quantum Neural Networks",authors:"eason",tags:["intermediate","quantum","qnn","pytorch","tutorial"]},unlisted:!1,prevItem:{title:"Preparing a Gaussian State in the Symmetrical Domain",permalink:"/blog/mit-iquhack-solution"},nextItem:{title:"Introduction to Quantum Computing",permalink:"/blog/intro-to-quantum-computing"}},s={authorsImageUrls:[void 0]},l=[];function c(t){const n={p:"p",...(0,a.R)(),...t.components};return(0,o.jsx)(n.p,{children:"Make a Quantum Neural Network (QNN) in PyTorch."})}function m(t={}){const{wrapper:n}={...(0,a.R)(),...t.components};return n?(0,o.jsx)(n,{...t,children:(0,o.jsx)(c,{...t})}):c(t)}},8453:(t,n,e)=>{e.d(n,{R:()=>u,x:()=>i});var o=e(6540);const a={},r=o.createContext(a);function u(t){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof t?t(n):{...n,...t}}),[n,t])}function i(t){let n;return n=t.disableParentContext?"function"==typeof t.components?t.components(a):t.components||a:u(t.components),o.createElement(r.Provider,{value:n},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/a7023ddc.6b35d415.js b/assets/js/a7023ddc.6b35d415.js new file mode 100644 index 0000000..6b0ce65 --- /dev/null +++ b/assets/js/a7023ddc.6b35d415.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[9267],{8289:a=>{a.exports=JSON.parse('[{"label":"advanced","permalink":"/blog/tags/advanced","count":1},{"label":"quantum","permalink":"/blog/tags/quantum","count":3},{"label":"state-preparation","permalink":"/blog/tags/state-preparation","count":1},{"label":"intermediate","permalink":"/blog/tags/intermediate","count":1},{"label":"qnn","permalink":"/blog/tags/qnn","count":1},{"label":"pytorch","permalink":"/blog/tags/pytorch","count":3},{"label":"tutorial","permalink":"/blog/tags/tutorial","count":4},{"label":"beginners","permalink":"/blog/tags/beginners","count":3},{"label":"qiskit","permalink":"/blog/tags/qiskit","count":1},{"label":"nn","permalink":"/blog/tags/nn","count":2},{"label":"tired","permalink":"/blog/tags/tired","count":3},{"label":"hola","permalink":"/blog/tags/hola","count":1}]')}}]); \ No newline at end of file diff --git a/assets/js/a7023ddc.ddbcf0cf.js b/assets/js/a7023ddc.ddbcf0cf.js deleted file mode 100644 index 29be736..0000000 --- a/assets/js/a7023ddc.ddbcf0cf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[9267],{8289:l=>{l.exports=JSON.parse('[{"label":"intermediate","permalink":"/blog/tags/intermediate","count":1},{"label":"quantum","permalink":"/blog/tags/quantum","count":2},{"label":"qnn","permalink":"/blog/tags/qnn","count":1},{"label":"pytorch","permalink":"/blog/tags/pytorch","count":3},{"label":"tutorial","permalink":"/blog/tags/tutorial","count":4},{"label":"beginners","permalink":"/blog/tags/beginners","count":3},{"label":"qiskit","permalink":"/blog/tags/qiskit","count":1},{"label":"nn","permalink":"/blog/tags/nn","count":2},{"label":"tired","permalink":"/blog/tags/tired","count":3},{"label":"hola","permalink":"/blog/tags/hola","count":1}]')}}]); \ No newline at end of file diff --git a/assets/js/afc4a07f.feb21edc.js b/assets/js/afc4a07f.feb21edc.js new file mode 100644 index 0000000..2400f9d --- /dev/null +++ b/assets/js/afc4a07f.feb21edc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[1875],{5409:s=>{s.exports=JSON.parse('{"label":"state-preparation","permalink":"/blog/tags/state-preparation","allTagsPath":"/blog/tags","count":1,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/b2b675dd.09514802.js b/assets/js/b2b675dd.4cd5b465.js similarity index 75% rename from assets/js/b2b675dd.09514802.js rename to assets/js/b2b675dd.4cd5b465.js index 52a4088..be5aa57 100644 --- a/assets/js/b2b675dd.09514802.js +++ b/assets/js/b2b675dd.4cd5b465.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[1991],{9775:s=>{s.exports=JSON.parse('{"permalink":"/blog","page":1,"postsPerPage":10,"totalPages":1,"totalCount":5,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[1991],{9775:s=>{s.exports=JSON.parse('{"permalink":"/blog","page":1,"postsPerPage":10,"totalPages":1,"totalCount":6,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/b2f554cd.bdb7f220.js b/assets/js/b2f554cd.bdb7f220.js deleted file mode 100644 index fa671c2..0000000 --- a/assets/js/b2f554cd.bdb7f220.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[5894],{6042:t=>{t.exports=JSON.parse('{"blogPosts":[{"id":"intro-to-qnn","metadata":{"permalink":"/blog/intro-to-qnn","source":"@site/blog/2024-2-9-intro-to-qnn/index.md","title":"Introduction to Quantum Neural Networks","description":"Make a Quantum Neural Network (QNN) in PyTorch.","date":"2024-02-09T00:00:00.000Z","tags":[{"label":"intermediate","permalink":"/blog/tags/intermediate"},{"label":"quantum","permalink":"/blog/tags/quantum"},{"label":"qnn","permalink":"/blog/tags/qnn"},{"label":"pytorch","permalink":"/blog/tags/pytorch"},{"label":"tutorial","permalink":"/blog/tags/tutorial"}],"readingTime":9.51,"hasTruncateMarker":true,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"intro-to-qnn","title":"Introduction to Quantum Neural Networks","authors":"eason","tags":["intermediate","quantum","qnn","pytorch","tutorial"]},"unlisted":false,"nextItem":{"title":"Introduction to Quantum Computing","permalink":"/blog/intro-to-quantum-computing"}},"content":"Make a Quantum Neural Network (QNN) in PyTorch.\\r\\n\\r\\n\x3c!--truncate--\x3e\\r\\n\\r\\nIn the [last blog post](https://easonoob.github.io/blog/intro-to-quantum-computing), we talked about the very basics of quantum computing, and tried a few examples with qiskit. In this post, we will try to build a QNN completely with PyTorch only, without quantum simulation / machine learning libraries like PennyLane or TorchQuantum, so we can know what really happens inside the simulation. Let\'s get started!\\r\\n\\r\\n## Prerequisites\\r\\n- Read and Understand the last post\\r\\n- Basic Python & PyTorch\\r\\n\\r\\n## Simulation\\r\\n\\r\\nImport necessary libraries:\\r\\n\\r\\n```python\\r\\nimport torch, torch.nn as nn, torch.nn.functional as F\\r\\nfrom typing import Union, List\\r\\nimport numpy as np\\r\\nfrom torchvision import datasets, transforms\\r\\nfrom torch.utils.data import DataLoader\\r\\nimport matplotlib.pyplot as plt\\r\\n```\\r\\n\\r\\nWe know a quantum state vector of a single qubit can be represented as $|\\\\psi\\\\rangle = \\\\alpha |0\\\\rangle + \\\\beta |1\\\\rangle$, and numerous qubits can be combined into a large state of $2^n$ propabilities. For the simulation, we will create a single large state vector $h$ which stores all qubits in the system (not very efficient but this is the easiest) with $h \\\\in \\\\mathbb{R}^{b \\\\times \\\\underbrace{2 \\\\times 2 \\\\times \\\\cdots \\\\times 2}_{n \\\\text{ times}}}$ which $b$ is batch size, $n$ is number of qubits so that for each batch, there are $2^n$ propabilities.\\r\\n\\r\\nTo apply the gate to a specific qubit in the state vector, we can simply permute the target qubit dimension to the back, then multiply it with the gate matrix. For double qubits gates, we can permute the control and target to the back, combine the two dimensions, multiply the gate matrix, and reshape back. Here is a function that applied the gate to the state:\\r\\n\\r\\n```python\\r\\ndef apply_gate(state, mat, wires: Union[int, List[int]]):\\r\\n \\"\\"\\"\\r\\n Apply the gate matrix/matrices to the state vector using torch.bmm method.\\r\\n \\r\\n Args:\\r\\n state (torch.Tensor): The state vector.\\r\\n mat (torch.Tensor): The gate matrix/matrices.\\r\\n wires (int or List[int]): Which qubit(s) the operation is applied to.\\r\\n \\r\\n Returns:\\r\\n torch.Tensor: The updated state vector.\\r\\n \\"\\"\\"\\r\\n # Handle input for single qubit as a list for uniformity\\r\\n if isinstance(wires, int):\\r\\n wires = [wires]\\r\\n \\r\\n # Ensure the matrix is on the same device and dtype as the state\\r\\n mat = mat.to(state.device).to(state.dtype)\\r\\n \\r\\n # Calculate the new order of dimensions for the state to match matrix multiplication needs\\r\\n num_qubits = len(state.shape) - 1\\r\\n permute_order = list(range(1, num_qubits + 1)) # Start from 1 to account for batch dimension\\r\\n for index, wire in enumerate(wires):\\r\\n permute_order.remove(wire + 1) # Remove wire from its current place\\r\\n permute_order.insert(index, wire + 1) # Insert wire right after the batch dimension\\r\\n\\r\\n # Permute the state tensor to bring the target wire dimensions next to the batch dimension\\r\\n permuted_state = state.permute([0] + permute_order) # Batch dimension remains the first\\r\\n reshaped_state = permuted_state.reshape(state.shape[0], -1, mat.size(-1))\\r\\n \\r\\n # Apply the gate using matrix multiplication\\r\\n new_state = torch.bmm(reshaped_state, mat) if len(mat.shape) == 3 else reshaped_state @ mat\\r\\n \\r\\n # Reshape and permute back to the original shape and order\\r\\n final_state = new_state.view(state.shape).permute(list(np.argsort([0] + permute_order)))\\r\\n \\r\\n return final_state\\r\\n```\\r\\n\\r\\nThe reason for the input to accept batched gate matrices is for the angle encoding later, which encodes inputs into the state.\\r\\n\\r\\n### Define Gate Matrices\\r\\n\\r\\nNow the gate matrix functions:\\r\\n\\r\\n```python\\r\\ndef h_matrix():\\r\\n return 1 / np.sqrt(2) * torch.tensor([[1, 1], [1, -1]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef cnot_matrix():\\r\\n return torch.tensor([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef pauli_x_matrix():\\r\\n return torch.tensor([[0, 1], [1, 0]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef pauli_y_matrix():\\r\\n return torch.tensor([[0, -1j], [1j, 0]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef pauli_z_matrix():\\r\\n return torch.tensor([[1, 0], [0, -1]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef rx_matrix(theta):\\r\\n return torch.tensor([[torch.cos(theta / 2), -1j * torch.sin(theta / 2)],\\r\\n [-1j * torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef ry_matrix(theta):\\r\\n return torch.tensor([[torch.cos(theta / 2), -torch.sin(theta / 2)],\\r\\n [torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef rz_matrix(theta):\\r\\n return torch.tensor([[torch.exp(-1j * theta / 2), 0],\\r\\n [0, torch.exp(1j * theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef u3_matrix(theta, phi, lam):\\r\\n return torch.tensor([[torch.cos(theta / 2), -torch.exp(1j * lam) * torch.sin(theta / 2)],\\r\\n [torch.exp(1j * phi) * torch.sin(theta / 2), torch.exp(1j * (phi + lam)) * torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef crx_matrix(theta):\\r\\n return torch.tensor([[1, 0, 0, 0],\\r\\n [0, 1, 0, 0],\\r\\n [0, 0, torch.cos(theta / 2), -1j * torch.sin(theta / 2)],\\r\\n [0, 0, -1j * torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef cry_matrix(theta):\\r\\n return torch.tensor([[1, 0, 0, 0],\\r\\n [0, 1, 0, 0],\\r\\n [0, 0, torch.cos(theta / 2), -torch.sin(theta / 2)],\\r\\n [0, 0, torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef crz_matrix(theta):\\r\\n return torch.tensor([[1, 0, 0, 0],\\r\\n [0, 1, 0, 0],\\r\\n [0, 0, torch.exp(-1j * theta / 2), 0],\\r\\n [0, 0, 0, torch.exp(1j * theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef cu3_matrix(theta, phi, lam):\\r\\n return torch.tensor([[1, 0, 0, 0],\\r\\n [0, 1, 0, 0],\\r\\n [0, 0, torch.cos(theta / 2), -torch.exp(1j * lam) * torch.sin(theta / 2)],\\r\\n [0, 0, torch.exp(1j * phi) * torch.sin(theta / 2), torch.exp(1j * (phi + lam)) * torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n```\\r\\n\\r\\nNow the Gate class, which stores the parameters (if any) and qubits:\\r\\n\\r\\n```python\\r\\nclass Gate(nn.Module):\\r\\n def __init__(self, gate_matrix_fn, wires: list, n_params: int):\\r\\n super(Gate, self).__init__()\\r\\n self.wires = wires\\r\\n self.n_params = n_params\\r\\n self.gate_matrix_fn = gate_matrix_fn\\r\\n self.params = nn.Parameter(torch.randn(n_params, dtype=torch.float32)).uniform_(-np.pi, np.pi) # Unifrom distribution between -pi and pi\\r\\n \\r\\n def forward(self, state):\\r\\n gate_matrix = self.gate_matrix_fn(*self.params)\\r\\n return apply_gate(state, gate_matrix, self.wires)\\r\\n```\\r\\n\\r\\n### Angle Encoding\\r\\n\\r\\nAngle encoding, as mentioned above, encodes the input tensor into the state vector using rotation gates (rx, ry, u3, etc).\\r\\n\\r\\n```python\\r\\nclass AngleEncoding(nn.Module):\\r\\n \\"\\"\\"\\r\\n Example functions list:\\r\\n [{\\"gate\\": \'rx\', \\"wires\\": 0, \\"input_idx\\": 0},\\r\\n {\\"gate\\": \'ry\', \\"wires\\": 1, \\"input_idx\\": 1},\\r\\n {\\"gate\\": \'rz\', \\"wires\\": 2, \\"input_idx\\": 2},]\\r\\n or\\r\\n [{\\"gate\\": \'u3\', \\"wires\\": 0, \\"input_idx\\": [0, 1, 2]},\\r\\n {\\"gate\\": \'rx\', \\"wires\\": 1, \\"input_idx\\": 1},\\r\\n {\\"gate\\": \'cu3\', \\"wires\\": [1, 2], \\"input_idx\\": [0, 1, 2]},]\\r\\n \\"\\"\\"\\r\\n def __init__(self, func_list):\\r\\n super().__init__()\\r\\n self.func_list = func_list\\r\\n\\r\\n def forward(self, state, x):\\r\\n for info in self.func_list:\\r\\n params = x[:, [info[\\"input_idx\\"]]] if len(x.shape) > 1 else x[info[\\"input_idx\\"]]\\r\\n gate = info[\\"gate\\"] + \'_matrix\'\\r\\n fn = globals()[gate] # Get the function from the globals\\r\\n mat = torch.stack([fn(*p) for p in params], dim=0) if len(x.shape) > 1 else fn(*params) # Gate matrix\\r\\n state = apply_gate(\\r\\n state,\\r\\n mat=mat,\\r\\n wires=info[\\"wires\\"],\\r\\n )\\r\\n return state\\r\\n```\\r\\n\\r\\n### Measurement\\r\\n\\r\\nFor the measurement, we will measure the expected values of all qubits based on a observable matrix of size $2^n \\\\times 2^n$, which typically is either Pauli-X, Pauli-Y, or Pauli-Z. Mathematically it is $\\\\langle\\\\psi|O|\\\\psi\\\\rangle$.\\r\\n\\r\\n```python\\r\\ndef measure_pauli_expectations(state, observable_matrix):\\r\\n num_qubits = len(state.shape) - 1\\r\\n batch_size = state.shape[0]\\r\\n expected_values = torch.empty((batch_size, num_qubits), dtype=state.real.dtype, device=state.device)\\r\\n observable_matrix = observable_matrix.to(state.device).to(state.dtype)\\r\\n\\r\\n # Compute the expectation value for each qubit\\r\\n for qubit in range(num_qubits):\\r\\n # Permute to bring the qubit of interest to the last position\\r\\n dims = list(range(1, num_qubits + 1))\\r\\n dims.append(dims.pop(qubit)) # Move the qubit index to the end\\r\\n permuted_state = state.permute([0] + dims)\\r\\n \\r\\n # Reshape to combine all other dimensions except the last two\\r\\n reshaped_state = permuted_state.reshape(batch_size, -1, 2)\\r\\n \\r\\n # Apply observable and calculate expectation value\\r\\n # Here we calculate for the current qubit\\r\\n measured_state = torch.matmul(reshaped_state, observable_matrix)\\r\\n probabilities = torch.matmul(measured_state, reshaped_state.transpose(-2, -1)).diagonal(dim1=-2, dim2=-1)\\r\\n expected_value = probabilities.sum(dim=-1) # Sum over the states to get the expectation\\r\\n\\r\\n # Store the computed expected value for the current qubit\\r\\n expected_values[:, qubit] = expected_value.real\\r\\n\\r\\n return expected_values\\r\\n```\\r\\n\\r\\n### Model\\r\\n\\r\\nWe will use the MNIST dataset for the testing. We will only use the first 5 numbers (0, 1, 2, 3, 4) and the image size will be reduced to $5 \\\\times 5$ to reduce complexity. The Variational Quantum Circuit (VQC) consists 4 blocks of single and double qubits parameterized gates.\\r\\n\\r\\n```python\\r\\nclass VQC(nn.Module):\\r\\n def __init__(self):\\r\\n super(VQC, self).__init__()\\r\\n self.n_wires = 5 # Number of qubits in the circuit\\r\\n self.encoding = AngleEncoding([\\r\\n {\\"input_idx\\": [0], \\"gate\\": \\"ry\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [1], \\"gate\\": \\"ry\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [2], \\"gate\\": \\"ry\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [3], \\"gate\\": \\"ry\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [4], \\"gate\\": \\"ry\\", \\"wires\\": [4]},\\r\\n {\\"input_idx\\": [5], \\"gate\\": \\"rz\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [6], \\"gate\\": \\"rz\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [7], \\"gate\\": \\"rz\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [8], \\"gate\\": \\"rz\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [9], \\"gate\\": \\"rz\\", \\"wires\\": [4]},\\r\\n {\\"input_idx\\": [10], \\"gate\\": \\"rx\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [11], \\"gate\\": \\"rx\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [12], \\"gate\\": \\"rx\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [13], \\"gate\\": \\"rx\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [14], \\"gate\\": \\"rx\\", \\"wires\\": [4]},\\r\\n {\\"input_idx\\": [15], \\"gate\\": \\"ry\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [16], \\"gate\\": \\"ry\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [17], \\"gate\\": \\"ry\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [18], \\"gate\\": \\"ry\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [19], \\"gate\\": \\"ry\\", \\"wires\\": [4]},\\r\\n {\\"input_idx\\": [20], \\"gate\\": \\"rz\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [21], \\"gate\\": \\"rz\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [22], \\"gate\\": \\"rz\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [23], \\"gate\\": \\"rz\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [24], \\"gate\\": \\"rz\\", \\"wires\\": [4]},\\r\\n ]) # Encode 16 features into 4 qubits\\r\\n \\r\\n layers = []\\r\\n for _ in range(4):\\r\\n layers.extend([\\r\\n Gate(cnot_matrix, [0, 1], 0),\\r\\n Gate(cnot_matrix, [1, 2], 0),\\r\\n Gate(cnot_matrix, [2, 3], 0),\\r\\n Gate(cnot_matrix, [3, 4], 0),\\r\\n Gate(cnot_matrix, [4, 0], 0),\\r\\n Gate(rx_matrix, [0], 1),\\r\\n Gate(rx_matrix, [1], 1),\\r\\n Gate(rx_matrix, [2], 1),\\r\\n Gate(rx_matrix, [3], 1),\\r\\n Gate(rx_matrix, [4], 1),\\r\\n Gate(cu3_matrix, [1, 0], 3),\\r\\n Gate(cu3_matrix, [2, 1], 3),\\r\\n Gate(cu3_matrix, [3, 2], 3),\\r\\n Gate(cu3_matrix, [4, 3], 3),\\r\\n Gate(cu3_matrix, [0, 4], 3),\\r\\n Gate(u3_matrix, [0], 3),\\r\\n Gate(u3_matrix, [1], 3),\\r\\n Gate(u3_matrix, [2], 3),\\r\\n Gate(u3_matrix, [3], 3),\\r\\n Gate(u3_matrix, [4], 3),\\r\\n ])\\r\\n self.qnn = nn.Sequential(*layers)\\r\\n \\r\\n def forward(self, x):\\r\\n state = torch.zeros(x.shape[0], 2**self.n_wires, dtype=torch.complex64, device=x.device).reshape(x.shape[0], 2, 2, 2, 2, 2)\\r\\n state[:, 0, 0, 0, 0, 0] = 1 # Initialize the state to |0001>\\r\\n state = self.encoding(state, x.view(x.shape[0], -1)) # Encode the input features\\r\\n state = self.qnn(state)\\r\\n measured = measure_pauli_expectations(state, pauli_z_matrix())\\r\\n return F.log_softmax(measured, dim=-1)\\r\\n```\\r\\n\\r\\n### Dataset\\r\\n\\r\\nWe will process the MNIST to include only first 5 digits and resize it to $5 \\\\times 5$.\\r\\n\\r\\n```python\\r\\nclass MNISTDigitsDataset(datasets.MNIST):\\r\\n def __init__(self, root, train=True, transform=None, target_transform=None, download=False):\\r\\n super().__init__(root, train=train, transform=transform, target_transform=target_transform, download=download)\\r\\n # Filter indices for digits 0 to 3\\r\\n indices = [i for i, label in enumerate(self.targets) if label in [0, 1, 2, 3, 4]]\\r\\n self.data = self.data[indices]\\r\\n self.targets = self.targets[indices]\\r\\n\\r\\n def __getitem__(self, index):\\r\\n with torch.no_grad():\\r\\n # Get the image and target label\\r\\n img, target = self.data[index], int(self.targets[index])\\r\\n \\r\\n # Convert image to PIL for transformations\\r\\n img = transforms.functional.to_pil_image(img)\\r\\n \\r\\n # Apply transformations if any\\r\\n if self.transform:\\r\\n img = self.transform(img)\\r\\n \\r\\n if self.target_transform:\\r\\n target = self.target_transform(target)\\r\\n \\r\\n return img, target\\r\\n\\r\\n def __len__(self):\\r\\n return len(self.data)\\r\\n\\r\\ntransform = transforms.Compose([\\r\\n transforms.Resize((5, 5)), # Resize the image to 5x5\\r\\n transforms.ToTensor() # Convert the image to a PyTorch tensor\\r\\n])\\r\\n\\r\\n# Initialize the dataset\\r\\ntrain_dataset = MNISTDigitsDataset(root=\'./data\', train=True, transform=transform, download=True)\\r\\nvalid_dataset = MNISTDigitsDataset(root=\'./data\', train=False, transform=transform, download=True)\\r\\n\\r\\n# Create the DataLoader\\r\\nbatch_size = 32\\r\\ntrain_dataloader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True)\\r\\nvalid_dataloader = DataLoader(valid_dataset, batch_size=batch_size, shuffle=False)\\r\\n```\\r\\n\\r\\n### Training Loop\\r\\n\\r\\n```python\\r\\ndevice = torch.device(\'cuda\' if torch.cuda.is_available() else \'cpu\')\\r\\nmodel = VQC().to(device)\\r\\n\\r\\nloss_fn = nn.NLLLoss()\\r\\noptimizer = torch.optim.Adam(model.parameters(), lr=0.01)\\r\\n\\r\\n# Training loop\\r\\nnum_epochs = 5\\r\\ntrain_losses = []\\r\\nvalid_losses = []\\r\\nvalid_accuracies = []\\r\\nfor epoch in range(num_epochs):\\r\\n for batch, (images, labels) in enumerate(train_dataloader):\\r\\n images, labels = images.to(device), labels.to(device)\\r\\n optimizer.zero_grad()\\r\\n outputs = model(images)\\r\\n loss = loss_fn(outputs, labels)\\r\\n loss.backward()\\r\\n optimizer.step()\\r\\n train_losses.append(loss.item())\\r\\n \\r\\n if (batch + 1) % 50 == 0:\\r\\n print(f\\"Epoch {epoch + 1}/{num_epochs}, Iteration: {batch+1}, Loss: {loss.item()}\\")\\r\\n if batch == 500:\\r\\n break # Stop early to speed up the training process\\r\\n \\r\\n # Validation loop\\r\\n model.eval()\\r\\n with torch.no_grad():\\r\\n total = 0\\r\\n correct = 0\\r\\n for batch, (images, labels) in enumerate(valid_dataloader):\\r\\n images, labels = images.to(device), labels.to(device)\\r\\n outputs = model(images)\\r\\n loss = loss_fn(outputs, labels)\\r\\n valid_losses.append(loss.item())\\r\\n \\r\\n _, predicted = torch.max(outputs, 1)\\r\\n total += labels.size(0)\\r\\n correct += (predicted == labels).sum().item()\\r\\n\\r\\n if batch == 100:\\r\\n break # Stop early to speed up the validation process\\r\\n \\r\\n accuracy = correct / total\\r\\n valid_accuracies.append(accuracy)\\r\\n print(f\\"Validation accuracy: {accuracy}, Loss: {loss.item()}\\")\\r\\n model.train()\\r\\n```\\r\\n\\r\\nAnd finally plot the result:\\r\\n\\r\\n```python\\r\\n# plot\\r\\nplt.plot(train_losses, label=\'Training loss\')\\r\\nplt.plot(valid_losses, label=\'Validation loss\')\\r\\nplt.xlabel(\'Iterations\')\\r\\nplt.ylabel(\'Loss\')\\r\\nplt.legend()\\r\\nplt.title(\'Training and Validation Loss\')\\r\\nplt.show()\\r\\n\\r\\nplt.plot(valid_accuracies)\\r\\nplt.xlabel(\'Iterations\')\\r\\nplt.ylabel(\'Accuracy\')\\r\\nplt.title(\'Validation Accuracy\')\\r\\nplt.show()\\r\\n```"},{"id":"intro-to-quantum-computing","metadata":{"permalink":"/blog/intro-to-quantum-computing","source":"@site/blog/2024-1-5-intro-to-quantum-computing/index.md","title":"Introduction to Quantum Computing","description":"The basics of quantum computing and some hands-on trying.","date":"2024-01-05T00:00:00.000Z","tags":[{"label":"beginners","permalink":"/blog/tags/beginners"},{"label":"quantum","permalink":"/blog/tags/quantum"},{"label":"qiskit","permalink":"/blog/tags/qiskit"},{"label":"pytorch","permalink":"/blog/tags/pytorch"},{"label":"tutorial","permalink":"/blog/tags/tutorial"}],"readingTime":9.28,"hasTruncateMarker":true,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"intro-to-quantum-computing","title":"Introduction to Quantum Computing","authors":"eason","tags":["beginners","quantum","qiskit","pytorch","tutorial"]},"unlisted":false,"prevItem":{"title":"Introduction to Quantum Neural Networks","permalink":"/blog/intro-to-qnn"},"nextItem":{"title":"Introduction to PyTorch","permalink":"/blog/intro-to-pytorch"}},"content":"The basics of quantum computing and some hands-on trying.\\r\\n\\r\\n\x3c!--truncate--\x3e\\r\\n\\r\\n## Prerequisites\\r\\n- Basic Maths — matrix multiplications\\r\\n- Basic quantum mechanics concepts — Superposition, Wave-Particle Duality, the Uncertainty Principle, and Entanglement\\r\\n- Basic Python\\r\\n- Imagination power\\r\\n\\r\\n## Quantum Mechanics\\r\\n> \u201cThe mathematical framework of quantum theory has passed countless successful tests and is now universally accepted as a consistent and accurate description of all atomic phenomena.\u201d ~ Erwin Schr\xf6dinger\\r\\n\\r\\nWe will not be talking about the advanced maths or concepts of quantum mechanics in this blog post, such as the Uncertainty Principle or the Schr\xf6dinger Equation, but I\'ll assume you know the main principles of Quantum Mechanics, including Superposition, Wave-Particle Duality, the Uncertainty Principle, and Entanglement. The concept of qubits and quantum circuits gates will be explained below.\\r\\n\\r\\n### Qubits\\r\\nIn normal semiconductor computers, each \\"bit\\" can only represent two values: 0 and 1, which can be used in calculations as low and high voltage. However, in quantum computers, \\"qubits\\" (quantum bit) are used. Now instead of representing only 0 **or** 1, it can now represent 0 **and** 1 simultaneously. It carries a \\"state\\" $|\\\\psi\\\\rangle$, which is a vector defined as followed in a qubit:\\r\\n\\r\\n$$\\r\\n|\\\\psi\\\\rangle = \\\\alpha |0\\\\rangle + \\\\beta |1\\\\rangle\\r\\n$$\\r\\n\\r\\nWhere\\r\\n\\r\\n$$\\r\\n|\\\\alpha|^2 + |\\\\beta|^2 = 1\\r\\n$$\\r\\n\\r\\n$\\\\alpha$ and $\\\\beta$ represents the **probabilities** or the qubit in the $|0\\\\rangle$ and $|1\\\\rangle$ states respectively, and are **complex numbers**.\\r\\n\\r\\nNow, if we have two qubits entangled, we can represent $2^2 = 4$ states ($00, 01, 10, 11$), each associated with a probability.\\r\\n\\r\\n$$\\r\\n|\\\\psi\\\\rangle = c_1 |0\\\\rangle + c_2 |1\\\\rangle\\r\\n$$\\r\\n$$\\r\\n|\\\\phi\\\\rangle = c_3 |0\\\\rangle + c_4 |1\\\\rangle\\r\\n$$\\r\\n$$\\r\\n|combined\\\\rangle = c_1c_3 |00\\\\rangle + c_1c_4 |01\\\\rangle + c_2c_3 |10\\\\rangle + c_2c_4 |11\\\\rangle\\r\\n$$\\r\\n\\r\\nThe power of quantum computing is you can represent $2^n$ states if you have $n$ qubits, which is an exponential growth. For example, if you have 20 qubits, you can represent $2^{20} = 1048576$ states, but in a classical computer, it is only 20! If you have 266 qubits, you can represent nearly $10^{80}$ states, which is about the number of atoms in the observable universe! Every single \\"operation\\" you perform on these qubits instantly affects its $2^n$ states. Now we will talk about these \\"operations\\" — quantum circuit gates.\\r\\n\\r\\n### Gates\\r\\n\\r\\nTo visualize a single qubit, you can use the Bloch Sphere:\\r\\n![Bloch Sphere](bloch_sphere.png)\\r\\nThe z-axis means the probability in being measured in $|0\\\\rangle$ and $|1\\\\rangle$. X-axis and y-axis are also similar.\\r\\n\\r\\n:::info\\r\\n$$\\r\\n|+\\\\rangle = \\\\frac{1}{\\\\sqrt{2}}(|0\\\\rangle + |1\\\\rangle)\\r\\n$$\\r\\n$$\\r\\n|-\\\\rangle = \\\\frac{1}{\\\\sqrt{2}}(|0\\\\rangle - |1\\\\rangle)\\r\\n$$\\r\\n$$\\r\\n|+i\\\\rangle = \\\\frac{1}{\\\\sqrt{2}}(|0\\\\rangle - i|1\\\\rangle)\\r\\n$$\\r\\n$$\\r\\n|-i\\\\rangle = \\\\frac{1}{\\\\sqrt{2}}(|0\\\\rangle - i|1\\\\rangle)\\r\\n$$\\r\\n:::\\r\\n\\r\\nQuantum circuit gates can be visualized as rotating the state (the red arrow) in the bloch sphere. Here are some examples:\\r\\n\\r\\n1. **Pauli-X Gate (NOT Gate)**:\\r\\n - Rotation: $$ \\\\pi $$ radians (180 degrees) around the X-axis.\\r\\n - Effect: Transforms the state $$ |0\\\\rangle $$ to $$ |1\\\\rangle $$ and vice versa. On the Bloch sphere, it flips the state from the north pole to the south pole and vice versa.\\r\\n\\r\\n2. **Pauli-Y Gate**:\\r\\n - Rotation: $$ \\\\pi $$ radians (180 degrees) around the Y-axis.\\r\\n - Effect: Applies a complex phase and swaps the states $$ |0\\\\rangle $$ and $$ |1\\\\rangle $$. For example, $$ |0\\\\rangle $$ becomes $$ i|1\\\\rangle $$ and $$ |1\\\\rangle $$ becomes $$ -i|0\\\\rangle $$.\\r\\n\\r\\n3. **Pauli-Z Gate**:\\r\\n - Rotation: $$ \\\\pi $$ radians (180 degrees) around the Z-axis.\\r\\n - Effect: Leaves the state $$ |0\\\\rangle $$ unchanged and adds a phase of $$ \\\\pi $$ (equivalent to a factor of -1) to the state $$ |1\\\\rangle $$.\\r\\n\\r\\n4. **Hadamard Gate (H Gate)**:\\r\\n - Rotation: This gate performs a more complex transformation, equivalent to rotating around the axis at 45 degrees from both X and Z axes, followed by a $$ \\\\pi $$ radian rotation around the Y-axis.\\r\\n - Effect: Creates superpositions from basis states, turning $$ |0\\\\rangle $$ into $$ \\\\frac{|0\\\\rangle + |1\\\\rangle}{\\\\sqrt{2}} $$ and $$ |1\\\\rangle $$ into $$ \\\\frac{|0\\\\rangle - |1\\\\rangle}{\\\\sqrt{2}} $$.\\r\\n\\r\\n5. **S Gate (Phase Gate)**:\\r\\n - Rotation: $$ \\\\frac{\\\\pi}{2} $$ radians (90 degrees) around the Z-axis.\\r\\n - Effect: Leaves the state $$ |0\\\\rangle $$ unchanged and multiplies the state $$ |1\\\\rangle $$ by $$ i $$.\\r\\n\\r\\n6. **T Gate**:\\r\\n - Rotation: $$ \\\\frac{\\\\pi}{4} $$ radians (45 degrees) around the Z-axis.\\r\\n - Effect: Leaves the state $$ |0\\\\rangle $$ unchanged and multiplies the state $$ |1\\\\rangle $$ by $$ e^{i\\\\pi/4} $$, which is a more subtle phase shift than the S gate.\\r\\n\\r\\nAnd some parameterized gates:\\r\\n\\r\\n7. **RX Gate**:\\r\\n - Rotation: $$\\\\theta$$ radians around the X-axis. It can be represented as a matrix multiplication between the unitary gate matrix and the quantum states, the gate matrix is:\\r\\n\\r\\n$$\\r\\nR_x(\\\\theta) = \\\\begin{bmatrix}\\r\\n\\\\cos\\\\left(\\\\frac{\\\\theta}{2}\\\\right) & -i\\\\sin\\\\left(\\\\frac{\\\\theta}{2}\\\\right) \\\\\\\\\\r\\n-i\\\\sin\\\\left(\\\\frac{\\\\theta}{2}\\\\right) & \\\\cos\\\\left(\\\\frac{\\\\theta}{2}\\\\right)\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\n\\r\\n8. **RY Gate**:\\r\\n - Rotation: $$\\\\theta$$ radians around the y-axis:\\r\\n$$\\r\\nR_y(\\\\theta) = \\\\begin{bmatrix}\\r\\n\\\\cos\\\\left(\\\\frac{\\\\theta}{2}\\\\right) & -\\\\sin\\\\left(\\\\frac{\\\\theta}{2}\\\\right) \\\\\\\\\\r\\n\\\\sin\\\\left(\\\\frac{\\\\theta}{2}\\\\right) & \\\\cos\\\\left(\\\\frac{\\\\theta}{2}\\\\right)\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\n\\r\\n8. **RZ Gate**:\\r\\n - Rotation: $$\\\\theta$$ radians around the z-axis:\\r\\n$$\\r\\nR_z(\\\\theta) = \\\\begin{bmatrix}\\r\\ne^{-i\\\\theta/2} & 0 \\\\\\\\\\r\\n0 & e^{i\\\\theta/2}\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\n\\r\\nAnd much more.\\r\\n\\r\\n:::danger[INFO]\\r\\nEvery gate can be represented as an unitary gate matrix, e.g. the Hadamard Gate:\\r\\n$$\\r\\nH = \\\\frac{1}{\\\\sqrt{2}}\\\\begin{bmatrix}\\r\\n1 & 1 \\\\\\\\\\r\\n1 & -1\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\n:::\\r\\n\\r\\nAlso, there are double-qubits gate, for example the CNOT (Controlled-NOT) gate:\\r\\n$$\\r\\nCNOT = \\\\begin{bmatrix}\\r\\n1 & 0 & 0 & 0 \\\\\\\\\\r\\n0 & 1 & 0 & 0 \\\\\\\\\\r\\n0 & 0 & 0 & 1 \\\\\\\\\\r\\n0 & 0 & 1 & 0\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\nControlled gates mean if the first qubit is $|1\\\\rangle$, then the gate (NOT in this case) on second qubit will be performed. There are even triple-qubits gates, like the Toffoli gate (aka CCNOT), which has a $2^n \\\\times 2^n = 8 \\\\times 8$ size gate matrix.\\r\\n\\r\\nIf you have a quantum states, say 10 qubits, and you want to apply a specific gate on a specific qubit, you can use the Kronecker product to construct a $2^n \\\\times 2^n$ gate matrix and apply it to the quantum states, for example you want to apply the Hadamard gate on the 4th qubit:\\r\\n\\r\\n$$\\r\\n|\\\\psi_{t+1}\\\\rangle = |\\\\psi_t\\\\rangle \\\\times (I \\\\otimes I \\\\otimes I \\\\otimes \\\\frac{1}{\\\\sqrt{2}}\\\\begin{bmatrix}1 & 1 \\\\\\\\ 1 & -1\\\\end{bmatrix} \\\\otimes I \\\\otimes I \\\\otimes I \\\\otimes I \\\\otimes I \\\\otimes I)\\r\\n$$\\r\\n\\r\\n:::tip\\r\\n$I$ is the identity matrix, i.e. $\\\\begin{bmatrix}1 & 0 \\\\\\\\ 0 & 1\\\\end{bmatrix}$\\r\\n:::\\r\\n\\r\\nThese quantum gates are crucial in constructing quantum circuits for algorithms, where each type of gate contributes to manipulating the qubit\'s state in a controlled manner to achieve various computational goals.\\r\\n\\r\\n## Simulation with Qiskit\\r\\n\\r\\nQiskit is an open-source framework for quantum computing. It provides the tools for creating quantum circuits, simulating them, and running them on real quantum hardware through IBM\'s cloud services.\\r\\n\\r\\n### Setting Up Your Environment\\r\\n\\r\\nTo start using Qiskit, make sure Python is installed on your machine, then install Qiskit and Qiskit Aer, which includes simulators that run on your local machine.\\r\\n\\r\\n```bash\\r\\npip install qiskit qiskit-aer pylatexenc\\r\\n```\\r\\n\\r\\n### Single Qubit Operations\\r\\n\\r\\n#### Building the Circuit\\r\\n\\r\\nWe\'ll begin with a basic single-qubit circuit to demonstrate sequential gate operations that include rotations and a phase shift.\\r\\n\\r\\n```python\\r\\nfrom qiskit import QuantumCircuit, transpile\\r\\nfrom qiskit_aer import Aer\\r\\nfrom qiskit.visualization import plot_bloch_multivector\\r\\n\\r\\n# Initialize a Quantum Circuit with 1 qubit\\r\\nqc_single = QuantumCircuit(1)\\r\\n\\r\\n# Apply rotation around the X-axis\\r\\nqc_single.rx(3.14159 / 4, 0) # Pi/4 rotation\\r\\n\\r\\n# Apply rotation around the Y-axis\\r\\nqc_single.ry(3.14159 / 2, 0) # Pi/2 rotation\\r\\n\\r\\n# Apply a Z gate\\r\\nqc_single.z(0)\\r\\n\\r\\n# Visualize the circuit\\r\\nprint(\\"Single Qubit Circuit:\\")\\r\\nprint(qc_single.draw(output=\'mpl\'))\\r\\n```\\r\\n\\r\\n#### Calculating the Expected State Vector\\r\\n\\r\\nThe state vector undergoes a rotation by $$\\\\pi/4$$ radians around the X-axis, followed by $$\\\\pi/2$$ around the Y-axis, and finally, a phase shift due to the Z gate.\\r\\n\\r\\n#### Simulation and Output\\r\\n\\r\\n```python\\r\\n# Prepare the simulator\\r\\nsimulator = Aer.get_backend(\'statevector_simulator\')\\r\\n\\r\\n# Transpile the circuit for the simulator\\r\\ntranspiled_qc = transpile(qc_single, simulator)\\r\\n\\r\\n# Run the simulation\\r\\njob = simulator.run(transpiled_qc)\\r\\nresult = job.result()\\r\\n\\r\\n# Get the final state vector\\r\\nstatevector = result.get_statevector()\\r\\nprint(statevector)\\r\\n\\r\\n# Plot the state on the Bloch sphere\\r\\nplot_bloch_multivector(statevector)\\r\\n```\\r\\n\\r\\n### Multi-Qubit Operations\\r\\n\\r\\n#### Building the Circuit\\r\\n\\r\\nWe will construct a five-qubit circuit with a combination of entanglement, rotations, and phase shifts to demonstrate the interplay of different quantum gates.\\r\\n\\r\\n```python\\r\\nfrom qiskit import QuantumCircuit, transpile\\r\\nfrom qiskit_aer import Aer\\r\\nfrom qiskit.visualization import plot_bloch_multivector\\r\\nfrom math import pi\\r\\n\\r\\n# Initialize a Quantum Circuit with 5 qubits\\r\\nqc_multi = QuantumCircuit(5)\\r\\n\\r\\n# Apply a Hadamard gate to qubit 0\\r\\nqc_multi.h(0)\\r\\n\\r\\n# Apply a CNOT gate between qubit 0 and qubit 1\\r\\nqc_multi.cx(0, 1)\\r\\n\\r\\n# Apply a rotation around the X-axis by pi/2 on qubit 1\\r\\nqc_multi.rx(pi / 2, 1)\\r\\n\\r\\n# Apply a T gate to qubit 2\\r\\nqc_multi.t(2)\\r\\n\\r\\n# Apply a CNOT gate between qubit 1 and qubit 2\\r\\nqc_multi.cx(1, 2)\\r\\n\\r\\n# Apply a rotation around the Z-axis by pi/4 on qubit 3\\r\\nqc_multi.rz(pi / 4, 3)\\r\\n\\r\\n# Apply a Hadamard gate to qubit 4\\r\\nqc_multi.h(4)\\r\\n\\r\\n# Apply a CNOT gate between qubit 4 and qubit 3\\r\\nqc_multi.cx(4, 3)\\r\\n\\r\\n# Apply a CNOT gate between qubit 1 and qubit 4\\r\\nqc_multi.cx(1, 4)\\r\\n\\r\\n# Visualize the Circuit\\r\\nprint(\\"Five-Qubit Circuit:\\")\\r\\nprint(qc_multi.draw(output=\'mpl\'))\\r\\n```\\r\\n\\r\\n#### Calculating the Expected State Vector\\r\\n\\r\\nNow let\'s calculate the expected state vector after applying the specified sequence of gates:\\r\\n\\r\\n1. **Initial State**: All qubits start in the state $|00000\\\\rangle$.\\r\\n\\r\\n2. **After $ H(0) $**: Creates a superposition on qubit 0.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + |10000\\\\rangle)$\\r\\n\\r\\n3. **After $ \\\\text{CNOT}(0, 1) $**: Entangles qubits 0 and 1.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + |11000\\\\rangle)$\\r\\n\\r\\n4. **After $ \\\\text{RX}(1, \\\\pi/2) $**: Applies a $ \\\\pi/2 $ rotation on qubit 1, transforming its basis states.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + i|11000\\\\rangle)$\\r\\n\\r\\n5. **After $ T(2) $**: Adds a phase of $ \\\\pi/4 $ to the state of qubit 2.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + ie^{i\\\\pi/4}|11000\\\\rangle)$\\r\\n\\r\\n6. **After $ \\\\text{CNOT}(1, 2) $**: Conditionally flips qubit 2 based on qubit 1.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + ie^{i\\\\pi/4}|11100\\\\rangle)$\\r\\n\\r\\n7. **After $ \\\\text{RZ}(3, \\\\pi/4) $**: Adds a phase of $ \\\\pi/4 $ to qubit 3.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + ie^{i\\\\pi/4}|11100\\\\rangle)$ (no change in basis states, just a phase on the amplitude if qubit 3 were in state |1|)\\r\\n\\r\\n8. **After $ H(4) $**: Creates a superposition on qubit 4.\\r\\n $\\\\frac{1}{2} (|00000\\\\rangle + |00001\\\\rangle + ie^{i\\\\pi/4}|11100\\\\rangle + ie^{i\\\\pi/4}|11101\\\\rangle)$\\r\\n\\r\\n9. **After $ \\\\text{CNOT}(4, 3) $**: Conditionally flips qubit 3 based on qubit 4.\\r\\n $\\\\frac{1}{2} (|00000\\\\rangle + |00001\\\\rangle + ie^{i\\\\pi/4}|11110\\\\rangle + ie^{i\\\\pi/4}|11111\\\\rangle)$\\r\\n\\r\\n10. **After $ \\\\text{CNOT}(1, 4) $**: Conditionally flips qubit 4 based on qubit 1.\\r\\n $\\\\frac{1}{2} (|00000\\\\rangle + |00001\\\\rangle + ie^{i\\\\pi/4}|11010\\\\rangle + ie^{i\\\\pi/4}|11011\\\\rangle)$\\r\\n\\r\\n#### Simulation and Output\\r\\n\\r\\n```python\\r\\n# Prepare the simulator\\r\\nsimulator = Aer.get_backend(\'statevector_simulator\')\\r\\n\\r\\n# Transpile the circuit for the simulator\\r\\ntranspiled_qc = transpile(qc_multi, simulator)\\r\\n\\r\\n# Run the simulation\\r\\njob = simulator.run(transpiled_qc)\\r\\nresult = job.result()\\r\\n\\r\\n# Get the final state vector\\r\\nstatevector = result.get_statevector()\\r\\nprint(statevector)\\r\\n\\r\\n# Plot the state on the Bloch sphere\\r\\nplot_bloch_multivector(statevector)\\r\\n```\\r\\n\\r\\n## Tasks you may do\\r\\n1. Implement Shor\'s Algorithm for finding the prime factors of an integer.\\r\\n2. Implement Grover\'s Algorithm for an unstructured search that finds with high probability the unique input to a black box function that produces a particular output value."},{"id":"intro-to-pytorch","metadata":{"permalink":"/blog/intro-to-pytorch","source":"@site/blog/2023-12-13-intro-to-pytorch/index.md","title":"Introduction to PyTorch","description":"This blog post will be about some basic introductions to PyTorch, including tensors, and how to train your own model in PyTorch.","date":"2023-12-13T00:00:00.000Z","tags":[{"label":"beginners","permalink":"/blog/tags/beginners"},{"label":"nn","permalink":"/blog/tags/nn"},{"label":"pytorch","permalink":"/blog/tags/pytorch"},{"label":"tutorial","permalink":"/blog/tags/tutorial"},{"label":"tired","permalink":"/blog/tags/tired"}],"readingTime":5.835,"hasTruncateMarker":true,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"intro-to-pytorch","title":"Introduction to PyTorch","authors":"eason","tags":["beginners","nn","pytorch","tutorial","tired"]},"unlisted":false,"prevItem":{"title":"Introduction to Quantum Computing","permalink":"/blog/intro-to-quantum-computing"},"nextItem":{"title":"The Most Basics of Neural Networks","permalink":"/blog/basic-of-nn"}},"content":"This blog post will be about some basic introductions to PyTorch, including tensors, and how to train your own model in PyTorch.\\r\\n\\r\\n\x3c!--truncate--\x3e\\r\\n\\r\\n## Prerequisites\\r\\n- Basic Maths\\r\\n- Basic Python\\r\\n- Common Sense\\r\\n\\r\\n## Aims\\r\\n1.\\tUnderstand tensors\\r\\n2.\\tUnderstand the steps to build and train a model in PyTorch\\r\\n\\r\\n## Introduction\\r\\n> \u201cArtificial Intelligence, deep learning, machine learning \u2014 whatever you\'re doing if you don\'t understand it \u2014 learn it. Because otherwise you\'re going to be a dinosaur within 3 years.\u201d ~ Mark Cuban.\\r\\n\\r\\n## Tensors\\r\\n[https://pytorch.org/tutorials/beginner/basics/tensorqs_tutorial.html](https://pytorch.org/tutorials/beginner/basics/tensorqs_tutorial.html)\\r\\n\\r\\nTensors are specialized arrays or matrices. It can have as many dimensions as you want. We use tensors to encode the data in the PyTorch, as well as the model parameters. Specifically, if you perform operations on a PyTorch tensor (e.g. addition, multiplication), your action will be saved into PyTorch\u2019s built-in dynamic computation graph, which is necessary for model backpropagation in training.\\r\\n\\r\\nHere\u2019s an example of some tensors: \\r\\n\\r\\n```python\\r\\nimport torch\\r\\n\\r\\n# Create a tensor from a list/array:\\r\\n\\r\\ndata1 = [0, 1, 2, 3, 4, 5] # 1D array\\r\\ndata2 = [[0, 1], [2, 3], [4, 5]] # 2D array\\r\\n\\r\\ntensor1 = torch.tensor(data1)\\r\\ntensor2 = torch.tensor(data2)\\r\\n\\r\\nprint(tensor1.shape) # torch.Size([6])\\r\\nprint(tensor2.shape) # torch.Size([3, 2])\\r\\n\\r\\n# Create a tensor filled with zeros or ones:\\r\\n\\r\\nzeros_tensor = torch.zeros(3, 5, 4, 2, 1, 4) # A 6D tensor\\r\\nones_tensor = torch.ones(3, 5)\\r\\n\\r\\n# Create a random tensor from a specified shape:\\r\\n\\r\\nrandom_tensor1 = torch.randn(10, 20) # A 10 by 20 tensor with normal distribution\\r\\nprint(random_tensor1.shape) # torch.Size([10, 20])\\r\\nprint(random_tensor1[0, :10]) # You can use python array index slicing\\r\\n\\r\\nrandom_tensor2 = torch.randint(0, 100, (5, 10)) # 5 by 10 tensor with integer values ranging from 0 to 100\\r\\nprint(random_tensor2[0, 3:10])\\r\\n\\r\\n# Attributes of a tensor:\\r\\n\\r\\nprint(tensor1.shape)\\r\\nprint(tensor1.dtype) # data type, e.g. float32, int64, float64, Bfloat16\\r\\nprint(tensor1.device) # device the tensor is stored on, e.g. cpu, cuda\\r\\n```\\r\\n\\r\\n## Training a Simple Model in PyTorch\\r\\n\\r\\nThe steps of training a model in PyTorch includes:\\r\\n1.\\tFind a dataset that suits your problem, download it, and create a dataloader.\\r\\n2.\\tDefine your model, you can create your own model module using `nn.Module`.\\r\\n3.\\tDefine your loss function (from `torch.nn`), optimizers (from `torch.optim`), etc.\\r\\n4.\\tDefine your training loop, it can be a function that does a single step and write a loop, or just simply a training loop.\\r\\n5.\\tStart training!\\r\\n\\r\\nFor this example, we are going to use the MNIST dataset, which is built-in in PyTorch, making it very easy to download and use.\\r\\n\\r\\nFirst import the necessary libraries:\\r\\n```python\\r\\nimport torch\\r\\nfrom torch import nn\\r\\nfrom torch.utils.data import DataLoader\\r\\nfrom torchvision import datasets\\r\\nfrom torchvision.transforms import ToTensor\\r\\n```\\r\\n\\r\\n### Finding and defining your dataset\\r\\n\\r\\nPyTorch offers domain-specific libraries such as TorchText, TorchVision, and TorchAudio, all of which include datasets. For this tutorial, we will be using a TorchVision dataset.\\r\\n\\r\\nThe `torchvision.datasets` module contains `Dataset` objects for many real-world vision data like CIFAR, COCO. In this tutorial, we use the FashionMNIST dataset. Every TorchVision `Dataset` includes two arguments: `transform` and `target_transform` to modify the samples and labels respectively.\\r\\n\\r\\n```python\\r\\n# Download training data from the MNIST dataset.\\r\\ntraining_data = datasets.FashionMNIST(\\r\\n root=\\"data\\",\\r\\n train=True,\\r\\n download=True,\\r\\n transform=ToTensor(), # Convert to PyTorch tensor.\\r\\n)\\r\\n\\r\\n# Download test data from the MNIST dataset.\\r\\ntest_data = datasets.FashionMNIST(\\r\\n root=\\"data\\",\\r\\n train=False,\\r\\n download=True,\\r\\n transform=ToTensor(),\\r\\n)\\r\\n```\\r\\n\\r\\nWe pass the `Dataset` as an argument to `DataLoader`. This wraps an iterable over our dataset, and supports automatic batching, sampling, shuffling and multiprocess data loading. Here we define a batch size of 64, i.e. each element in the dataloader iterable will return a batch of 64 features and labels.\\r\\n\\r\\n```python\\r\\nbatch_size = 64\\r\\n\\r\\n# Create data loaders.\\r\\ntrain_dataloader = DataLoader(training_data, batch_size=batch_size)\\r\\ntest_dataloader = DataLoader(test_data, batch_size=batch_size)\\r\\n\\r\\nfor X, y in test_dataloader:\\r\\n print(f\\"Shape of X [N, C, H, W]: {X.shape}\\") # N, C, H, W stands for Batch Size, Channel Size, Height, and Width\\r\\n print(f\\"Shape of y: {y.shape} {y.dtype}\\")\\r\\n break\\r\\n```\\r\\n\\r\\n### Create the model\\r\\n\\r\\nTo define a neural network in PyTorch, we create a class that inherits from nn.Module. We define the layers of the network in the `__init__` function and specify how data will pass through the network in the forward function. To accelerate operations in the neural network, we move it to the GPU (`cuda`) or MPS if available.\\r\\n\\r\\n```python\\r\\n# Get cpu, gpu (cuda) device for training.\\r\\ndevice = (\\r\\n \\"cuda\\" if torch.cuda.is_available() else \\"cpu\\"\\r\\n)\\r\\nprint(f\\"Using {device} device\\")\\r\\n\\r\\n# Define model\\r\\nclass NeuralNetwork(nn.Module):\\r\\n def __init__(self):\\r\\n super().__init__()\\r\\n self.flatten = nn.Flatten() # Flattens to (Batch Size, Channel Size * Height * Width), from a 4D tensor to a 2D tensor\\r\\n self.linear_relu_stack = nn.Sequential(\\r\\n nn.Linear(28*28, 512), # Fully-connected hidden layer\\r\\n nn.ReLU(), # Activation Function\\r\\n nn.Linear(512, 512),\\r\\n nn.ReLU(),\\r\\n nn.Linear(512, 10)\\r\\n ) # When `linear_relu_stack` is called, it will run all the modules inside in order.\\r\\n\\r\\n def forward(self, x):\\r\\n x = self.flatten(x) # flatten to 2D, same as x.view(x.size(0), -1)\\r\\n logits = self.linear_relu_stack(x) # the nn.Sequential instance\\r\\n return logits\\r\\n\\r\\n# Create an instance\\r\\nmodel = NeuralNetwork().to(device)\\r\\nprint(model)\\r\\n```\\r\\n\\r\\n[Learn More About Building Neural Networks in PyTorch Here](https://pytorch.org/tutorials/beginner/basics/buildmodel_tutorial.html)\\r\\n\\r\\n### Define the Loss Function and the Optimizer\\r\\n\\r\\nWe are using the Cross Entropy Loss loss function and the Stochastic Gradient Descent (SGD) optimizer for training this model.\\r\\n\\r\\n```python\\r\\nloss_fn = nn.CrossEntropyLoss()\\r\\noptimizer = torch.optim.SGD(model.parameters(), lr=1e-3)\\r\\n```\\r\\n\\r\\n### Define the training loop\\r\\n\\r\\nFirst we define the function to train a single step:\\r\\n\\r\\n```python\\r\\ndef train(dataloader, model, loss_fn, optimizer):\\r\\n size = len(dataloader.dataset)\\r\\n model.train()\\r\\n for batch, (X, y) in enumerate(dataloader):\\r\\n X, y = X.to(device), y.to(device) # Move tensors to cuda if available\\r\\n\\r\\n # Compute prediction error\\r\\n pred = model(X) # Forward pass\\r\\n loss = loss_fn(pred, y) # Compute loss\\r\\n\\r\\n # Backpropagation\\r\\n loss.backward() # Compute gradients\\r\\n optimizer.step() # Update parameters\\r\\n optimizer.zero_grad() # Zero the gradients\\r\\n\\r\\n if batch % 100 == 0:\\r\\n loss, current = loss.item(), (batch + 1) * len(X)\\r\\n print(f\\"loss: {loss:>7f} [{current:>5d}/{size:>5d}]\\")\\r\\n```\\r\\n\\r\\nThen a function to evaluate (or validate). The goal of this is to check the model\u2019s performance against the test dataset to ensure it is learning, and monitor if it is overfitting.\\r\\n\\r\\n```python\\r\\ndef test(dataloader, model, loss_fn):\\r\\n size = len(dataloader.dataset)\\r\\n num_batches = len(dataloader)\\r\\n model.eval()\\r\\n test_loss, correct = 0, 0\\r\\n with torch.no_grad():\\r\\n for X, y in dataloader:\\r\\n X, y = X.to(device), y.to(device)\\r\\n pred = model(X)\\r\\n test_loss += loss_fn(pred, y).item()\\r\\n correct += (pred.argmax(1) == y).type(torch.float).sum().item()\\r\\n test_loss /= num_batches\\r\\n correct /= size\\r\\n print(f\\"Test Error: \\\\n Accuracy: {(100*correct):>0.1f}%, Avg loss: {test_loss:>8f} \\\\n\\")\\r\\n```\\r\\n\\r\\nThe training process is conducted over several iterations (epochs) that go over the entire training dataset. During each epoch, the model learns parameters to make better predictions. We print the model\u2019s accuracy and loss at each epoch; we\u2019d like to see the accuracy increase and the loss decrease with every epoch.\\r\\n\\r\\n```python\\r\\nepochs = 5\\r\\nfor t in range(epochs):\\r\\n print(f\\"Epoch {t+1}\\\\n-------------------------------\\")\\r\\n train(train_dataloader, model, loss_fn, optimizer)\\r\\n test(test_dataloader, model, loss_fn)\\r\\nprint(\\"Done!\\")\\r\\n```\\r\\n\\r\\n[Read More About Model Training Here](https://pytorch.org/tutorials/beginner/basics/optimization_tutorial.html)\\r\\n\\r\\n## Tasks\\r\\n\\r\\n1. Plot some graphs to show the training loss, validation loss, and validation accuracy over step.\\r\\n2. Experiment with different learning rate, batch size, and model architecture, how does it affect the results?"},{"id":"basic-of-nn","metadata":{"permalink":"/blog/basic-of-nn","source":"@site/blog/2023-11-13-basic-of-nn/index.md","title":"The Most Basics of Neural Networks","description":"This blog post will be about the most basics of neural networks, for absolute beginners.","date":"2023-11-13T00:00:00.000Z","tags":[{"label":"beginners","permalink":"/blog/tags/beginners"},{"label":"nn","permalink":"/blog/tags/nn"},{"label":"tutorial","permalink":"/blog/tags/tutorial"},{"label":"tired","permalink":"/blog/tags/tired"}],"readingTime":6.54,"hasTruncateMarker":true,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"basic-of-nn","title":"The Most Basics of Neural Networks","authors":"eason","tags":["beginners","nn","tutorial","tired"]},"unlisted":false,"prevItem":{"title":"Introduction to PyTorch","permalink":"/blog/intro-to-pytorch"},"nextItem":{"title":"Website Launch!","permalink":"/blog/website-launch"}},"content":"This blog post will be about the most basics of neural networks, for absolute beginners.\\r\\n\\r\\nYou\'ve heard about things like ChatGPT, LlaMa, Midjourney, Dall-E, and Stable Diffusion. But have you ever wondered how exactly does they work? In this blog series, I will explain the neural network, from the absolute basics to advanced, from simple fully-connected networks to Transformers, Quantum Neural Networks, and Graph Neural Networks. If you encountered any questions, feel free to ask by directly through my email or by Discord!\\r\\n\\r\\n\x3c!--truncate--\x3e\\r\\n\\r\\n## Prerequisites\\r\\n- Basic Maths\\r\\n- Basic Python\\r\\n- Common Sense\\r\\n\\r\\n## Aims\\r\\n1.\\tUnderstand the neurons and neural networks\\r\\n2.\\tUnderstand the use of neural networks\\r\\n3.\\tUnderstand forward pass, loss function, backward pass, and weight update\\r\\n\\r\\n## Introduction\\r\\n> \u201cI think the brain is essentially a computer and consciousness is like a computer program. It will cease to run when the computer is turned off. Theoretically, it could be re-created on a neural network, but that would be very difficult, as it would require all one\'s memories.\u201d ~ Stephen Hawking\\r\\n\\r\\n## Important Concepts\\r\\n\\r\\n### Neurons and Neural Networks\\r\\nImagine you are making a system to predict property prices. How would you implement such a system? Maybe it will take the different factors of a property (e.g. size, height, view, surrounding environment, etc.) to calculate the price and outputs it. But how can you calculate the price based on these inputs (factors)?\\r\\n\\r\\nLet\u2019s simplify the problem and assume there is only one factor: the size (area) of the property. Let\u2019s plot a graph with the area on the x-axis, price on the y-axis:\\r\\n\\r\\n![Graph 1](./graph-1.png)\\r\\n\\r\\nThen we can draw a straight fit line on the graph to relate all the data points:\\r\\n:::tip\\r\\nNote that the fit line may not pass through all/any data points!\\r\\n:::\\r\\n\\r\\n![Graph 2](./graph-2.png)\\r\\n\\r\\nHow can you represent the fit line in maths? We can use a simple linear function:\\r\\n\\r\\n$$\\r\\nf(x) = wx + b\\r\\n$$\\r\\n\\r\\nWhere w is the **weight** (the steepness of the linear), b is the **bias** (the y-intercept, or height of the line). In fact, we can represent any straight line on a two-dimensional Cartesian coordinate space and any linear functions with one variable with this function. In the neural network, this function is the simplest form of a **neuron**. But what is a neuron? This is an anatomy of a human neuron cell:\\r\\n\\r\\n![Neuron Anatomy](./neuron-anatomy.png)\\r\\n\\r\\nThe dendrites receive the signals, the cell processes the signals, and the axon terminals send the signals to other neuron cells. By connecting 86 billion of these cells, it forms your brain. We can simulate a neuron in maths with the following function:\\r\\n\\r\\n$$\\r\\nf(x_1, x_2, x_3, x_4, \\\\ldots) = w_1 x_1 + w_2 x_2 + w_3 x_3 + w_4 x_4 + \\\\cdots + b\\r\\n$$\\r\\n\\r\\nThe multiple weights represent the \u201cimportance\u201d of each of the different input x. The b is still the bias. Here\u2019s another diagram to understand the neuron:\\r\\n\\r\\n![Diagram 1](./diagram-1.png)\\r\\n\\r\\nSo, for example, the multiple x can be the different factors of the property, and the weights are parameters that you can tune, representing the importance of that factor contributing to the final price. Wait, what is the f(x) in the above diagram? It is an Activation Function. Its purpose is to introduce non-linearity into the neural network as combining linear functions can only result in a linear function:\\r\\n\\r\\nLet $f(x) = w_1 x + b_1$, $g(x) = w_2 x + b_2$, then $h(x) = g(f(x))$:\\r\\n$$\\r\\nh(x) = g(f(x)) = w_2 (w_1 x + b_1) + b_2\\r\\n$$\\r\\n$$\\r\\nh(x) = w_2 w_1 x + w_2 b_1 + b_2\\r\\n$$\\r\\nLet $a = w_2 w_1$ and $c = w_2 b_1 + b_2$, then:\\r\\n$$\\r\\nh(x) = ax + c\\r\\n$$\\r\\n\\r\\nWhich is a straight line on the graph. But by adding activation functions in between, e.g. $h(x)=g(a(f(x)))$, where $a$ is the activation function, we can create a non-linear (broadly speaking not a straight line on the graph) function or network. Some common activation functions include ReLU, Sigmoid, Tanh, LeakyReLU, GELU, and Softmax. The details of the activation function will be talked about in later blog posts.\\r\\n\\r\\nBy combining and connecting multiple neurons in an orderly manner, you get a neural network. Below is a diagram of a neural network which you\u2019ve probably seen before:\\r\\n\\r\\n![Diagram 2](./diagram-2.png)\\r\\n\\r\\nEach circle (node) in the neural network represents a neuron. Each neuron in the input layer processes a single number and each neuron in the output layer outputs a single number. Neural networks are **universal function approximators**.\\r\\n:::info\\r\\nNote that while the neurons in the hidden layer may seem to have multiple outputs, the outputs are the same.\\r\\n:::\\r\\n\\r\\n### Training of neural networks\\r\\n\\r\\nHowever, how can you calculate the weights and biases given x and y? Below are the processes of training a neural network to find the optimal weights and biases:\\t\\r\\n\\r\\n1.\\t**Initialize the weights and biases** using random numbers with normal or uniform distribution.\\r\\n2.\\t**Forward pass:** Run the model with the input x, and get the model output y.\\r\\n3.\\t**Compute loss:** Compare the model-output y with the real targeted y and calculate the difference using a loss function. \\r\\n4.\\t**Backpropagation/backward pass:** Calculate the gradients of each parameter (weight or bias) using gradient descent with partial derivative. Which means how the output of the model changes with that parameter changing.\\r\\n5.\\t**Update parameters:** Update the parameters using optimizers based on the gradients calculated and the given learning rate hyperparameter (usually between 1e-2 to 1e-6).\\r\\n6.\\t**Repeat Step 2 to 5** with different x and y until the loss is good enough.\\r\\n\\r\\n![Diagram 3](./diagram-3.png)\\r\\n\\r\\n## Code Implementations\\r\\n\\r\\n### A simple neural network with PyTorch\\r\\n\\r\\nLet\u2019s consider a simple formula: y=3x+1. Given an array of x and array of the corresponding y, find 3 and 1 (the weight and the bias). Run the following codes in Google Colab for simplicity.\\r\\n\\r\\n```python\\r\\nimport torch # main library\\r\\nimport torch.nn as nn # neural network modules and functions\\r\\nimport torch.optim as optim # optimizers for neural networks\\r\\nimport matplotlib.pyplot as plt # plotting for analysing the loss\\r\\n\\r\\ntorch.manual_seed(69) # define a manual seed so the results are reproducible\\r\\n```\\r\\n\\r\\nDefine the data x and y:\\r\\n\\r\\n```python\\r\\nx = torch.tensor([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype=torch.float32)\\r\\ny = 3*x + 1\\r\\n\\r\\nprint(x.tolist())\\r\\nprint(y.tolist())\\r\\n```\\r\\n\\r\\nDefine the model, loss function, and optimizer:\\r\\n\\r\\n```python\\r\\nmodel = nn.Linear(1, 1) # a single neuron\\r\\ncriterion = nn.MSELoss() # Mean squared error (MSE) loss function\\r\\noptimizer = optim.SGD(model.parameters(), lr=1e-4) # Stochastic Gradient Descent (SGD) optimizer\\r\\n```\\r\\n\\r\\nTraining Loop:\\r\\n\\r\\n```python\\r\\nepochs = 100\\r\\nlosses = []\\r\\nfor i in range(epochs):\\r\\n for iter_x, iter_y in zip(x, y):\\r\\n iter_x = iter_x.unsqueeze(0) # add another dimension at the end\\r\\n iter_y = iter_y.unsqueeze(0) # same\\r\\n optimizer.zero_grad() # zero the gradients\\r\\n output = model(iter_x) # Forward pass\\r\\n loss = criterion(output, iter_y) # Compute Loss\\r\\n loss.backward() # Backward pass\\r\\n optimizer.step() # Update parameters\\r\\n print(f\\"Epoch: {i}/{epochs}, Loss: {loss.item()}\\")\\r\\n losses.append(loss.item())\\r\\n```\\r\\n\\r\\nFinal loss: 0.0001777520083123818\\r\\nPlot the loss graph:\\r\\n\\r\\n```python\\r\\nplt.plot(losses)\\r\\nplt.show() # Plot the loss graph\\r\\n```\\r\\n\\r\\nLoss Graph:\\r\\n\\r\\n![Loss Graph](./result.png)\\r\\n\\r\\nTest the model:\\r\\n\\r\\n```python\\r\\nfor name, param in model.named_parameters():\\r\\n print(name, param) # Inspect the weight and bias\\r\\n\\r\\nn = 100 # input x\\r\\nx = torch.tensor([n], dtype=torch.float32) # convert to tensor\\r\\ny = model(x) # Forward pass\\r\\nprint(y)\\r\\n```\\r\\n\\r\\n### Follow-up Tasks\\r\\n\\r\\n1. Experiment with different learning rates and epochs and see how it affects the training result.\\r\\n2. Enlarge the dataset (lengthen the x tensor), does it improve the model?\\r\\n3. Experiment with a more complex function than y=3x+1 such as y=x^2. Does it work? If it doesn\u2019t work, how can you solve this issue?\\r\\n4. How can you make the training faster without changing the hardware, data and the model?\\r\\n\\r\\nFeel free to send me an email for your solutions to the above problems!"},{"id":"website-launch","metadata":{"permalink":"/blog/website-launch","source":"@site/blog/2023-10-06-website-launch/index.md","title":"Website Launch!","description":"Website Launch","date":"2023-10-06T00:00:00.000Z","tags":[{"label":"hola","permalink":"/blog/tags/hola"},{"label":"tired","permalink":"/blog/tags/tired"}],"readingTime":0.05,"hasTruncateMarker":false,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"website-launch","title":"Website Launch!","authors":"eason","tags":["hola","tired"]},"unlisted":false,"prevItem":{"title":"The Most Basics of Neural Networks","permalink":"/blog/basic-of-nn"}},"content":"![Website Launch](./website-launch.jpg)\\r\\n\\r\\nThe website is launched today at 00:00 UTC+0!"}]}')}}]); \ No newline at end of file diff --git a/assets/js/b2f554cd.c4212ccb.js b/assets/js/b2f554cd.c4212ccb.js new file mode 100644 index 0000000..252fb7f --- /dev/null +++ b/assets/js/b2f554cd.c4212ccb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[5894],{6042:t=>{t.exports=JSON.parse('{"blogPosts":[{"id":"mit-iquhack-solution","metadata":{"permalink":"/blog/mit-iquhack-solution","source":"@site/blog/2024-2-12-mit-iquhack-2025-experience/index.md","title":"Preparing a Gaussian State in the Symmetrical Domain","description":"Explanation of Our Solution at MIT iQuHACK","date":"2024-02-12T00:00:00.000Z","tags":[{"label":"advanced","permalink":"/blog/tags/advanced"},{"label":"quantum","permalink":"/blog/tags/quantum"},{"label":"state-preparation","permalink":"/blog/tags/state-preparation"}],"readingTime":8.395,"hasTruncateMarker":true,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"mit-iquhack-solution","title":"Preparing a Gaussian State in the Symmetrical Domain","authors":"eason","tags":["advanced","quantum","state-preparation"]},"unlisted":false,"nextItem":{"title":"Introduction to Quantum Neural Networks","permalink":"/blog/intro-to-qnn"}},"content":"Explanation of Our Solution at MIT iQuHACK\\r\\n\\r\\n\x3c!--truncate--\x3e\\r\\n\\r\\n## Introduction\\r\\n\\r\\nIn this blog post, I will explain the solution of our team to the Classiq track at MIT iQuHACK 2025, including why it works and how it scales.\\r\\n\\r\\nGaussian state preparation is essential for simulating physical systems and tackling problems in quantum chemistry, machine learning, and optimization. Gaussian states, characterized by their Gaussian-shaped wavefunctions, are powerful tools for encoding probability distributions and modeling quantum systems.\\r\\n\\r\\nWith the scaling of quantum hardware, achieving efficient and precise Gaussian state preparation could improve the costs of quantum algorithms and enhance impactful applications like option pricing in finance, molecular simulations in quantum chemistry, and data analysis in machine learning, among others.\\r\\n\\r\\nAt the competition, our challenge was to prepare a Gaussian state in the symmetrical domain \\r\\n\\r\\n$$\\r\\nx \\\\in [-2, 2)\\r\\n$$\\r\\n\\r\\nusing a quantum circuit. The target state is defined as:\\r\\n\\r\\n$$\\r\\n|x_0\\\\rangle_N = |0\\\\rangle_N \\\\longrightarrow \\\\sum_{x\\\\in \\\\text{domain}} \\\\sqrt{G(x)}\\\\,|x\\\\rangle_N,\\r\\n$$\\r\\n\\r\\nwith\\r\\n\\r\\n$$\\r\\nG(x) = \\\\frac{\\\\exp(-\\\\lambda x^2)}{\\\\sum_{x\'\\\\in \\\\text{domain}} \\\\exp(-\\\\lambda {x\'}^2)}.\\r\\n$$\\r\\n\\r\\nHere, $\\\\lambda$ (represented by `EXP_RATE` in our code) controls the decay of the Gaussian, and the domain discretization is determined by the `resolution` variable. Our task was to design a quantum circuit that not only achieves a small mean squared error (MSE) compared to the ideal Gaussian state but also scales efficiently as the resolution increases.\\r\\n\\r\\nThere are of course many solutions to this problem. For example, the easiest way is to first prepare a Gaussian state as an amplitude list of length $2^n$ (where $n$ is the number of qubits or `resolution`), then encode this list of amplitudes into the state vector using amplitude encoding. However, this method is costly, requiring $\\\\mathcal{O}(2^n)$ complexity in the worst case scenario. Another method might be using Hamiltonian simulation with trotterization to calculate the exponentila part of the Gaussian, although it results in a true Gaussian, it is also pretty costly. Our solution is not perfect \u2014 it only approximates the Gaussian to an extent, but this approximation is good enough for the MSE error and most importantly, it scales almost linearly to the `resolution` or number of qubits, i.e. $\\\\mathcal{O}(n)$ complexity.\\r\\n\\r\\n## Our Solution\\r\\n\\r\\nOur solution is based on two key steps: first, preparing a state using RY rotations that encodes an exponential factor on each qubit, and second, applying the Quantum Fourier Transform (QFT) to convert that state into one with a Gaussian amplitude distribution. \\r\\n\\r\\n### First Step\\r\\n\\r\\nWhen we apply an RY gate with angle $\\\\theta$ to a qubit initially in $|0\\\\rangle$, we obtain\\r\\n\\r\\n$$\\r\\n\\\\text{RY}(\\\\theta)|0\\\\rangle = \\\\cos\\\\Bigl(\\\\frac{\\\\theta}{2}\\\\Bigr)|0\\\\rangle + \\\\sin\\\\Bigl(\\\\frac{\\\\theta}{2}\\\\Bigr)|1\\\\rangle.\\r\\n$$\\r\\n\\r\\nIn our code, for each qubit indexed by $i$ we set\\r\\n\\r\\n$$\\r\\n\\\\theta_i = 2\\\\,\\\\arctan\\\\Bigl(e^{-\\\\frac{i^2}{2\\\\sigma^2}}\\\\Bigr),\\r\\n$$\\r\\n\\r\\nwith\\r\\n\\r\\n$$\\r\\n\\\\sigma = \\\\frac{\\\\text{EXP\\\\_RATE}}{\\\\sqrt{5}}.\\r\\n$$\\r\\n\\r\\nThus, for the $i$th qubit,\\r\\n\\r\\n$$\\r\\n\\\\frac{\\\\theta_i}{2} = \\\\arctan\\\\Bigl(e^{-\\\\frac{i^2}{2\\\\sigma^2}}\\\\Bigr).\\r\\n$$\\r\\n\\r\\nUsing the trigonometric identities $ \\\\cos(\\\\arctan(x)) = \\\\frac{1}{\\\\sqrt{1+x^2}} $ and $ \\\\sin(\\\\arctan(x)) = \\\\frac{x}{\\\\sqrt{1+x^2}} $, with $x = e^{-\\\\frac{i^2}{2\\\\sigma^2}}$, we find\\r\\n\\r\\n$$\\r\\n\\\\cos\\\\Bigl(\\\\frac{\\\\theta_i}{2}\\\\Bigr) = \\\\frac{1}{\\\\sqrt{1+e^{-\\\\frac{i^2}{\\\\sigma^2}}}}, \\\\quad \\\\sin\\\\Bigl(\\\\frac{\\\\theta_i}{2}\\\\Bigr) = \\\\frac{e^{-\\\\frac{i^2}{2\\\\sigma^2}}}{\\\\sqrt{1+e^{-\\\\frac{i^2}{\\\\sigma^2}}}}.\\r\\n$$\\r\\n\\r\\nFor large $i$, $e^{-\\\\frac{i^2}{2\\\\sigma^2}}$ is very small, so the amplitude in $|1\\\\rangle$ is approximately\\r\\n\\r\\n$$\\r\\n\\\\sin\\\\Bigl(\\\\frac{\\\\theta_i}{2}\\\\Bigr) \\\\approx e^{-\\\\frac{i^2}{2\\\\sigma^2}}.\\r\\n$$\\r\\n\\r\\nBy applying these rotations to each of the $n$ qubits, the overall state becomes the tensor product\\r\\n\\r\\n$$\\r\\n|\\\\psi\\\\rangle = \\\\bigotimes_{i=0}^{n-1}\\\\left(\\\\frac{1}{\\\\sqrt{1+e^{-\\\\frac{i^2}{\\\\sigma^2}}}}|0\\\\rangle_i + \\\\frac{e^{-\\\\frac{i^2}{2\\\\sigma^2}}}{\\\\sqrt{1+e^{-\\\\frac{i^2}{\\\\sigma^2}}}}|1\\\\rangle_i\\\\right).\\r\\n$$\\r\\n\\r\\nWhen this state is expressed in the computational basis, a basis state $|j\\\\rangle$ (with $j$ written in binary as $j=\\\\sum_{i=0}^{n-1}j_i2^i$ where each $j_i\\\\in\\\\{0,1\\\\}$) has amplitude\\r\\n\\r\\n$$\\r\\na_j = \\\\prod_{i=0}^{n-1}\\\\left[\\\\cos\\\\Bigl(\\\\frac{\\\\theta_i}{2}\\\\Bigr)\\\\right]^{1-j_i}\\\\left[\\\\sin\\\\Bigl(\\\\frac{\\\\theta_i}{2}\\\\Bigr)\\\\right]^{j_i}.\\r\\n$$\\r\\n\\r\\nBecause $\\\\sin(\\\\frac{\\\\theta_i}{2})\\\\approx e^{-\\\\frac{i^2}{2\\\\sigma^2}}$, the amplitude $a_j$ is a product of factors that decay exponentially with $i$. This product structure means that the probability distribution over $j$ appears as a steep exponential drop in the contributions of higher-index qubits rather than as a smooth Gaussian curve. This is shown in the figure below (only the first few amplitudes are shown):\\r\\n\\r\\n![initial_state](exp_state.png)\\r\\n\\r\\n### Second Step\\r\\n\\r\\nThe next step is to apply the QFT, which acts on computational basis states as\\r\\n\\r\\n$$\\r\\n\\\\text{QFT}\\\\,|j\\\\rangle = \\\\frac{1}{\\\\sqrt{N}}\\\\sum_{k=0}^{N-1} e^{2\\\\pi i\\\\,jk/N}\\\\,|k\\\\rangle,\\r\\n$$\\r\\n\\r\\nwith $N=2^n$. After applying the QFT, the final state becomes\\r\\n\\r\\n$$\\r\\n\\\\text{QFT}\\\\,|\\\\psi\\\\rangle = \\\\sum_{k=0}^{N-1} b_k\\\\,|k\\\\rangle,\\r\\n$$\\r\\n\\r\\nwhere\\r\\n\\r\\n$$\\r\\nb_k = \\\\frac{1}{\\\\sqrt{N}}\\\\sum_{j=0}^{N-1} a_j\\\\,e^{2\\\\pi i\\\\,jk/N}.\\r\\n$$\\r\\n\\r\\nWe can express the sum over $j$ in terms of the binary digits $j_i$. Since $a_j$ is a product over qubit contributions, the sum factorizes, and we have\\r\\n\\r\\n$$\\r\\nb_k = \\\\frac{1}{\\\\sqrt{N}}\\\\prod_{i=0}^{n-1}\\\\left[\\\\cos\\\\Bigl(\\\\frac{\\\\theta_i}{2}\\\\Bigr) + e^{\\\\frac{2\\\\pi i\\\\,2^ik}{N}}\\\\sin\\\\Bigl(\\\\frac{\\\\theta_i}{2}\\\\Bigr)\\\\right].\\r\\n$$\\r\\n\\r\\nSubstituting the approximate forms for $\\\\cos(\\\\frac{\\\\theta_i}{2})$ and $\\\\sin(\\\\frac{\\\\theta_i}{2})$, this becomes\\r\\n\\r\\n$$\\r\\nb_k \\\\approx \\\\frac{1}{\\\\sqrt{N}}\\\\prod_{i=0}^{n-1}\\\\frac{1}{\\\\sqrt{1+e^{-\\\\frac{i^2}{\\\\sigma^2}}}}\\\\left[1 + e^{-\\\\frac{i^2}{2\\\\sigma^2}}e^{\\\\frac{2\\\\pi i\\\\,2^ik}{N}}\\\\right].\\r\\n$$\\r\\n\\r\\nIn the large-$N$ limit and with appropriate scaling of $\\\\sigma$, the sum over $j$ approximates the discrete Fourier transform of a Gaussian function. It is a well-known fact that the Fourier transform of a Gaussian is another Gaussian:\\r\\n\\r\\n$$\\r\\n\\\\int_{-\\\\infty}^{\\\\infty} e^{-\\\\frac{x^2}{2\\\\sigma^2}} e^{2\\\\pi i x k/N}\\\\,dx \\\\propto e^{-2\\\\pi^2 \\\\sigma^2 k^2/N^2},\\r\\n$$\\r\\n\\r\\nwhich implies that the amplitudes $b_k$ in the Fourier basis take the form\\r\\n\\r\\n$$\\r\\nb_k \\\\sim e^{-\\\\alpha k^2},\\r\\n$$\\r\\n\\r\\nup to normalization and a rescaling of parameters, where $\\\\alpha>0$. Thus, although the original state $|\\\\psi\\\\rangle$ in the computational basis exhibits an exponential decay coming from the product of bitwise factors, the QFT maps these amplitudes into a smooth Gaussian distribution in the Fourier basis. This transformation from a steep, exponential drop to a Gaussian envelope is a direct consequence of the Fourier transform properties of the Gaussian function. Showing this transformation visually, the amplitudes after QFT are:\\r\\n\\r\\n![amplitudes_after_qft](qft_state.png)\\r\\n\\r\\nNote that the Gaussian is \\"inverted\\". To turn it back to a normal Gaussian, we can apply the X gate on the 0th qubit. The final result is:\\r\\n\\r\\n![final_state](final_state.png)\\r\\n\\r\\nUsing the method described above, we can reach a MSE error of $2.230\\\\times10^{-8}$.\\r\\n\\r\\nThe overall circuit is:\\r\\n\\r\\n![overall_circuit](overall_circuit.png)\\r\\n\\r\\n### Scalability of Our Solution\\r\\n\\r\\nThe Phase 2 of the challenge is to maximize the scalability of our solution, i.e. make our solution works at the highest resolution with the least number of gates possible. The bottleneck of our solution described above was the QFT part, the number of gates in a regular QFT grows quadratically as the number of qubits increases:\\r\\n\\r\\n$$\\r\\n\\\\mathcal{O}\\\\left(\\\\frac{n^2+n}{2}\\\\right) \\\\approx \\\\mathcal{O}(n^2).\\r\\n$$\\r\\n\\r\\nWe observed that the gate angles of the CPhase gates used in QFT decreases exponentially! The gate angle for the CPhase gate with layer number $j$ and qubit number $k$ is\\r\\n\\r\\n$$\\r\\n\\\\frac{2\\\\pi}{2^{k-j+1}}.\\r\\n$$\\r\\n\\r\\nWhen there are many qubits, the majority of the gate angles often become very small (e.g. less than $1\\\\times10^{-3}$), which have negligible effects on the overall state vector. Therefore, we pruned any gates with angle smaller than a threshold $\\\\theta$ as shown in the diagram below:\\r\\n\\r\\n![gate_prune](gate_prune.png)\\r\\n\\r\\nNow the number of gates in the approximated QFT with qubit number $n$ and $\\\\theta=1\\\\times10^{-2}$ is\\r\\n\\r\\n$$\\r\\n\\\\mathcal{O}\\\\bigl(n+\\\\sum_{j=1}^{n}\\\\text{min}(8,n-j)\\\\bigr) \\\\approx \\\\mathcal{O}(n).\\r\\n$$\\r\\n\\r\\nWe did an experiment to compare the effect of different choices of $\\\\theta$ with 18 qubits (`resolution = 18`), below is a table summarising the results:\\r\\n\\r\\n| $\\\\theta$ | Number of CX Gates | MSE error |\\r\\n| ---------------- | ------------------ | --------------------- |\\r\\n| $1\\\\times10^{-3}$ | 293 | $1.564\\\\times10^{-14}$ |\\r\\n| $1\\\\times10^{-2}$ | 245 | $1.601\\\\times10^{-14}$ |\\r\\n| $1\\\\times10^{-1}$ | 153 | $1.098\\\\times10^{-13}$ |\\r\\n\\r\\nWe chose $\\\\theta=1\\\\times10^{-2}$ in our final submission for a balance of complexity and accuracy. The figure below shows the ratio between the number of CX gates and the resolution, which can be seen that the relation becomes linear if the resolution is large enough.\\r\\n\\r\\n![scalability](https://docs.google.com/spreadsheets/d/e/2PACX-1vRSAaAXzWFhnhRiy2nwQ4QAfic7GpYxCQGUsp-dkcqI05yOARGQ_1d5sF5zOA_qDN43n2GGEPpsXER3/pubchart?oid=941513203&format=image)\\r\\n\\r\\nHere is an additional table summarising another experiment that compares the difference in MSE error when we change the resolution $n$ from 5 to 18 ($\\\\theta=1\\\\times10^{-2}$):\\r\\n\\r\\n| $n$ | Number of CX Gates | MSE error |\\r\\n| ---- | ------------------ | --------------------- |\\r\\n| $5$ | 28 | $2.515\\\\times10^{-5}$ |\\r\\n| $8$ | 70 | $2.230\\\\times10^{-8}$ |\\r\\n| $12$ | 140 | $6.526\\\\times10^{-11}$ |\\r\\n| $15$ | 191 | $1.024\\\\times10^{-12}$ |\\r\\n| $18$ | 245 | $1.601\\\\times10^{-14}$ |\\r\\n\\r\\nThe MSE decreases as the resolution increases. This is because the overall probability scale is smaller when resolution is higher, leading to decreasing MSE. The Gaussian is also more fine-grained as resolution increases, as shown in the following figure:\\r\\n\\r\\n![r8and12](r8and12.png)\\r\\n\\r\\n### Code of Our Solution\\r\\n\\r\\nBelow is the code we used for submission that includes all the things stated above:\\r\\n\\r\\n```python\\r\\ndef create_solution(resolution: int): # Don\'t change!\\r\\n fraction_digits = resolution - 2 # Don\'t change!\\r\\n EXP_RATE = 1 # Don\'t change!\\r\\n \\r\\n import math\\r\\n \\r\\n @qfunc\\r\\n def single_X(x_arr: QArray[QBit]):\\r\\n X(x_arr[0])\\r\\n\\r\\n @qfunc\\r\\n def prepare_state(q: QArray[QBit]) :\\r\\n for i in range(resolution):\\r\\n exp = (i ** 2)/(-2 * (EXP_RATE / math.sqrt(5)) ** 2)\\r\\n angle = 2.0 * math.atan(math.exp(exp))\\r\\n if angle > 1e-6:\\r\\n RY(angle, q[i])\\r\\n CRY(-math.pi/42, q[0], q[1])\\r\\n\\r\\n @qfunc\\r\\n def approx_qft(target: QArray[QBit]):\\r\\n for i in range(resolution // 2):\\r\\n SWAP(target[i], target[resolution - i - 1])\\r\\n \\r\\n for j in range(resolution):\\r\\n H(target[j])\\r\\n \\r\\n for k in range(j+1, resolution):\\r\\n theta = 2 * math.pi / (2 ** (k - j + 1))\\r\\n if theta > 1e-2: # 9 qubits\\r\\n CPHASE(theta, target[k], target[j])\\r\\n \\r\\n @qfunc\\r\\n def prepare_gaussian(x: QNum): \\r\\n prepare_state(x)\\r\\n approx_qft(x)\\r\\n single_X(x)\\r\\n \\r\\n return prepare_gaussian\\r\\n```\\r\\n\\r\\n## Conclusion\\r\\n\\r\\nIn this post, we have explained our solution to the MIT iQuHACK 2025 challenge, where we were tasked with preparing a Gaussian state in the symmetrical domain using a quantum circuit. Our approach efficiently scales with increasing resolution, achieving a low mean squared error (MSE) with a complexity of $\\\\mathcal{O}(n)$, making it feasible even for high-resolution cases. By applying RY rotations to encode an exponential factor and then using the Quantum Fourier Transform (QFT) to map the state into a Gaussian distribution, we were able to achieve a smooth Gaussian amplitude distribution, as required by the challenge.\\r\\n\\r\\nFurthermore, to maximize scalability, we pruned redundant gates in the QFT, significantly reducing the gate count while maintaining the accuracy of the result. Our final circuit balances gate complexity and error, with a small MSE error of $2.230\\\\times10^{-8}$ and a gate count that grows linearly with the resolution for large $n$. This optimization makes our solution highly scalable, capable of handling large-scale quantum computations efficiently.\\r\\n\\r\\nOverall, our solution demonstrates that by combining clever state preparation techniques and efficient quantum circuits, we can solve complex problems with scalability and precision, even within the constraints of quantum hardware limitations. We hope this approach can serve as a reference for future quantum state preparation tasks and inspire further advancements in quantum algorithm design."},{"id":"intro-to-qnn","metadata":{"permalink":"/blog/intro-to-qnn","source":"@site/blog/2024-2-9-intro-to-qnn/index.md","title":"Introduction to Quantum Neural Networks","description":"Make a Quantum Neural Network (QNN) in PyTorch.","date":"2024-02-09T00:00:00.000Z","tags":[{"label":"intermediate","permalink":"/blog/tags/intermediate"},{"label":"quantum","permalink":"/blog/tags/quantum"},{"label":"qnn","permalink":"/blog/tags/qnn"},{"label":"pytorch","permalink":"/blog/tags/pytorch"},{"label":"tutorial","permalink":"/blog/tags/tutorial"}],"readingTime":9.51,"hasTruncateMarker":true,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"intro-to-qnn","title":"Introduction to Quantum Neural Networks","authors":"eason","tags":["intermediate","quantum","qnn","pytorch","tutorial"]},"unlisted":false,"prevItem":{"title":"Preparing a Gaussian State in the Symmetrical Domain","permalink":"/blog/mit-iquhack-solution"},"nextItem":{"title":"Introduction to Quantum Computing","permalink":"/blog/intro-to-quantum-computing"}},"content":"Make a Quantum Neural Network (QNN) in PyTorch.\\r\\n\\r\\n\x3c!--truncate--\x3e\\r\\n\\r\\nIn the [last blog post](https://easonoob.github.io/blog/intro-to-quantum-computing), we talked about the very basics of quantum computing, and tried a few examples with qiskit. In this post, we will try to build a QNN completely with PyTorch only, without quantum simulation / machine learning libraries like PennyLane or TorchQuantum, so we can know what really happens inside the simulation. Let\'s get started!\\r\\n\\r\\n## Prerequisites\\r\\n- Read and Understand the last post\\r\\n- Basic Python & PyTorch\\r\\n\\r\\n## Simulation\\r\\n\\r\\nImport necessary libraries:\\r\\n\\r\\n```python\\r\\nimport torch, torch.nn as nn, torch.nn.functional as F\\r\\nfrom typing import Union, List\\r\\nimport numpy as np\\r\\nfrom torchvision import datasets, transforms\\r\\nfrom torch.utils.data import DataLoader\\r\\nimport matplotlib.pyplot as plt\\r\\n```\\r\\n\\r\\nWe know a quantum state vector of a single qubit can be represented as $|\\\\psi\\\\rangle = \\\\alpha |0\\\\rangle + \\\\beta |1\\\\rangle$, and numerous qubits can be combined into a large state of $2^n$ propabilities. For the simulation, we will create a single large state vector $h$ which stores all qubits in the system (not very efficient but this is the easiest) with $h \\\\in \\\\mathbb{R}^{b \\\\times \\\\underbrace{2 \\\\times 2 \\\\times \\\\cdots \\\\times 2}_{n \\\\text{ times}}}$ which $b$ is batch size, $n$ is number of qubits so that for each batch, there are $2^n$ propabilities.\\r\\n\\r\\nTo apply the gate to a specific qubit in the state vector, we can simply permute the target qubit dimension to the back, then multiply it with the gate matrix. For double qubits gates, we can permute the control and target to the back, combine the two dimensions, multiply the gate matrix, and reshape back. Here is a function that applied the gate to the state:\\r\\n\\r\\n```python\\r\\ndef apply_gate(state, mat, wires: Union[int, List[int]]):\\r\\n \\"\\"\\"\\r\\n Apply the gate matrix/matrices to the state vector using torch.bmm method.\\r\\n \\r\\n Args:\\r\\n state (torch.Tensor): The state vector.\\r\\n mat (torch.Tensor): The gate matrix/matrices.\\r\\n wires (int or List[int]): Which qubit(s) the operation is applied to.\\r\\n \\r\\n Returns:\\r\\n torch.Tensor: The updated state vector.\\r\\n \\"\\"\\"\\r\\n # Handle input for single qubit as a list for uniformity\\r\\n if isinstance(wires, int):\\r\\n wires = [wires]\\r\\n \\r\\n # Ensure the matrix is on the same device and dtype as the state\\r\\n mat = mat.to(state.device).to(state.dtype)\\r\\n \\r\\n # Calculate the new order of dimensions for the state to match matrix multiplication needs\\r\\n num_qubits = len(state.shape) - 1\\r\\n permute_order = list(range(1, num_qubits + 1)) # Start from 1 to account for batch dimension\\r\\n for index, wire in enumerate(wires):\\r\\n permute_order.remove(wire + 1) # Remove wire from its current place\\r\\n permute_order.insert(index, wire + 1) # Insert wire right after the batch dimension\\r\\n\\r\\n # Permute the state tensor to bring the target wire dimensions next to the batch dimension\\r\\n permuted_state = state.permute([0] + permute_order) # Batch dimension remains the first\\r\\n reshaped_state = permuted_state.reshape(state.shape[0], -1, mat.size(-1))\\r\\n \\r\\n # Apply the gate using matrix multiplication\\r\\n new_state = torch.bmm(reshaped_state, mat) if len(mat.shape) == 3 else reshaped_state @ mat\\r\\n \\r\\n # Reshape and permute back to the original shape and order\\r\\n final_state = new_state.view(state.shape).permute(list(np.argsort([0] + permute_order)))\\r\\n \\r\\n return final_state\\r\\n```\\r\\n\\r\\nThe reason for the input to accept batched gate matrices is for the angle encoding later, which encodes inputs into the state.\\r\\n\\r\\n### Define Gate Matrices\\r\\n\\r\\nNow the gate matrix functions:\\r\\n\\r\\n```python\\r\\ndef h_matrix():\\r\\n return 1 / np.sqrt(2) * torch.tensor([[1, 1], [1, -1]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef cnot_matrix():\\r\\n return torch.tensor([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef pauli_x_matrix():\\r\\n return torch.tensor([[0, 1], [1, 0]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef pauli_y_matrix():\\r\\n return torch.tensor([[0, -1j], [1j, 0]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef pauli_z_matrix():\\r\\n return torch.tensor([[1, 0], [0, -1]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef rx_matrix(theta):\\r\\n return torch.tensor([[torch.cos(theta / 2), -1j * torch.sin(theta / 2)],\\r\\n [-1j * torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef ry_matrix(theta):\\r\\n return torch.tensor([[torch.cos(theta / 2), -torch.sin(theta / 2)],\\r\\n [torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef rz_matrix(theta):\\r\\n return torch.tensor([[torch.exp(-1j * theta / 2), 0],\\r\\n [0, torch.exp(1j * theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef u3_matrix(theta, phi, lam):\\r\\n return torch.tensor([[torch.cos(theta / 2), -torch.exp(1j * lam) * torch.sin(theta / 2)],\\r\\n [torch.exp(1j * phi) * torch.sin(theta / 2), torch.exp(1j * (phi + lam)) * torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef crx_matrix(theta):\\r\\n return torch.tensor([[1, 0, 0, 0],\\r\\n [0, 1, 0, 0],\\r\\n [0, 0, torch.cos(theta / 2), -1j * torch.sin(theta / 2)],\\r\\n [0, 0, -1j * torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef cry_matrix(theta):\\r\\n return torch.tensor([[1, 0, 0, 0],\\r\\n [0, 1, 0, 0],\\r\\n [0, 0, torch.cos(theta / 2), -torch.sin(theta / 2)],\\r\\n [0, 0, torch.sin(theta / 2), torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef crz_matrix(theta):\\r\\n return torch.tensor([[1, 0, 0, 0],\\r\\n [0, 1, 0, 0],\\r\\n [0, 0, torch.exp(-1j * theta / 2), 0],\\r\\n [0, 0, 0, torch.exp(1j * theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n\\r\\ndef cu3_matrix(theta, phi, lam):\\r\\n return torch.tensor([[1, 0, 0, 0],\\r\\n [0, 1, 0, 0],\\r\\n [0, 0, torch.cos(theta / 2), -torch.exp(1j * lam) * torch.sin(theta / 2)],\\r\\n [0, 0, torch.exp(1j * phi) * torch.sin(theta / 2), torch.exp(1j * (phi + lam)) * torch.cos(theta / 2)]], dtype=torch.complex64, requires_grad=True)\\r\\n```\\r\\n\\r\\nNow the Gate class, which stores the parameters (if any) and qubits:\\r\\n\\r\\n```python\\r\\nclass Gate(nn.Module):\\r\\n def __init__(self, gate_matrix_fn, wires: list, n_params: int):\\r\\n super(Gate, self).__init__()\\r\\n self.wires = wires\\r\\n self.n_params = n_params\\r\\n self.gate_matrix_fn = gate_matrix_fn\\r\\n self.params = nn.Parameter(torch.randn(n_params, dtype=torch.float32)).uniform_(-np.pi, np.pi) # Unifrom distribution between -pi and pi\\r\\n \\r\\n def forward(self, state):\\r\\n gate_matrix = self.gate_matrix_fn(*self.params)\\r\\n return apply_gate(state, gate_matrix, self.wires)\\r\\n```\\r\\n\\r\\n### Angle Encoding\\r\\n\\r\\nAngle encoding, as mentioned above, encodes the input tensor into the state vector using rotation gates (rx, ry, u3, etc).\\r\\n\\r\\n```python\\r\\nclass AngleEncoding(nn.Module):\\r\\n \\"\\"\\"\\r\\n Example functions list:\\r\\n [{\\"gate\\": \'rx\', \\"wires\\": 0, \\"input_idx\\": 0},\\r\\n {\\"gate\\": \'ry\', \\"wires\\": 1, \\"input_idx\\": 1},\\r\\n {\\"gate\\": \'rz\', \\"wires\\": 2, \\"input_idx\\": 2},]\\r\\n or\\r\\n [{\\"gate\\": \'u3\', \\"wires\\": 0, \\"input_idx\\": [0, 1, 2]},\\r\\n {\\"gate\\": \'rx\', \\"wires\\": 1, \\"input_idx\\": 1},\\r\\n {\\"gate\\": \'cu3\', \\"wires\\": [1, 2], \\"input_idx\\": [0, 1, 2]},]\\r\\n \\"\\"\\"\\r\\n def __init__(self, func_list):\\r\\n super().__init__()\\r\\n self.func_list = func_list\\r\\n\\r\\n def forward(self, state, x):\\r\\n for info in self.func_list:\\r\\n params = x[:, [info[\\"input_idx\\"]]] if len(x.shape) > 1 else x[info[\\"input_idx\\"]]\\r\\n gate = info[\\"gate\\"] + \'_matrix\'\\r\\n fn = globals()[gate] # Get the function from the globals\\r\\n mat = torch.stack([fn(*p) for p in params], dim=0) if len(x.shape) > 1 else fn(*params) # Gate matrix\\r\\n state = apply_gate(\\r\\n state,\\r\\n mat=mat,\\r\\n wires=info[\\"wires\\"],\\r\\n )\\r\\n return state\\r\\n```\\r\\n\\r\\n### Measurement\\r\\n\\r\\nFor the measurement, we will measure the expected values of all qubits based on a observable matrix of size $2^n \\\\times 2^n$, which typically is either Pauli-X, Pauli-Y, or Pauli-Z. Mathematically it is $\\\\langle\\\\psi|O|\\\\psi\\\\rangle$.\\r\\n\\r\\n```python\\r\\ndef measure_pauli_expectations(state, observable_matrix):\\r\\n num_qubits = len(state.shape) - 1\\r\\n batch_size = state.shape[0]\\r\\n expected_values = torch.empty((batch_size, num_qubits), dtype=state.real.dtype, device=state.device)\\r\\n observable_matrix = observable_matrix.to(state.device).to(state.dtype)\\r\\n\\r\\n # Compute the expectation value for each qubit\\r\\n for qubit in range(num_qubits):\\r\\n # Permute to bring the qubit of interest to the last position\\r\\n dims = list(range(1, num_qubits + 1))\\r\\n dims.append(dims.pop(qubit)) # Move the qubit index to the end\\r\\n permuted_state = state.permute([0] + dims)\\r\\n \\r\\n # Reshape to combine all other dimensions except the last two\\r\\n reshaped_state = permuted_state.reshape(batch_size, -1, 2)\\r\\n \\r\\n # Apply observable and calculate expectation value\\r\\n # Here we calculate for the current qubit\\r\\n measured_state = torch.matmul(reshaped_state, observable_matrix)\\r\\n probabilities = torch.matmul(measured_state, reshaped_state.transpose(-2, -1)).diagonal(dim1=-2, dim2=-1)\\r\\n expected_value = probabilities.sum(dim=-1) # Sum over the states to get the expectation\\r\\n\\r\\n # Store the computed expected value for the current qubit\\r\\n expected_values[:, qubit] = expected_value.real\\r\\n\\r\\n return expected_values\\r\\n```\\r\\n\\r\\n### Model\\r\\n\\r\\nWe will use the MNIST dataset for the testing. We will only use the first 5 numbers (0, 1, 2, 3, 4) and the image size will be reduced to $5 \\\\times 5$ to reduce complexity. The Variational Quantum Circuit (VQC) consists 4 blocks of single and double qubits parameterized gates.\\r\\n\\r\\n```python\\r\\nclass VQC(nn.Module):\\r\\n def __init__(self):\\r\\n super(VQC, self).__init__()\\r\\n self.n_wires = 5 # Number of qubits in the circuit\\r\\n self.encoding = AngleEncoding([\\r\\n {\\"input_idx\\": [0], \\"gate\\": \\"ry\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [1], \\"gate\\": \\"ry\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [2], \\"gate\\": \\"ry\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [3], \\"gate\\": \\"ry\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [4], \\"gate\\": \\"ry\\", \\"wires\\": [4]},\\r\\n {\\"input_idx\\": [5], \\"gate\\": \\"rz\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [6], \\"gate\\": \\"rz\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [7], \\"gate\\": \\"rz\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [8], \\"gate\\": \\"rz\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [9], \\"gate\\": \\"rz\\", \\"wires\\": [4]},\\r\\n {\\"input_idx\\": [10], \\"gate\\": \\"rx\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [11], \\"gate\\": \\"rx\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [12], \\"gate\\": \\"rx\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [13], \\"gate\\": \\"rx\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [14], \\"gate\\": \\"rx\\", \\"wires\\": [4]},\\r\\n {\\"input_idx\\": [15], \\"gate\\": \\"ry\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [16], \\"gate\\": \\"ry\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [17], \\"gate\\": \\"ry\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [18], \\"gate\\": \\"ry\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [19], \\"gate\\": \\"ry\\", \\"wires\\": [4]},\\r\\n {\\"input_idx\\": [20], \\"gate\\": \\"rz\\", \\"wires\\": [0]},\\r\\n {\\"input_idx\\": [21], \\"gate\\": \\"rz\\", \\"wires\\": [1]},\\r\\n {\\"input_idx\\": [22], \\"gate\\": \\"rz\\", \\"wires\\": [2]},\\r\\n {\\"input_idx\\": [23], \\"gate\\": \\"rz\\", \\"wires\\": [3]},\\r\\n {\\"input_idx\\": [24], \\"gate\\": \\"rz\\", \\"wires\\": [4]},\\r\\n ]) # Encode 16 features into 4 qubits\\r\\n \\r\\n layers = []\\r\\n for _ in range(4):\\r\\n layers.extend([\\r\\n Gate(cnot_matrix, [0, 1], 0),\\r\\n Gate(cnot_matrix, [1, 2], 0),\\r\\n Gate(cnot_matrix, [2, 3], 0),\\r\\n Gate(cnot_matrix, [3, 4], 0),\\r\\n Gate(cnot_matrix, [4, 0], 0),\\r\\n Gate(rx_matrix, [0], 1),\\r\\n Gate(rx_matrix, [1], 1),\\r\\n Gate(rx_matrix, [2], 1),\\r\\n Gate(rx_matrix, [3], 1),\\r\\n Gate(rx_matrix, [4], 1),\\r\\n Gate(cu3_matrix, [1, 0], 3),\\r\\n Gate(cu3_matrix, [2, 1], 3),\\r\\n Gate(cu3_matrix, [3, 2], 3),\\r\\n Gate(cu3_matrix, [4, 3], 3),\\r\\n Gate(cu3_matrix, [0, 4], 3),\\r\\n Gate(u3_matrix, [0], 3),\\r\\n Gate(u3_matrix, [1], 3),\\r\\n Gate(u3_matrix, [2], 3),\\r\\n Gate(u3_matrix, [3], 3),\\r\\n Gate(u3_matrix, [4], 3),\\r\\n ])\\r\\n self.qnn = nn.Sequential(*layers)\\r\\n \\r\\n def forward(self, x):\\r\\n state = torch.zeros(x.shape[0], 2**self.n_wires, dtype=torch.complex64, device=x.device).reshape(x.shape[0], 2, 2, 2, 2, 2)\\r\\n state[:, 0, 0, 0, 0, 0] = 1 # Initialize the state to |0001>\\r\\n state = self.encoding(state, x.view(x.shape[0], -1)) # Encode the input features\\r\\n state = self.qnn(state)\\r\\n measured = measure_pauli_expectations(state, pauli_z_matrix())\\r\\n return F.log_softmax(measured, dim=-1)\\r\\n```\\r\\n\\r\\n### Dataset\\r\\n\\r\\nWe will process the MNIST to include only first 5 digits and resize it to $5 \\\\times 5$.\\r\\n\\r\\n```python\\r\\nclass MNISTDigitsDataset(datasets.MNIST):\\r\\n def __init__(self, root, train=True, transform=None, target_transform=None, download=False):\\r\\n super().__init__(root, train=train, transform=transform, target_transform=target_transform, download=download)\\r\\n # Filter indices for digits 0 to 3\\r\\n indices = [i for i, label in enumerate(self.targets) if label in [0, 1, 2, 3, 4]]\\r\\n self.data = self.data[indices]\\r\\n self.targets = self.targets[indices]\\r\\n\\r\\n def __getitem__(self, index):\\r\\n with torch.no_grad():\\r\\n # Get the image and target label\\r\\n img, target = self.data[index], int(self.targets[index])\\r\\n \\r\\n # Convert image to PIL for transformations\\r\\n img = transforms.functional.to_pil_image(img)\\r\\n \\r\\n # Apply transformations if any\\r\\n if self.transform:\\r\\n img = self.transform(img)\\r\\n \\r\\n if self.target_transform:\\r\\n target = self.target_transform(target)\\r\\n \\r\\n return img, target\\r\\n\\r\\n def __len__(self):\\r\\n return len(self.data)\\r\\n\\r\\ntransform = transforms.Compose([\\r\\n transforms.Resize((5, 5)), # Resize the image to 5x5\\r\\n transforms.ToTensor() # Convert the image to a PyTorch tensor\\r\\n])\\r\\n\\r\\n# Initialize the dataset\\r\\ntrain_dataset = MNISTDigitsDataset(root=\'./data\', train=True, transform=transform, download=True)\\r\\nvalid_dataset = MNISTDigitsDataset(root=\'./data\', train=False, transform=transform, download=True)\\r\\n\\r\\n# Create the DataLoader\\r\\nbatch_size = 32\\r\\ntrain_dataloader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True)\\r\\nvalid_dataloader = DataLoader(valid_dataset, batch_size=batch_size, shuffle=False)\\r\\n```\\r\\n\\r\\n### Training Loop\\r\\n\\r\\n```python\\r\\ndevice = torch.device(\'cuda\' if torch.cuda.is_available() else \'cpu\')\\r\\nmodel = VQC().to(device)\\r\\n\\r\\nloss_fn = nn.NLLLoss()\\r\\noptimizer = torch.optim.Adam(model.parameters(), lr=0.01)\\r\\n\\r\\n# Training loop\\r\\nnum_epochs = 5\\r\\ntrain_losses = []\\r\\nvalid_losses = []\\r\\nvalid_accuracies = []\\r\\nfor epoch in range(num_epochs):\\r\\n for batch, (images, labels) in enumerate(train_dataloader):\\r\\n images, labels = images.to(device), labels.to(device)\\r\\n optimizer.zero_grad()\\r\\n outputs = model(images)\\r\\n loss = loss_fn(outputs, labels)\\r\\n loss.backward()\\r\\n optimizer.step()\\r\\n train_losses.append(loss.item())\\r\\n \\r\\n if (batch + 1) % 50 == 0:\\r\\n print(f\\"Epoch {epoch + 1}/{num_epochs}, Iteration: {batch+1}, Loss: {loss.item()}\\")\\r\\n if batch == 500:\\r\\n break # Stop early to speed up the training process\\r\\n \\r\\n # Validation loop\\r\\n model.eval()\\r\\n with torch.no_grad():\\r\\n total = 0\\r\\n correct = 0\\r\\n for batch, (images, labels) in enumerate(valid_dataloader):\\r\\n images, labels = images.to(device), labels.to(device)\\r\\n outputs = model(images)\\r\\n loss = loss_fn(outputs, labels)\\r\\n valid_losses.append(loss.item())\\r\\n \\r\\n _, predicted = torch.max(outputs, 1)\\r\\n total += labels.size(0)\\r\\n correct += (predicted == labels).sum().item()\\r\\n\\r\\n if batch == 100:\\r\\n break # Stop early to speed up the validation process\\r\\n \\r\\n accuracy = correct / total\\r\\n valid_accuracies.append(accuracy)\\r\\n print(f\\"Validation accuracy: {accuracy}, Loss: {loss.item()}\\")\\r\\n model.train()\\r\\n```\\r\\n\\r\\nAnd finally plot the result:\\r\\n\\r\\n```python\\r\\n# plot\\r\\nplt.plot(train_losses, label=\'Training loss\')\\r\\nplt.plot(valid_losses, label=\'Validation loss\')\\r\\nplt.xlabel(\'Iterations\')\\r\\nplt.ylabel(\'Loss\')\\r\\nplt.legend()\\r\\nplt.title(\'Training and Validation Loss\')\\r\\nplt.show()\\r\\n\\r\\nplt.plot(valid_accuracies)\\r\\nplt.xlabel(\'Iterations\')\\r\\nplt.ylabel(\'Accuracy\')\\r\\nplt.title(\'Validation Accuracy\')\\r\\nplt.show()\\r\\n```"},{"id":"intro-to-quantum-computing","metadata":{"permalink":"/blog/intro-to-quantum-computing","source":"@site/blog/2024-1-5-intro-to-quantum-computing/index.md","title":"Introduction to Quantum Computing","description":"The basics of quantum computing and some hands-on trying.","date":"2024-01-05T00:00:00.000Z","tags":[{"label":"beginners","permalink":"/blog/tags/beginners"},{"label":"quantum","permalink":"/blog/tags/quantum"},{"label":"qiskit","permalink":"/blog/tags/qiskit"},{"label":"pytorch","permalink":"/blog/tags/pytorch"},{"label":"tutorial","permalink":"/blog/tags/tutorial"}],"readingTime":9.28,"hasTruncateMarker":true,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"intro-to-quantum-computing","title":"Introduction to Quantum Computing","authors":"eason","tags":["beginners","quantum","qiskit","pytorch","tutorial"]},"unlisted":false,"prevItem":{"title":"Introduction to Quantum Neural Networks","permalink":"/blog/intro-to-qnn"},"nextItem":{"title":"Introduction to PyTorch","permalink":"/blog/intro-to-pytorch"}},"content":"The basics of quantum computing and some hands-on trying.\\r\\n\\r\\n\x3c!--truncate--\x3e\\r\\n\\r\\n## Prerequisites\\r\\n- Basic Maths — matrix multiplications\\r\\n- Basic quantum mechanics concepts — Superposition, Wave-Particle Duality, the Uncertainty Principle, and Entanglement\\r\\n- Basic Python\\r\\n- Imagination power\\r\\n\\r\\n## Quantum Mechanics\\r\\n> \u201cThe mathematical framework of quantum theory has passed countless successful tests and is now universally accepted as a consistent and accurate description of all atomic phenomena.\u201d ~ Erwin Schr\xf6dinger\\r\\n\\r\\nWe will not be talking about the advanced maths or concepts of quantum mechanics in this blog post, such as the Uncertainty Principle or the Schr\xf6dinger Equation, but I\'ll assume you know the main principles of Quantum Mechanics, including Superposition, Wave-Particle Duality, the Uncertainty Principle, and Entanglement. The concept of qubits and quantum circuits gates will be explained below.\\r\\n\\r\\n### Qubits\\r\\nIn normal semiconductor computers, each \\"bit\\" can only represent two values: 0 and 1, which can be used in calculations as low and high voltage. However, in quantum computers, \\"qubits\\" (quantum bit) are used. Now instead of representing only 0 **or** 1, it can now represent 0 **and** 1 simultaneously. It carries a \\"state\\" $|\\\\psi\\\\rangle$, which is a vector defined as followed in a qubit:\\r\\n\\r\\n$$\\r\\n|\\\\psi\\\\rangle = \\\\alpha |0\\\\rangle + \\\\beta |1\\\\rangle\\r\\n$$\\r\\n\\r\\nWhere\\r\\n\\r\\n$$\\r\\n|\\\\alpha|^2 + |\\\\beta|^2 = 1\\r\\n$$\\r\\n\\r\\n$\\\\alpha$ and $\\\\beta$ represents the **probabilities** or the qubit in the $|0\\\\rangle$ and $|1\\\\rangle$ states respectively, and are **complex numbers**.\\r\\n\\r\\nNow, if we have two qubits entangled, we can represent $2^2 = 4$ states ($00, 01, 10, 11$), each associated with a probability.\\r\\n\\r\\n$$\\r\\n|\\\\psi\\\\rangle = c_1 |0\\\\rangle + c_2 |1\\\\rangle\\r\\n$$\\r\\n$$\\r\\n|\\\\phi\\\\rangle = c_3 |0\\\\rangle + c_4 |1\\\\rangle\\r\\n$$\\r\\n$$\\r\\n|combined\\\\rangle = c_1c_3 |00\\\\rangle + c_1c_4 |01\\\\rangle + c_2c_3 |10\\\\rangle + c_2c_4 |11\\\\rangle\\r\\n$$\\r\\n\\r\\nThe power of quantum computing is you can represent $2^n$ states if you have $n$ qubits, which is an exponential growth. For example, if you have 20 qubits, you can represent $2^{20} = 1048576$ states, but in a classical computer, it is only 20! If you have 266 qubits, you can represent nearly $10^{80}$ states, which is about the number of atoms in the observable universe! Every single \\"operation\\" you perform on these qubits instantly affects its $2^n$ states. Now we will talk about these \\"operations\\" — quantum circuit gates.\\r\\n\\r\\n### Gates\\r\\n\\r\\nTo visualize a single qubit, you can use the Bloch Sphere:\\r\\n![Bloch Sphere](bloch_sphere.png)\\r\\nThe z-axis means the probability in being measured in $|0\\\\rangle$ and $|1\\\\rangle$. X-axis and y-axis are also similar.\\r\\n\\r\\n:::info\\r\\n$$\\r\\n|+\\\\rangle = \\\\frac{1}{\\\\sqrt{2}}(|0\\\\rangle + |1\\\\rangle)\\r\\n$$\\r\\n$$\\r\\n|-\\\\rangle = \\\\frac{1}{\\\\sqrt{2}}(|0\\\\rangle - |1\\\\rangle)\\r\\n$$\\r\\n$$\\r\\n|+i\\\\rangle = \\\\frac{1}{\\\\sqrt{2}}(|0\\\\rangle - i|1\\\\rangle)\\r\\n$$\\r\\n$$\\r\\n|-i\\\\rangle = \\\\frac{1}{\\\\sqrt{2}}(|0\\\\rangle - i|1\\\\rangle)\\r\\n$$\\r\\n:::\\r\\n\\r\\nQuantum circuit gates can be visualized as rotating the state (the red arrow) in the bloch sphere. Here are some examples:\\r\\n\\r\\n1. **Pauli-X Gate (NOT Gate)**:\\r\\n - Rotation: $$ \\\\pi $$ radians (180 degrees) around the X-axis.\\r\\n - Effect: Transforms the state $$ |0\\\\rangle $$ to $$ |1\\\\rangle $$ and vice versa. On the Bloch sphere, it flips the state from the north pole to the south pole and vice versa.\\r\\n\\r\\n2. **Pauli-Y Gate**:\\r\\n - Rotation: $$ \\\\pi $$ radians (180 degrees) around the Y-axis.\\r\\n - Effect: Applies a complex phase and swaps the states $$ |0\\\\rangle $$ and $$ |1\\\\rangle $$. For example, $$ |0\\\\rangle $$ becomes $$ i|1\\\\rangle $$ and $$ |1\\\\rangle $$ becomes $$ -i|0\\\\rangle $$.\\r\\n\\r\\n3. **Pauli-Z Gate**:\\r\\n - Rotation: $$ \\\\pi $$ radians (180 degrees) around the Z-axis.\\r\\n - Effect: Leaves the state $$ |0\\\\rangle $$ unchanged and adds a phase of $$ \\\\pi $$ (equivalent to a factor of -1) to the state $$ |1\\\\rangle $$.\\r\\n\\r\\n4. **Hadamard Gate (H Gate)**:\\r\\n - Rotation: This gate performs a more complex transformation, equivalent to rotating around the axis at 45 degrees from both X and Z axes, followed by a $$ \\\\pi $$ radian rotation around the Y-axis.\\r\\n - Effect: Creates superpositions from basis states, turning $$ |0\\\\rangle $$ into $$ \\\\frac{|0\\\\rangle + |1\\\\rangle}{\\\\sqrt{2}} $$ and $$ |1\\\\rangle $$ into $$ \\\\frac{|0\\\\rangle - |1\\\\rangle}{\\\\sqrt{2}} $$.\\r\\n\\r\\n5. **S Gate (Phase Gate)**:\\r\\n - Rotation: $$ \\\\frac{\\\\pi}{2} $$ radians (90 degrees) around the Z-axis.\\r\\n - Effect: Leaves the state $$ |0\\\\rangle $$ unchanged and multiplies the state $$ |1\\\\rangle $$ by $$ i $$.\\r\\n\\r\\n6. **T Gate**:\\r\\n - Rotation: $$ \\\\frac{\\\\pi}{4} $$ radians (45 degrees) around the Z-axis.\\r\\n - Effect: Leaves the state $$ |0\\\\rangle $$ unchanged and multiplies the state $$ |1\\\\rangle $$ by $$ e^{i\\\\pi/4} $$, which is a more subtle phase shift than the S gate.\\r\\n\\r\\nAnd some parameterized gates:\\r\\n\\r\\n7. **RX Gate**:\\r\\n - Rotation: $$\\\\theta$$ radians around the X-axis. It can be represented as a matrix multiplication between the unitary gate matrix and the quantum states, the gate matrix is:\\r\\n\\r\\n$$\\r\\nR_x(\\\\theta) = \\\\begin{bmatrix}\\r\\n\\\\cos\\\\left(\\\\frac{\\\\theta}{2}\\\\right) & -i\\\\sin\\\\left(\\\\frac{\\\\theta}{2}\\\\right) \\\\\\\\\\r\\n-i\\\\sin\\\\left(\\\\frac{\\\\theta}{2}\\\\right) & \\\\cos\\\\left(\\\\frac{\\\\theta}{2}\\\\right)\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\n\\r\\n8. **RY Gate**:\\r\\n - Rotation: $$\\\\theta$$ radians around the y-axis:\\r\\n$$\\r\\nR_y(\\\\theta) = \\\\begin{bmatrix}\\r\\n\\\\cos\\\\left(\\\\frac{\\\\theta}{2}\\\\right) & -\\\\sin\\\\left(\\\\frac{\\\\theta}{2}\\\\right) \\\\\\\\\\r\\n\\\\sin\\\\left(\\\\frac{\\\\theta}{2}\\\\right) & \\\\cos\\\\left(\\\\frac{\\\\theta}{2}\\\\right)\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\n\\r\\n8. **RZ Gate**:\\r\\n - Rotation: $$\\\\theta$$ radians around the z-axis:\\r\\n$$\\r\\nR_z(\\\\theta) = \\\\begin{bmatrix}\\r\\ne^{-i\\\\theta/2} & 0 \\\\\\\\\\r\\n0 & e^{i\\\\theta/2}\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\n\\r\\nAnd much more.\\r\\n\\r\\n:::danger[INFO]\\r\\nEvery gate can be represented as an unitary gate matrix, e.g. the Hadamard Gate:\\r\\n$$\\r\\nH = \\\\frac{1}{\\\\sqrt{2}}\\\\begin{bmatrix}\\r\\n1 & 1 \\\\\\\\\\r\\n1 & -1\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\n:::\\r\\n\\r\\nAlso, there are double-qubits gate, for example the CNOT (Controlled-NOT) gate:\\r\\n$$\\r\\nCNOT = \\\\begin{bmatrix}\\r\\n1 & 0 & 0 & 0 \\\\\\\\\\r\\n0 & 1 & 0 & 0 \\\\\\\\\\r\\n0 & 0 & 0 & 1 \\\\\\\\\\r\\n0 & 0 & 1 & 0\\r\\n\\\\end{bmatrix}\\r\\n$$\\r\\nControlled gates mean if the first qubit is $|1\\\\rangle$, then the gate (NOT in this case) on second qubit will be performed. There are even triple-qubits gates, like the Toffoli gate (aka CCNOT), which has a $2^n \\\\times 2^n = 8 \\\\times 8$ size gate matrix.\\r\\n\\r\\nIf you have a quantum states, say 10 qubits, and you want to apply a specific gate on a specific qubit, you can use the Kronecker product to construct a $2^n \\\\times 2^n$ gate matrix and apply it to the quantum states, for example you want to apply the Hadamard gate on the 4th qubit:\\r\\n\\r\\n$$\\r\\n|\\\\psi_{t+1}\\\\rangle = |\\\\psi_t\\\\rangle \\\\times (I \\\\otimes I \\\\otimes I \\\\otimes \\\\frac{1}{\\\\sqrt{2}}\\\\begin{bmatrix}1 & 1 \\\\\\\\ 1 & -1\\\\end{bmatrix} \\\\otimes I \\\\otimes I \\\\otimes I \\\\otimes I \\\\otimes I \\\\otimes I)\\r\\n$$\\r\\n\\r\\n:::tip\\r\\n$I$ is the identity matrix, i.e. $\\\\begin{bmatrix}1 & 0 \\\\\\\\ 0 & 1\\\\end{bmatrix}$\\r\\n:::\\r\\n\\r\\nThese quantum gates are crucial in constructing quantum circuits for algorithms, where each type of gate contributes to manipulating the qubit\'s state in a controlled manner to achieve various computational goals.\\r\\n\\r\\n## Simulation with Qiskit\\r\\n\\r\\nQiskit is an open-source framework for quantum computing. It provides the tools for creating quantum circuits, simulating them, and running them on real quantum hardware through IBM\'s cloud services.\\r\\n\\r\\n### Setting Up Your Environment\\r\\n\\r\\nTo start using Qiskit, make sure Python is installed on your machine, then install Qiskit and Qiskit Aer, which includes simulators that run on your local machine.\\r\\n\\r\\n```bash\\r\\npip install qiskit qiskit-aer pylatexenc\\r\\n```\\r\\n\\r\\n### Single Qubit Operations\\r\\n\\r\\n#### Building the Circuit\\r\\n\\r\\nWe\'ll begin with a basic single-qubit circuit to demonstrate sequential gate operations that include rotations and a phase shift.\\r\\n\\r\\n```python\\r\\nfrom qiskit import QuantumCircuit, transpile\\r\\nfrom qiskit_aer import Aer\\r\\nfrom qiskit.visualization import plot_bloch_multivector\\r\\n\\r\\n# Initialize a Quantum Circuit with 1 qubit\\r\\nqc_single = QuantumCircuit(1)\\r\\n\\r\\n# Apply rotation around the X-axis\\r\\nqc_single.rx(3.14159 / 4, 0) # Pi/4 rotation\\r\\n\\r\\n# Apply rotation around the Y-axis\\r\\nqc_single.ry(3.14159 / 2, 0) # Pi/2 rotation\\r\\n\\r\\n# Apply a Z gate\\r\\nqc_single.z(0)\\r\\n\\r\\n# Visualize the circuit\\r\\nprint(\\"Single Qubit Circuit:\\")\\r\\nprint(qc_single.draw(output=\'mpl\'))\\r\\n```\\r\\n\\r\\n#### Calculating the Expected State Vector\\r\\n\\r\\nThe state vector undergoes a rotation by $$\\\\pi/4$$ radians around the X-axis, followed by $$\\\\pi/2$$ around the Y-axis, and finally, a phase shift due to the Z gate.\\r\\n\\r\\n#### Simulation and Output\\r\\n\\r\\n```python\\r\\n# Prepare the simulator\\r\\nsimulator = Aer.get_backend(\'statevector_simulator\')\\r\\n\\r\\n# Transpile the circuit for the simulator\\r\\ntranspiled_qc = transpile(qc_single, simulator)\\r\\n\\r\\n# Run the simulation\\r\\njob = simulator.run(transpiled_qc)\\r\\nresult = job.result()\\r\\n\\r\\n# Get the final state vector\\r\\nstatevector = result.get_statevector()\\r\\nprint(statevector)\\r\\n\\r\\n# Plot the state on the Bloch sphere\\r\\nplot_bloch_multivector(statevector)\\r\\n```\\r\\n\\r\\n### Multi-Qubit Operations\\r\\n\\r\\n#### Building the Circuit\\r\\n\\r\\nWe will construct a five-qubit circuit with a combination of entanglement, rotations, and phase shifts to demonstrate the interplay of different quantum gates.\\r\\n\\r\\n```python\\r\\nfrom qiskit import QuantumCircuit, transpile\\r\\nfrom qiskit_aer import Aer\\r\\nfrom qiskit.visualization import plot_bloch_multivector\\r\\nfrom math import pi\\r\\n\\r\\n# Initialize a Quantum Circuit with 5 qubits\\r\\nqc_multi = QuantumCircuit(5)\\r\\n\\r\\n# Apply a Hadamard gate to qubit 0\\r\\nqc_multi.h(0)\\r\\n\\r\\n# Apply a CNOT gate between qubit 0 and qubit 1\\r\\nqc_multi.cx(0, 1)\\r\\n\\r\\n# Apply a rotation around the X-axis by pi/2 on qubit 1\\r\\nqc_multi.rx(pi / 2, 1)\\r\\n\\r\\n# Apply a T gate to qubit 2\\r\\nqc_multi.t(2)\\r\\n\\r\\n# Apply a CNOT gate between qubit 1 and qubit 2\\r\\nqc_multi.cx(1, 2)\\r\\n\\r\\n# Apply a rotation around the Z-axis by pi/4 on qubit 3\\r\\nqc_multi.rz(pi / 4, 3)\\r\\n\\r\\n# Apply a Hadamard gate to qubit 4\\r\\nqc_multi.h(4)\\r\\n\\r\\n# Apply a CNOT gate between qubit 4 and qubit 3\\r\\nqc_multi.cx(4, 3)\\r\\n\\r\\n# Apply a CNOT gate between qubit 1 and qubit 4\\r\\nqc_multi.cx(1, 4)\\r\\n\\r\\n# Visualize the Circuit\\r\\nprint(\\"Five-Qubit Circuit:\\")\\r\\nprint(qc_multi.draw(output=\'mpl\'))\\r\\n```\\r\\n\\r\\n#### Calculating the Expected State Vector\\r\\n\\r\\nNow let\'s calculate the expected state vector after applying the specified sequence of gates:\\r\\n\\r\\n1. **Initial State**: All qubits start in the state $|00000\\\\rangle$.\\r\\n\\r\\n2. **After $ H(0) $**: Creates a superposition on qubit 0.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + |10000\\\\rangle)$\\r\\n\\r\\n3. **After $ \\\\text{CNOT}(0, 1) $**: Entangles qubits 0 and 1.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + |11000\\\\rangle)$\\r\\n\\r\\n4. **After $ \\\\text{RX}(1, \\\\pi/2) $**: Applies a $ \\\\pi/2 $ rotation on qubit 1, transforming its basis states.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + i|11000\\\\rangle)$\\r\\n\\r\\n5. **After $ T(2) $**: Adds a phase of $ \\\\pi/4 $ to the state of qubit 2.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + ie^{i\\\\pi/4}|11000\\\\rangle)$\\r\\n\\r\\n6. **After $ \\\\text{CNOT}(1, 2) $**: Conditionally flips qubit 2 based on qubit 1.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + ie^{i\\\\pi/4}|11100\\\\rangle)$\\r\\n\\r\\n7. **After $ \\\\text{RZ}(3, \\\\pi/4) $**: Adds a phase of $ \\\\pi/4 $ to qubit 3.\\r\\n $\\\\frac{1}{\\\\sqrt{2}} (|00000\\\\rangle + ie^{i\\\\pi/4}|11100\\\\rangle)$ (no change in basis states, just a phase on the amplitude if qubit 3 were in state |1|)\\r\\n\\r\\n8. **After $ H(4) $**: Creates a superposition on qubit 4.\\r\\n $\\\\frac{1}{2} (|00000\\\\rangle + |00001\\\\rangle + ie^{i\\\\pi/4}|11100\\\\rangle + ie^{i\\\\pi/4}|11101\\\\rangle)$\\r\\n\\r\\n9. **After $ \\\\text{CNOT}(4, 3) $**: Conditionally flips qubit 3 based on qubit 4.\\r\\n $\\\\frac{1}{2} (|00000\\\\rangle + |00001\\\\rangle + ie^{i\\\\pi/4}|11110\\\\rangle + ie^{i\\\\pi/4}|11111\\\\rangle)$\\r\\n\\r\\n10. **After $ \\\\text{CNOT}(1, 4) $**: Conditionally flips qubit 4 based on qubit 1.\\r\\n $\\\\frac{1}{2} (|00000\\\\rangle + |00001\\\\rangle + ie^{i\\\\pi/4}|11010\\\\rangle + ie^{i\\\\pi/4}|11011\\\\rangle)$\\r\\n\\r\\n#### Simulation and Output\\r\\n\\r\\n```python\\r\\n# Prepare the simulator\\r\\nsimulator = Aer.get_backend(\'statevector_simulator\')\\r\\n\\r\\n# Transpile the circuit for the simulator\\r\\ntranspiled_qc = transpile(qc_multi, simulator)\\r\\n\\r\\n# Run the simulation\\r\\njob = simulator.run(transpiled_qc)\\r\\nresult = job.result()\\r\\n\\r\\n# Get the final state vector\\r\\nstatevector = result.get_statevector()\\r\\nprint(statevector)\\r\\n\\r\\n# Plot the state on the Bloch sphere\\r\\nplot_bloch_multivector(statevector)\\r\\n```\\r\\n\\r\\n## Tasks you may do\\r\\n1. Implement Shor\'s Algorithm for finding the prime factors of an integer.\\r\\n2. Implement Grover\'s Algorithm for an unstructured search that finds with high probability the unique input to a black box function that produces a particular output value."},{"id":"intro-to-pytorch","metadata":{"permalink":"/blog/intro-to-pytorch","source":"@site/blog/2023-12-13-intro-to-pytorch/index.md","title":"Introduction to PyTorch","description":"This blog post will be about some basic introductions to PyTorch, including tensors, and how to train your own model in PyTorch.","date":"2023-12-13T00:00:00.000Z","tags":[{"label":"beginners","permalink":"/blog/tags/beginners"},{"label":"nn","permalink":"/blog/tags/nn"},{"label":"pytorch","permalink":"/blog/tags/pytorch"},{"label":"tutorial","permalink":"/blog/tags/tutorial"},{"label":"tired","permalink":"/blog/tags/tired"}],"readingTime":5.835,"hasTruncateMarker":true,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"intro-to-pytorch","title":"Introduction to PyTorch","authors":"eason","tags":["beginners","nn","pytorch","tutorial","tired"]},"unlisted":false,"prevItem":{"title":"Introduction to Quantum Computing","permalink":"/blog/intro-to-quantum-computing"},"nextItem":{"title":"The Most Basics of Neural Networks","permalink":"/blog/basic-of-nn"}},"content":"This blog post will be about some basic introductions to PyTorch, including tensors, and how to train your own model in PyTorch.\\r\\n\\r\\n\x3c!--truncate--\x3e\\r\\n\\r\\n## Prerequisites\\r\\n- Basic Maths\\r\\n- Basic Python\\r\\n- Common Sense\\r\\n\\r\\n## Aims\\r\\n1.\\tUnderstand tensors\\r\\n2.\\tUnderstand the steps to build and train a model in PyTorch\\r\\n\\r\\n## Introduction\\r\\n> \u201cArtificial Intelligence, deep learning, machine learning \u2014 whatever you\'re doing if you don\'t understand it \u2014 learn it. Because otherwise you\'re going to be a dinosaur within 3 years.\u201d ~ Mark Cuban.\\r\\n\\r\\n## Tensors\\r\\n[https://pytorch.org/tutorials/beginner/basics/tensorqs_tutorial.html](https://pytorch.org/tutorials/beginner/basics/tensorqs_tutorial.html)\\r\\n\\r\\nTensors are specialized arrays or matrices. It can have as many dimensions as you want. We use tensors to encode the data in the PyTorch, as well as the model parameters. Specifically, if you perform operations on a PyTorch tensor (e.g. addition, multiplication), your action will be saved into PyTorch\u2019s built-in dynamic computation graph, which is necessary for model backpropagation in training.\\r\\n\\r\\nHere\u2019s an example of some tensors: \\r\\n\\r\\n```python\\r\\nimport torch\\r\\n\\r\\n# Create a tensor from a list/array:\\r\\n\\r\\ndata1 = [0, 1, 2, 3, 4, 5] # 1D array\\r\\ndata2 = [[0, 1], [2, 3], [4, 5]] # 2D array\\r\\n\\r\\ntensor1 = torch.tensor(data1)\\r\\ntensor2 = torch.tensor(data2)\\r\\n\\r\\nprint(tensor1.shape) # torch.Size([6])\\r\\nprint(tensor2.shape) # torch.Size([3, 2])\\r\\n\\r\\n# Create a tensor filled with zeros or ones:\\r\\n\\r\\nzeros_tensor = torch.zeros(3, 5, 4, 2, 1, 4) # A 6D tensor\\r\\nones_tensor = torch.ones(3, 5)\\r\\n\\r\\n# Create a random tensor from a specified shape:\\r\\n\\r\\nrandom_tensor1 = torch.randn(10, 20) # A 10 by 20 tensor with normal distribution\\r\\nprint(random_tensor1.shape) # torch.Size([10, 20])\\r\\nprint(random_tensor1[0, :10]) # You can use python array index slicing\\r\\n\\r\\nrandom_tensor2 = torch.randint(0, 100, (5, 10)) # 5 by 10 tensor with integer values ranging from 0 to 100\\r\\nprint(random_tensor2[0, 3:10])\\r\\n\\r\\n# Attributes of a tensor:\\r\\n\\r\\nprint(tensor1.shape)\\r\\nprint(tensor1.dtype) # data type, e.g. float32, int64, float64, Bfloat16\\r\\nprint(tensor1.device) # device the tensor is stored on, e.g. cpu, cuda\\r\\n```\\r\\n\\r\\n## Training a Simple Model in PyTorch\\r\\n\\r\\nThe steps of training a model in PyTorch includes:\\r\\n1.\\tFind a dataset that suits your problem, download it, and create a dataloader.\\r\\n2.\\tDefine your model, you can create your own model module using `nn.Module`.\\r\\n3.\\tDefine your loss function (from `torch.nn`), optimizers (from `torch.optim`), etc.\\r\\n4.\\tDefine your training loop, it can be a function that does a single step and write a loop, or just simply a training loop.\\r\\n5.\\tStart training!\\r\\n\\r\\nFor this example, we are going to use the MNIST dataset, which is built-in in PyTorch, making it very easy to download and use.\\r\\n\\r\\nFirst import the necessary libraries:\\r\\n```python\\r\\nimport torch\\r\\nfrom torch import nn\\r\\nfrom torch.utils.data import DataLoader\\r\\nfrom torchvision import datasets\\r\\nfrom torchvision.transforms import ToTensor\\r\\n```\\r\\n\\r\\n### Finding and defining your dataset\\r\\n\\r\\nPyTorch offers domain-specific libraries such as TorchText, TorchVision, and TorchAudio, all of which include datasets. For this tutorial, we will be using a TorchVision dataset.\\r\\n\\r\\nThe `torchvision.datasets` module contains `Dataset` objects for many real-world vision data like CIFAR, COCO. In this tutorial, we use the FashionMNIST dataset. Every TorchVision `Dataset` includes two arguments: `transform` and `target_transform` to modify the samples and labels respectively.\\r\\n\\r\\n```python\\r\\n# Download training data from the MNIST dataset.\\r\\ntraining_data = datasets.FashionMNIST(\\r\\n root=\\"data\\",\\r\\n train=True,\\r\\n download=True,\\r\\n transform=ToTensor(), # Convert to PyTorch tensor.\\r\\n)\\r\\n\\r\\n# Download test data from the MNIST dataset.\\r\\ntest_data = datasets.FashionMNIST(\\r\\n root=\\"data\\",\\r\\n train=False,\\r\\n download=True,\\r\\n transform=ToTensor(),\\r\\n)\\r\\n```\\r\\n\\r\\nWe pass the `Dataset` as an argument to `DataLoader`. This wraps an iterable over our dataset, and supports automatic batching, sampling, shuffling and multiprocess data loading. Here we define a batch size of 64, i.e. each element in the dataloader iterable will return a batch of 64 features and labels.\\r\\n\\r\\n```python\\r\\nbatch_size = 64\\r\\n\\r\\n# Create data loaders.\\r\\ntrain_dataloader = DataLoader(training_data, batch_size=batch_size)\\r\\ntest_dataloader = DataLoader(test_data, batch_size=batch_size)\\r\\n\\r\\nfor X, y in test_dataloader:\\r\\n print(f\\"Shape of X [N, C, H, W]: {X.shape}\\") # N, C, H, W stands for Batch Size, Channel Size, Height, and Width\\r\\n print(f\\"Shape of y: {y.shape} {y.dtype}\\")\\r\\n break\\r\\n```\\r\\n\\r\\n### Create the model\\r\\n\\r\\nTo define a neural network in PyTorch, we create a class that inherits from nn.Module. We define the layers of the network in the `__init__` function and specify how data will pass through the network in the forward function. To accelerate operations in the neural network, we move it to the GPU (`cuda`) or MPS if available.\\r\\n\\r\\n```python\\r\\n# Get cpu, gpu (cuda) device for training.\\r\\ndevice = (\\r\\n \\"cuda\\" if torch.cuda.is_available() else \\"cpu\\"\\r\\n)\\r\\nprint(f\\"Using {device} device\\")\\r\\n\\r\\n# Define model\\r\\nclass NeuralNetwork(nn.Module):\\r\\n def __init__(self):\\r\\n super().__init__()\\r\\n self.flatten = nn.Flatten() # Flattens to (Batch Size, Channel Size * Height * Width), from a 4D tensor to a 2D tensor\\r\\n self.linear_relu_stack = nn.Sequential(\\r\\n nn.Linear(28*28, 512), # Fully-connected hidden layer\\r\\n nn.ReLU(), # Activation Function\\r\\n nn.Linear(512, 512),\\r\\n nn.ReLU(),\\r\\n nn.Linear(512, 10)\\r\\n ) # When `linear_relu_stack` is called, it will run all the modules inside in order.\\r\\n\\r\\n def forward(self, x):\\r\\n x = self.flatten(x) # flatten to 2D, same as x.view(x.size(0), -1)\\r\\n logits = self.linear_relu_stack(x) # the nn.Sequential instance\\r\\n return logits\\r\\n\\r\\n# Create an instance\\r\\nmodel = NeuralNetwork().to(device)\\r\\nprint(model)\\r\\n```\\r\\n\\r\\n[Learn More About Building Neural Networks in PyTorch Here](https://pytorch.org/tutorials/beginner/basics/buildmodel_tutorial.html)\\r\\n\\r\\n### Define the Loss Function and the Optimizer\\r\\n\\r\\nWe are using the Cross Entropy Loss loss function and the Stochastic Gradient Descent (SGD) optimizer for training this model.\\r\\n\\r\\n```python\\r\\nloss_fn = nn.CrossEntropyLoss()\\r\\noptimizer = torch.optim.SGD(model.parameters(), lr=1e-3)\\r\\n```\\r\\n\\r\\n### Define the training loop\\r\\n\\r\\nFirst we define the function to train a single step:\\r\\n\\r\\n```python\\r\\ndef train(dataloader, model, loss_fn, optimizer):\\r\\n size = len(dataloader.dataset)\\r\\n model.train()\\r\\n for batch, (X, y) in enumerate(dataloader):\\r\\n X, y = X.to(device), y.to(device) # Move tensors to cuda if available\\r\\n\\r\\n # Compute prediction error\\r\\n pred = model(X) # Forward pass\\r\\n loss = loss_fn(pred, y) # Compute loss\\r\\n\\r\\n # Backpropagation\\r\\n loss.backward() # Compute gradients\\r\\n optimizer.step() # Update parameters\\r\\n optimizer.zero_grad() # Zero the gradients\\r\\n\\r\\n if batch % 100 == 0:\\r\\n loss, current = loss.item(), (batch + 1) * len(X)\\r\\n print(f\\"loss: {loss:>7f} [{current:>5d}/{size:>5d}]\\")\\r\\n```\\r\\n\\r\\nThen a function to evaluate (or validate). The goal of this is to check the model\u2019s performance against the test dataset to ensure it is learning, and monitor if it is overfitting.\\r\\n\\r\\n```python\\r\\ndef test(dataloader, model, loss_fn):\\r\\n size = len(dataloader.dataset)\\r\\n num_batches = len(dataloader)\\r\\n model.eval()\\r\\n test_loss, correct = 0, 0\\r\\n with torch.no_grad():\\r\\n for X, y in dataloader:\\r\\n X, y = X.to(device), y.to(device)\\r\\n pred = model(X)\\r\\n test_loss += loss_fn(pred, y).item()\\r\\n correct += (pred.argmax(1) == y).type(torch.float).sum().item()\\r\\n test_loss /= num_batches\\r\\n correct /= size\\r\\n print(f\\"Test Error: \\\\n Accuracy: {(100*correct):>0.1f}%, Avg loss: {test_loss:>8f} \\\\n\\")\\r\\n```\\r\\n\\r\\nThe training process is conducted over several iterations (epochs) that go over the entire training dataset. During each epoch, the model learns parameters to make better predictions. We print the model\u2019s accuracy and loss at each epoch; we\u2019d like to see the accuracy increase and the loss decrease with every epoch.\\r\\n\\r\\n```python\\r\\nepochs = 5\\r\\nfor t in range(epochs):\\r\\n print(f\\"Epoch {t+1}\\\\n-------------------------------\\")\\r\\n train(train_dataloader, model, loss_fn, optimizer)\\r\\n test(test_dataloader, model, loss_fn)\\r\\nprint(\\"Done!\\")\\r\\n```\\r\\n\\r\\n[Read More About Model Training Here](https://pytorch.org/tutorials/beginner/basics/optimization_tutorial.html)\\r\\n\\r\\n## Tasks\\r\\n\\r\\n1. Plot some graphs to show the training loss, validation loss, and validation accuracy over step.\\r\\n2. Experiment with different learning rate, batch size, and model architecture, how does it affect the results?"},{"id":"basic-of-nn","metadata":{"permalink":"/blog/basic-of-nn","source":"@site/blog/2023-11-13-basic-of-nn/index.md","title":"The Most Basics of Neural Networks","description":"This blog post will be about the most basics of neural networks, for absolute beginners.","date":"2023-11-13T00:00:00.000Z","tags":[{"label":"beginners","permalink":"/blog/tags/beginners"},{"label":"nn","permalink":"/blog/tags/nn"},{"label":"tutorial","permalink":"/blog/tags/tutorial"},{"label":"tired","permalink":"/blog/tags/tired"}],"readingTime":6.54,"hasTruncateMarker":true,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"basic-of-nn","title":"The Most Basics of Neural Networks","authors":"eason","tags":["beginners","nn","tutorial","tired"]},"unlisted":false,"prevItem":{"title":"Introduction to PyTorch","permalink":"/blog/intro-to-pytorch"},"nextItem":{"title":"Website Launch!","permalink":"/blog/website-launch"}},"content":"This blog post will be about the most basics of neural networks, for absolute beginners.\\r\\n\\r\\nYou\'ve heard about things like ChatGPT, LlaMa, Midjourney, Dall-E, and Stable Diffusion. But have you ever wondered how exactly does they work? In this blog series, I will explain the neural network, from the absolute basics to advanced, from simple fully-connected networks to Transformers, Quantum Neural Networks, and Graph Neural Networks. If you encountered any questions, feel free to ask by directly through my email or by Discord!\\r\\n\\r\\n\x3c!--truncate--\x3e\\r\\n\\r\\n## Prerequisites\\r\\n- Basic Maths\\r\\n- Basic Python\\r\\n- Common Sense\\r\\n\\r\\n## Aims\\r\\n1.\\tUnderstand the neurons and neural networks\\r\\n2.\\tUnderstand the use of neural networks\\r\\n3.\\tUnderstand forward pass, loss function, backward pass, and weight update\\r\\n\\r\\n## Introduction\\r\\n> \u201cI think the brain is essentially a computer and consciousness is like a computer program. It will cease to run when the computer is turned off. Theoretically, it could be re-created on a neural network, but that would be very difficult, as it would require all one\'s memories.\u201d ~ Stephen Hawking\\r\\n\\r\\n## Important Concepts\\r\\n\\r\\n### Neurons and Neural Networks\\r\\nImagine you are making a system to predict property prices. How would you implement such a system? Maybe it will take the different factors of a property (e.g. size, height, view, surrounding environment, etc.) to calculate the price and outputs it. But how can you calculate the price based on these inputs (factors)?\\r\\n\\r\\nLet\u2019s simplify the problem and assume there is only one factor: the size (area) of the property. Let\u2019s plot a graph with the area on the x-axis, price on the y-axis:\\r\\n\\r\\n![Graph 1](./graph-1.png)\\r\\n\\r\\nThen we can draw a straight fit line on the graph to relate all the data points:\\r\\n:::tip\\r\\nNote that the fit line may not pass through all/any data points!\\r\\n:::\\r\\n\\r\\n![Graph 2](./graph-2.png)\\r\\n\\r\\nHow can you represent the fit line in maths? We can use a simple linear function:\\r\\n\\r\\n$$\\r\\nf(x) = wx + b\\r\\n$$\\r\\n\\r\\nWhere w is the **weight** (the steepness of the linear), b is the **bias** (the y-intercept, or height of the line). In fact, we can represent any straight line on a two-dimensional Cartesian coordinate space and any linear functions with one variable with this function. In the neural network, this function is the simplest form of a **neuron**. But what is a neuron? This is an anatomy of a human neuron cell:\\r\\n\\r\\n![Neuron Anatomy](./neuron-anatomy.png)\\r\\n\\r\\nThe dendrites receive the signals, the cell processes the signals, and the axon terminals send the signals to other neuron cells. By connecting 86 billion of these cells, it forms your brain. We can simulate a neuron in maths with the following function:\\r\\n\\r\\n$$\\r\\nf(x_1, x_2, x_3, x_4, \\\\ldots) = w_1 x_1 + w_2 x_2 + w_3 x_3 + w_4 x_4 + \\\\cdots + b\\r\\n$$\\r\\n\\r\\nThe multiple weights represent the \u201cimportance\u201d of each of the different input x. The b is still the bias. Here\u2019s another diagram to understand the neuron:\\r\\n\\r\\n![Diagram 1](./diagram-1.png)\\r\\n\\r\\nSo, for example, the multiple x can be the different factors of the property, and the weights are parameters that you can tune, representing the importance of that factor contributing to the final price. Wait, what is the f(x) in the above diagram? It is an Activation Function. Its purpose is to introduce non-linearity into the neural network as combining linear functions can only result in a linear function:\\r\\n\\r\\nLet $f(x) = w_1 x + b_1$, $g(x) = w_2 x + b_2$, then $h(x) = g(f(x))$:\\r\\n$$\\r\\nh(x) = g(f(x)) = w_2 (w_1 x + b_1) + b_2\\r\\n$$\\r\\n$$\\r\\nh(x) = w_2 w_1 x + w_2 b_1 + b_2\\r\\n$$\\r\\nLet $a = w_2 w_1$ and $c = w_2 b_1 + b_2$, then:\\r\\n$$\\r\\nh(x) = ax + c\\r\\n$$\\r\\n\\r\\nWhich is a straight line on the graph. But by adding activation functions in between, e.g. $h(x)=g(a(f(x)))$, where $a$ is the activation function, we can create a non-linear (broadly speaking not a straight line on the graph) function or network. Some common activation functions include ReLU, Sigmoid, Tanh, LeakyReLU, GELU, and Softmax. The details of the activation function will be talked about in later blog posts.\\r\\n\\r\\nBy combining and connecting multiple neurons in an orderly manner, you get a neural network. Below is a diagram of a neural network which you\u2019ve probably seen before:\\r\\n\\r\\n![Diagram 2](./diagram-2.png)\\r\\n\\r\\nEach circle (node) in the neural network represents a neuron. Each neuron in the input layer processes a single number and each neuron in the output layer outputs a single number. Neural networks are **universal function approximators**.\\r\\n:::info\\r\\nNote that while the neurons in the hidden layer may seem to have multiple outputs, the outputs are the same.\\r\\n:::\\r\\n\\r\\n### Training of neural networks\\r\\n\\r\\nHowever, how can you calculate the weights and biases given x and y? Below are the processes of training a neural network to find the optimal weights and biases:\\t\\r\\n\\r\\n1.\\t**Initialize the weights and biases** using random numbers with normal or uniform distribution.\\r\\n2.\\t**Forward pass:** Run the model with the input x, and get the model output y.\\r\\n3.\\t**Compute loss:** Compare the model-output y with the real targeted y and calculate the difference using a loss function. \\r\\n4.\\t**Backpropagation/backward pass:** Calculate the gradients of each parameter (weight or bias) using gradient descent with partial derivative. Which means how the output of the model changes with that parameter changing.\\r\\n5.\\t**Update parameters:** Update the parameters using optimizers based on the gradients calculated and the given learning rate hyperparameter (usually between 1e-2 to 1e-6).\\r\\n6.\\t**Repeat Step 2 to 5** with different x and y until the loss is good enough.\\r\\n\\r\\n![Diagram 3](./diagram-3.png)\\r\\n\\r\\n## Code Implementations\\r\\n\\r\\n### A simple neural network with PyTorch\\r\\n\\r\\nLet\u2019s consider a simple formula: y=3x+1. Given an array of x and array of the corresponding y, find 3 and 1 (the weight and the bias). Run the following codes in Google Colab for simplicity.\\r\\n\\r\\n```python\\r\\nimport torch # main library\\r\\nimport torch.nn as nn # neural network modules and functions\\r\\nimport torch.optim as optim # optimizers for neural networks\\r\\nimport matplotlib.pyplot as plt # plotting for analysing the loss\\r\\n\\r\\ntorch.manual_seed(69) # define a manual seed so the results are reproducible\\r\\n```\\r\\n\\r\\nDefine the data x and y:\\r\\n\\r\\n```python\\r\\nx = torch.tensor([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype=torch.float32)\\r\\ny = 3*x + 1\\r\\n\\r\\nprint(x.tolist())\\r\\nprint(y.tolist())\\r\\n```\\r\\n\\r\\nDefine the model, loss function, and optimizer:\\r\\n\\r\\n```python\\r\\nmodel = nn.Linear(1, 1) # a single neuron\\r\\ncriterion = nn.MSELoss() # Mean squared error (MSE) loss function\\r\\noptimizer = optim.SGD(model.parameters(), lr=1e-4) # Stochastic Gradient Descent (SGD) optimizer\\r\\n```\\r\\n\\r\\nTraining Loop:\\r\\n\\r\\n```python\\r\\nepochs = 100\\r\\nlosses = []\\r\\nfor i in range(epochs):\\r\\n for iter_x, iter_y in zip(x, y):\\r\\n iter_x = iter_x.unsqueeze(0) # add another dimension at the end\\r\\n iter_y = iter_y.unsqueeze(0) # same\\r\\n optimizer.zero_grad() # zero the gradients\\r\\n output = model(iter_x) # Forward pass\\r\\n loss = criterion(output, iter_y) # Compute Loss\\r\\n loss.backward() # Backward pass\\r\\n optimizer.step() # Update parameters\\r\\n print(f\\"Epoch: {i}/{epochs}, Loss: {loss.item()}\\")\\r\\n losses.append(loss.item())\\r\\n```\\r\\n\\r\\nFinal loss: 0.0001777520083123818\\r\\nPlot the loss graph:\\r\\n\\r\\n```python\\r\\nplt.plot(losses)\\r\\nplt.show() # Plot the loss graph\\r\\n```\\r\\n\\r\\nLoss Graph:\\r\\n\\r\\n![Loss Graph](./result.png)\\r\\n\\r\\nTest the model:\\r\\n\\r\\n```python\\r\\nfor name, param in model.named_parameters():\\r\\n print(name, param) # Inspect the weight and bias\\r\\n\\r\\nn = 100 # input x\\r\\nx = torch.tensor([n], dtype=torch.float32) # convert to tensor\\r\\ny = model(x) # Forward pass\\r\\nprint(y)\\r\\n```\\r\\n\\r\\n### Follow-up Tasks\\r\\n\\r\\n1. Experiment with different learning rates and epochs and see how it affects the training result.\\r\\n2. Enlarge the dataset (lengthen the x tensor), does it improve the model?\\r\\n3. Experiment with a more complex function than y=3x+1 such as y=x^2. Does it work? If it doesn\u2019t work, how can you solve this issue?\\r\\n4. How can you make the training faster without changing the hardware, data and the model?\\r\\n\\r\\nFeel free to send me an email for your solutions to the above problems!"},{"id":"website-launch","metadata":{"permalink":"/blog/website-launch","source":"@site/blog/2023-10-06-website-launch/index.md","title":"Website Launch!","description":"Website Launch","date":"2023-10-06T00:00:00.000Z","tags":[{"label":"hola","permalink":"/blog/tags/hola"},{"label":"tired","permalink":"/blog/tags/tired"}],"readingTime":0.05,"hasTruncateMarker":false,"authors":[{"name":"Eason Xie","title":"Website Owner","url":"https://easonoob.github.io","imageURL":"https://avatars.githubusercontent.com/u/100521878?v=4","key":"eason"}],"frontMatter":{"slug":"website-launch","title":"Website Launch!","authors":"eason","tags":["hola","tired"]},"unlisted":false,"prevItem":{"title":"The Most Basics of Neural Networks","permalink":"/blog/basic-of-nn"}},"content":"![Website Launch](./website-launch.jpg)\\r\\n\\r\\nThe website is launched today at 00:00 UTC+0!"}]}')}}]); \ No newline at end of file diff --git a/assets/js/d02aa2cd.1485dd4f.js b/assets/js/d02aa2cd.1485dd4f.js new file mode 100644 index 0000000..be61bb0 --- /dev/null +++ b/assets/js/d02aa2cd.1485dd4f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[228],{7595:s=>{s.exports=JSON.parse('{"label":"advanced","permalink":"/blog/tags/advanced","allTagsPath":"/blog/tags","count":1,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/fdb4b188.1a74825e.js b/assets/js/fdb4b188.437a5547.js similarity index 79% rename from assets/js/fdb4b188.1a74825e.js rename to assets/js/fdb4b188.437a5547.js index 7a9e46c..df7eaf5 100644 --- a/assets/js/fdb4b188.1a74825e.js +++ b/assets/js/fdb4b188.437a5547.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[9816],{4648:s=>{s.exports=JSON.parse('{"label":"quantum","permalink":"/blog/tags/quantum","allTagsPath":"/blog/tags","count":2,"unlisted":false}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[9816],{4648:s=>{s.exports=JSON.parse('{"label":"quantum","permalink":"/blog/tags/quantum","allTagsPath":"/blog/tags","count":3,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/main.7c75d084.js b/assets/js/main.7c75d084.js deleted file mode 100644 index c211e29..0000000 --- a/assets/js/main.7c75d084.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.7c75d084.js.LICENSE.txt */ -(self.webpackChunkdocusaurus_site=self.webpackChunkdocusaurus_site||[]).push([[8792],{9188:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(6540);function a(){return r.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20","aria-hidden":"true"},r.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}},8328:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});n(6540);var r=n(3259),a=n.n(r),o=n(4054);const i={"01a85c17":[()=>Promise.all([n.e(1869),n.e(8209)]).then(n.bind(n,9158)),"@theme/BlogTagsListPage",9158],"02860158":[()=>n.e(4137).then(n.t.bind(n,7031,19)),"~blog/default/blog-tags-intermediate-900.json",7031],"143844fc":[()=>n.e(8884).then(n.bind(n,5653)),"@site/blog/2024-2-9-intro-to-qnn/index.md",5653],"1a4e3797":[()=>Promise.all([n.e(1869),n.e(2138)]).then(n.bind(n,4604)),"@theme/SearchPage",4604],"1f391b9e":[()=>Promise.all([n.e(1869),n.e(5243),n.e(6061)]).then(n.bind(n,7973)),"@theme/MDXPage",7973],"27cc243c":[()=>n.e(2624).then(n.bind(n,5368)),"@site/blog/2023-12-13-intro-to-pytorch/index.md?truncated=true",5368],"2bd56707":[()=>n.e(7860).then(n.t.bind(n,2493,19)),"~blog/default/blog-tags-qiskit-0ea-list.json",2493],"2e696297":[()=>n.e(6843).then(n.t.bind(n,8209,19)),"~blog/default/blog-tags-qnn-575.json",8209],"369bd8f8":[()=>n.e(2863).then(n.t.bind(n,6094,19)),"~blog/default/blog-tags-tutorial-e7d-list.json",6094],"393be207":[()=>n.e(4134).then(n.bind(n,6022)),"@site/src/pages/markdown-page.md",6022],"3c9da025":[()=>n.e(7162).then(n.t.bind(n,2400,19)),"~blog/default/blog-tags-qnn-575-list.json",2400],"4bbc857b":[()=>n.e(2834).then(n.t.bind(n,2616,19)),"~blog/default/blog-tags-nn-ef7-list.json",2616],"4c9e35b1":[()=>n.e(2161).then(n.t.bind(n,4722,19)),"~blog/default/blog-tags-hola-ea2-list.json",4722],"56ea5381":[()=>n.e(9753).then(n.t.bind(n,3093,19)),"~blog/default/blog-tags-pytorch-089.json",3093],"5846f853":[()=>n.e(4804).then(n.t.bind(n,2537,19)),"~blog/default/blog-tags-nn-ef7.json",2537],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"6875c492":[()=>Promise.all([n.e(1869),n.e(5243),n.e(5608),n.e(4813)]).then(n.bind(n,3069)),"@theme/BlogTagsPostsPage",3069],"7094d9aa":[()=>n.e(9082).then(n.t.bind(n,8303,19)),"~blog/default/blog-tags-quantum-83e-list.json",8303],"77e23114":[()=>n.e(9159).then(n.t.bind(n,9103,19)),"~blog/default/blog-tags-tutorial-e7d.json",9103],"814f3328":[()=>n.e(7472).then(n.t.bind(n,5513,19)),"~blog/default/blog-post-list-prop-default.json",5513],"84e4991d":[()=>n.e(8457).then(n.bind(n,9927)),"@site/blog/2023-10-06-website-launch/index.md?truncated=true",9927],"878bbf27":[()=>n.e(1699).then(n.t.bind(n,2182,19)),"~blog/default/blog-tags-intermediate-900-list.json",2182],92380732:[()=>n.e(9063).then(n.t.bind(n,8220,19)),"~blog/default/blog-tags-beginners-a6e.json",8220],"93475ef5":[()=>n.e(2969).then(n.bind(n,8406)),"@site/blog/2024-1-5-intro-to-quantum-computing/index.md?truncated=true",8406],"98b1a88b":[()=>n.e(4410).then(n.bind(n,7831)),"@site/blog/2024-2-9-intro-to-qnn/index.md?truncated=true",7831],"9daba9ce":[()=>n.e(2871).then(n.bind(n,6076)),"@site/blog/2023-12-13-intro-to-pytorch/index.md",6076],"9e4087bc":[()=>n.e(2711).then(n.bind(n,9331)),"@theme/BlogArchivePage",9331],a00561c2:[()=>n.e(8681).then(n.t.bind(n,7757,19)),"C:\\Users\\eason\\OneDrive - La Salle College\\vs_code_2022\\websites\\docusaurus_site\\.docusaurus\\docusaurus-theme-search-algolia\\default\\plugin-route-context-module-100.json",7757],a2a90336:[()=>n.e(7424).then(n.t.bind(n,5398,19)),"~blog/default/blog-tags-qiskit-0ea.json",5398],a6aa9e1f:[()=>Promise.all([n.e(1869),n.e(5243),n.e(5608),n.e(7643)]).then(n.bind(n,5124)),"@theme/BlogListPage",5124],a7023ddc:[()=>n.e(9267).then(n.t.bind(n,8289,19)),"~blog/default/blog-tags-tags-4c2.json",8289],acecf23e:[()=>n.e(1903).then(n.t.bind(n,1912,19)),"~blog/default/blogMetadata-default.json",1912],ae03ca28:[()=>n.e(6288).then(n.t.bind(n,5700,19)),"~blog/default/blog-tags-pytorch-089-list.json",5700],b2b675dd:[()=>n.e(1991).then(n.t.bind(n,9775,19)),"~blog/default/blog-c06.json",9775],b2f2a32d:[()=>n.e(5229).then(n.bind(n,3354)),"@site/blog/2023-11-13-basic-of-nn/index.md?truncated=true",3354],b2f554cd:[()=>n.e(5894).then(n.t.bind(n,6042,19)),"~blog/default/blog-archive-80c.json",6042],c1e15703:[()=>n.e(9138).then(n.t.bind(n,4061,19)),"C:\\Users\\eason\\OneDrive - La Salle College\\vs_code_2022\\websites\\docusaurus_site\\.docusaurus\\docusaurus-plugin-content-pages\\default\\plugin-route-context-module-100.json",4061],c4f5d8e4:[()=>Promise.all([n.e(1869),n.e(1250),n.e(2634)]).then(n.bind(n,6733)),"@site/src/pages/index.js",6733],cc4a4a29:[()=>n.e(6338).then(n.t.bind(n,3820,19)),"~blog/default/blog-tags-tired-204-list.json",3820],ccc49370:[()=>Promise.all([n.e(1869),n.e(5243),n.e(5608),n.e(3249)]).then(n.bind(n,3858)),"@theme/BlogPostPage",3858],cd4affb1:[()=>n.e(4952).then(n.bind(n,6053)),"@site/blog/2023-10-06-website-launch/index.md",6053],d64d2edd:[()=>n.e(8162).then(n.t.bind(n,2945,19)),"C:\\Users\\eason\\OneDrive - La Salle College\\vs_code_2022\\websites\\docusaurus_site\\.docusaurus\\docusaurus-plugin-content-blog\\default\\plugin-route-context-module-100.json",2945],d790aea9:[()=>n.e(1847).then(n.bind(n,6582)),"@site/blog/2023-11-13-basic-of-nn/index.md",6582],e16015ca:[()=>n.e(1497).then(n.t.bind(n,9635,19)),"~blog/default/blog-tags-hola-ea2.json",9635],e42c654d:[()=>n.e(1378).then(n.bind(n,6343)),"@site/blog/2024-1-5-intro-to-quantum-computing/index.md",6343],ea6e439b:[()=>Promise.all([n.e(1250),n.e(7864)]).then(n.bind(n,4257)),"@site/src/pages/bot.js",4257],ed0d1842:[()=>n.e(7221).then(n.t.bind(n,2739,19)),"~blog/default/blog-tags-beginners-a6e-list.json",2739],fa5758a7:[()=>n.e(8243).then(n.t.bind(n,2061,19)),"~blog/default/blog-tags-tired-204.json",2061],fdb4b188:[()=>n.e(9816).then(n.t.bind(n,4648,19)),"~blog/default/blog-tags-quantum-83e.json",4648]};var l=n(4848);function s(e){let{error:t,retry:n,pastDelay:r}=e;return t?(0,l.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,l.jsx)("p",{children:String(t)}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,l.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,l.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,l.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var u=n(6921),c=n(3102);function d(e,t){if("*"===e)return a()({loading:s,loader:()=>n.e(6780).then(n.bind(n,6780)),modules:["@theme/NotFound"],webpack:()=>[6780],render(e,t){const n=e.default;return(0,l.jsx)(c.W,{value:{plugin:{name:"native",id:"default"}},children:(0,l.jsx)(n,{...t})})}});const r=o[`${e}-${t}`],d={},p=[],f=[],g=(0,u.A)(r);return Object.entries(g).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],p.push(r[1]),f.push(r[2]))})),a().Map({loading:s,loader:d,modules:p,webpack:()=>f,render(t,n){const a=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const o=r.default;if(!o)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof o&&"function"!=typeof o||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{o[e]=r[e]}));let i=a;const l=n.split(".");l.slice(0,-1).forEach((e=>{i=i[e]})),i[l[l.length-1]]=o}));const o=a.__comp;delete a.__comp;const i=a.__context;return delete a.__context,(0,l.jsx)(c.W,{value:i,children:(0,l.jsx)(o,{...a,...n})})}})}const p=[{path:"/blog",component:d("/blog","260"),exact:!0},{path:"/blog/archive",component:d("/blog/archive","ebd"),exact:!0},{path:"/blog/basic-of-nn",component:d("/blog/basic-of-nn","b3f"),exact:!0},{path:"/blog/intro-to-pytorch",component:d("/blog/intro-to-pytorch","bdd"),exact:!0},{path:"/blog/intro-to-qnn",component:d("/blog/intro-to-qnn","cd2"),exact:!0},{path:"/blog/intro-to-quantum-computing",component:d("/blog/intro-to-quantum-computing","651"),exact:!0},{path:"/blog/tags",component:d("/blog/tags","fc0"),exact:!0},{path:"/blog/tags/beginners",component:d("/blog/tags/beginners","226"),exact:!0},{path:"/blog/tags/hola",component:d("/blog/tags/hola","a17"),exact:!0},{path:"/blog/tags/intermediate",component:d("/blog/tags/intermediate","32c"),exact:!0},{path:"/blog/tags/nn",component:d("/blog/tags/nn","5e6"),exact:!0},{path:"/blog/tags/pytorch",component:d("/blog/tags/pytorch","242"),exact:!0},{path:"/blog/tags/qiskit",component:d("/blog/tags/qiskit","210"),exact:!0},{path:"/blog/tags/qnn",component:d("/blog/tags/qnn","31d"),exact:!0},{path:"/blog/tags/quantum",component:d("/blog/tags/quantum","d34"),exact:!0},{path:"/blog/tags/tired",component:d("/blog/tags/tired","5f8"),exact:!0},{path:"/blog/tags/tutorial",component:d("/blog/tags/tutorial","862"),exact:!0},{path:"/blog/website-launch",component:d("/blog/website-launch","7e8"),exact:!0},{path:"/bot",component:d("/bot","ace"),exact:!0},{path:"/markdown-page",component:d("/markdown-page","1e6"),exact:!0},{path:"/search",component:d("/search","764"),exact:!0},{path:"/",component:d("/","bfd"),exact:!0},{path:"*",component:d("*")}]},6125:(e,t,n)=>{"use strict";n.d(t,{o:()=>o,x:()=>i});var r=n(6540),a=n(4848);const o=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,a.jsx)(o.Provider,{value:n,children:t})}},1285:(e,t,n)=>{"use strict";var r=n(6540),a=n(5338),o=n(4625),i=n(545),l=n(8193);const s=[n(1911),n(119),n(6134),n(6294),n(1043)];var u=n(8328),c=n(6347),d=n(8168);function p(e,t,n){return void 0===n&&(n=[]),e.some((function(e){var r=e.path?(0,c.B6)(t,e):n.length?n[n.length-1].match:c.Ix.computeRootMatch(t);return r&&(n.push({route:e,match:r}),e.routes&&p(e.routes,t,n)),r})),n}var f=n(4848);function g(e){let{children:t}=e;return(0,f.jsx)(f.Fragment,{children:t})}var m=n(5260),h=n(4586),y=n(6025),b=n(6342),v=n(5500),w=n(2131),k=n(4090),x=n(2967),S=n(440),E=n(1463);function C(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,h.A)(),r=(0,w.o)(),a=n[e].htmlLang,o=e=>e.replace("-","_");return(0,f.jsxs)(m.A,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,f.jsx)("meta",{property:"og:locale",content:o(a)}),Object.values(n).filter((e=>a!==e.htmlLang)).map((e=>(0,f.jsx)("meta",{property:"og:locale:alternate",content:o(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function T(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.A)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,h.A)(),{pathname:r}=(0,c.zy)();return e+(0,S.applyTrailingSlash)((0,y.A)(r),{trailingSlash:n,baseUrl:t})}(),a=t?`${n}${t}`:r;return(0,f.jsxs)(m.A,{children:[(0,f.jsx)("meta",{property:"og:url",content:a}),(0,f.jsx)("link",{rel:"canonical",href:a})]})}function _(){const{i18n:{currentLocale:e}}=(0,h.A)(),{metadata:t,image:n}=(0,b.p)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(m.A,{children:[(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("body",{className:k.w})]}),n&&(0,f.jsx)(v.be,{image:n}),(0,f.jsx)(T,{}),(0,f.jsx)(C,{}),(0,f.jsx)(E.A,{tag:x.Cy,locale:e}),(0,f.jsx)(m.A,{children:t.map(((e,t)=>(0,f.jsx)("meta",{...e},t)))})]})}const A=new Map;function j(e){if(A.has(e.pathname))return{...e,pathname:A.get(e.pathname)};if(p(u.A,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return A.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return A.set(e.pathname,t),{...e,pathname:t}}var L=n(6125),R=n(6988),N=n(205);function P(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>a.forEach((e=>e?.()))}const O=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,N.A)((()=>{r!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,a=t.hash===n.hash,o=t.search===n.search;if(r&&a&&!o)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:r}),P("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function D(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>p(u.A,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class M extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=l.A.canUseDOM?P("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=P("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),D(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return(0,f.jsx)(O,{previousLocation:this.previousLocation,location:t,children:(0,f.jsx)(c.qh,{location:t,render:()=>e})})}}const I=M,F="__docusaurus-base-url-issue-banner-container",B="__docusaurus-base-url-issue-banner",z="__docusaurus-base-url-issue-banner-suggestion-container";function $(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '${F}';\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const a=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;a?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var X=n(6921);const Z=new Set,J=new Set,ee=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,te={prefetch(e){if(!(e=>!ee()&&!J.has(e)&&!Z.has(e))(e))return!1;Z.add(e);const t=p(u.A,e).flatMap((e=>{return t=e.route.path,Object.entries(Q).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,X.A)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?Y(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!ee()&&!J.has(e))(e)&&(J.add(e),D(e))},ne=Object.freeze(te),re=Boolean(!0);if(l.A.canUseDOM){window.docusaurus=ne;const e=document.getElementById("__docusaurus"),t=(0,f.jsx)(i.vd,{children:(0,f.jsx)(o.Kd,{children:(0,f.jsx)(K,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},l=()=>{if(re)r.startTransition((()=>{a.hydrateRoot(e,t,{onRecoverableError:n})}));else{const o=a.createRoot(e,{onRecoverableError:n});r.startTransition((()=>{o.render(t)}))}};D(window.location.pathname).then(l)}},6988:(e,t,n)=>{"use strict";n.d(t,{o:()=>d,l:()=>p});var r=n(6540),a=n(4784);const o=JSON.parse('{"docusaurus-plugin-google-gtag":{"default":{"trackingID":["G-5R5K366DB4"],"anonymizeIP":false,"id":"default"}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(2654);const s=JSON.parse('{"docusaurusVersion":"3.2.1","siteVersion":"1.0.0","pluginVersions":{"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.2.1"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.2.1"},"docusaurus-plugin-google-gtag":{"type":"package","name":"@docusaurus/plugin-google-gtag","version":"3.2.1"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.2.1"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.2.1"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"3.2.1"}}}');var u=n(4848);const c={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},d=r.createContext(c);function p(e){let{children:t}=e;return(0,u.jsx)(d.Provider,{value:c,children:t})}},7489:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(6540),a=n(8193),o=n(5260),i=n(440),l=n(3512),s=n(3102),u=n(4848);function c(e){let{error:t,tryAgain:n}=e;return(0,u.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,u.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,u.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,u.jsx)(d,{error:t})]})}function d(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,u.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function p(e){let{children:t}=e;return(0,u.jsx)(s.W,{value:{plugin:{name:"docusaurus-core-error-boundary",id:"default"}},children:t})}function f(e){let{error:t,tryAgain:n}=e;return(0,u.jsx)(p,{children:(0,u.jsxs)(m,{fallback:()=>(0,u.jsx)(c,{error:t,tryAgain:n}),children:[(0,u.jsx)(o.A,{children:(0,u.jsx)("title",{children:"Page Error"})}),(0,u.jsx)(l.A,{children:(0,u.jsx)(c,{error:t,tryAgain:n})})]})})}const g=e=>(0,u.jsx)(f,{...e});class m extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.A.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??g)(e)}return e??null}}},8193:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5260:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(545),a=n(4848);function o(e){return(0,a.jsx)(r.mg,{...e})}},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(6540),a=n(4625),o=n(440),i=n(4586),l=n(6654),s=n(8193),u=n(3427),c=n(6025),d=n(4848);function p(e,t){let{isNavLink:n,to:p,href:f,activeClassName:g,isActive:m,"data-noBrokenLinkCheck":h,autoAddBaseUrl:y=!0,...b}=e;const{siteConfig:{trailingSlash:v,baseUrl:w}}=(0,i.A)(),{withBaseUrl:k}=(0,c.h)(),x=(0,u.A)(),S=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>S.current));const E=p||f;const C=(0,l.A)(E),T=E?.replace("pathname://","");let _=void 0!==T?(A=T,y&&(e=>e.startsWith("/"))(A)?k(A):A):void 0;var A;_&&C&&(_=(0,o.applyTrailingSlash)(_,{trailingSlash:v,baseUrl:w}));const j=(0,r.useRef)(!1),L=n?a.k2:a.N_,R=s.A.canUseIntersectionObserver,N=(0,r.useRef)(),P=()=>{j.current||null==_||(window.docusaurus.preload(_),j.current=!0)};(0,r.useEffect)((()=>(!R&&C&&null!=_&&window.docusaurus.prefetch(_),()=>{R&&N.current&&N.current.disconnect()})),[N,_,R,C]);const O=_?.startsWith("#")??!1,D=!b.target||"_self"===b.target,M=!_||!C||!D||O;return h||!O&&M||x.collectLink(_),b.id&&x.collectAnchor(b.id),M?(0,d.jsx)("a",{ref:S,href:_,...E&&!C&&{target:"_blank",rel:"noopener noreferrer"},...b}):(0,d.jsx)(L,{...b,onMouseEnter:P,onTouchStart:P,innerRef:e=>{S.current=e,R&&e&&C&&(N.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(N.current.unobserve(e),N.current.disconnect(),null!=_&&window.docusaurus.prefetch(_))}))})),N.current.observe(e))},to:_,...n&&{isActive:m,activeClassName:g}})}const f=r.forwardRef(p)},1312:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,T:()=>s});var r=n(6540),a=n(4848);function o(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var i=n(2654);function l(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[t??n]??n??t}function s(e,t){let{message:n,id:r}=e;return o(l({message:n,id:r}),t)}function u(e){let{children:t,id:n,values:r}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const i=l({message:t,id:n});return(0,a.jsx)(a.Fragment,{children:o(i,r)})}},7065:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},6654:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>a,z:()=>r})},6025:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,h:()=>i});var r=n(6540),a=n(4586),o=n(6654);function i(){const{siteConfig:{baseUrl:e,url:t}}=(0,a.A)(),n=(0,r.useCallback)(((n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:a=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,o.z)(n))return n;if(a)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,r)),[t,e]);return{withBaseUrl:n}}function l(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},3427:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(6540);n(4848);const a=r.createContext({collectAnchor:()=>{},collectLink:()=>{}}),o=()=>(0,r.useContext)(a);function i(){return o()}},4586:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6988);function o(){return(0,r.useContext)(a.o)}},2303:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6125);function o(){return(0,r.useContext)(a.o)}},205:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6540);const a=n(8193).A.canUseDOM?r.useLayoutEffect:r.useEffect},6803:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(3102);function o(){const e=r.useContext(a.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}},6921:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function a(e){const t={};return function e(n,a){Object.entries(n).forEach((n=>{let[o,i]=n;const l=a?`${a}.${o}`:o;r(i)?e(i,l):t[l]=i}))}(e),t}},3102:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>o});var r=n(6540),a=n(4848);const o=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(o),l=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:i,value:n})),[i,n]);return(0,a.jsx)(o.Provider,{value:l,children:t})}},4070:(e,t,n)=>{"use strict";n.d(t,{zK:()=>y,gk:()=>g,Gy:()=>d,ht:()=>p,r7:()=>h,jh:()=>m});var r=n(6347),a=n(4586),o=n(7065);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.A)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){const n=l(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}function u(e,t){const n=s(e,t),a=n?.docs.find((e=>!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const c={},d=()=>i("docusaurus-plugin-content-docs")??c,p=e=>{try{return function(e,t,n){void 0===t&&(t=o.W),void 0===n&&(n={});const r=i(e),a=r?.[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0})}catch(t){throw new Error("You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled"+("Default"===e?"":` (pluginId=${e}`),{cause:t})}};function f(e){void 0===e&&(e={});const t=d(),{pathname:n}=(0,r.zy)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.B6)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function g(e){void 0===e&&(e={});const t=f(e),{pathname:n}=(0,r.zy)();if(!t)return;return{activePlugin:t,activeVersion:s(t.pluginData,n)}}function m(e){return p(e).versions}function h(e){const t=p(e);return l(t)}function y(e){const t=p(e),{pathname:n}=(0,r.zy)();return u(t,n)}},1911:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={onRouteDidUpdate(e){let{location:t,previousLocation:n}=e;!n||t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash||setTimeout((()=>{window.gtag("set","page_path",t.pathname+t.search+t.hash),window.gtag("event","page_view")}))}}},6294:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(5947),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},6134:(e,t,n)=>{"use strict";n.r(t);var r=n(1765),a=n(4784);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(9700),n(8692)(`./prism-${e}`)})),delete globalThis.Prism}(r.My)},1107:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});n(6540);var r=n(4164),a=n(1312),o=n(6342),i=n(8774),l=n(3427);const s={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};var u=n(4848);function c(e){let{as:t,id:n,...c}=e;const d=(0,l.A)(),{navbar:{hideOnScroll:p}}=(0,o.p)();if("h1"===t||!n)return(0,u.jsx)(t,{...c,id:void 0});d.collectAnchor(n);const f=(0,a.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof c.children?c.children:n});return(0,u.jsxs)(t,{...c,className:(0,r.A)("anchor",p?s.anchorWithHideOnScrollNavbar:s.anchorWithStickyNavbar,c.className),id:n,children:[c.children,(0,u.jsx)(i.A,{className:"hash-link",to:`#${n}`,"aria-label":f,title:f,children:"\u200b"})]})}},3512:(e,t,n)=>{"use strict";n.d(t,{A:()=>Xt});var r=n(6540),a=n(4164),o=n(7489),i=n(5500),l=n(6347),s=n(1312),u=n(9532);function c(e){const t=(0,l.zy)(),n=(0,u.ZC)(t),a=(0,u._q)(e);(0,r.useEffect)((()=>{n&&t!==n&&a({location:t,previousLocation:n})}),[a,t,n])}var d=n(4848);const p="__docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function g(){const e=(0,r.useRef)(null),{action:t}=(0,l.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(p);t&&f(t)}),[]);return c((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const m=(0,s.T)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function h(e){const t=e.children??m,{containerRef:n,onClick:r}=g();return(0,d.jsx)("div",{ref:n,role:"region","aria-label":m,children:(0,d.jsx)("a",{...e,href:`#${p}`,onClick:r,children:t})})}var y=n(7559),b=n(4090);const v={skipToContent:"skipToContent_fXgn"};function w(){return(0,d.jsx)(h,{className:v.skipToContent})}var k=n(6342),x=n(2303),S=n(9466);const E=(0,S.Wf)("docusaurus.announcement.dismiss"),C=(0,S.Wf)("docusaurus.announcement.id"),T=()=>"true"===E.get(),_=e=>E.set(String(e)),A=r.createContext(null);function j(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:a=1.2,className:o,...i}=e;return(0,d.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,d.jsx)("g",{stroke:r,strokeWidth:a,children:(0,d.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const L={closeButton:"closeButton_CVFx"};function R(e){return(0,d.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,a.A)("clean-btn close",L.closeButton,e.className),children:(0,d.jsx)(j,{width:14,height:14,strokeWidth:3.1})})}const N={content:"content_knG7"};function P(e){const{announcementBar:t}=(0,k.p)(),{content:n}=t;return(0,d.jsx)("div",{...e,className:(0,a.A)(N.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const O={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function D(){const{announcementBar:e}=(0,k.p)(),{isActive:t,close:n}=function(){const e=(0,r.useContext)(A);if(!e)throw new u.dV("AnnouncementBarProvider");return e}();if(!t)return null;const{backgroundColor:a,textColor:o,isCloseable:i}=e;return(0,d.jsxs)("div",{className:O.announcementBar,style:{backgroundColor:a,color:o},role:"banner",children:[i&&(0,d.jsx)("div",{className:O.announcementBarPlaceholder}),(0,d.jsx)(P,{className:O.announcementBarContent}),i&&(0,d.jsx)(R,{onClick:n,className:O.announcementBarClose})]})}var M=n(5600),I=n(4581),F=n(7485);const B=r.createContext(void 0);function z(){const e=function(){const e=(0,M.YL)(),{items:t}=(0,k.p)().navbar;return 0===t.length&&!e.component}(),t=(0,I.l)(),n=!e&&"mobile"===t,[a,o]=(0,r.useState)(!1);(0,F.$Z)((()=>{if(a)return o(!1),!1}));const i=(0,r.useCallback)((()=>{o((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&o(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:i,shown:a})),[e,n,i,a])}function $(e){let{children:t}=e;const n=z();return(0,d.jsx)(B.Provider,{value:n,children:t})}function U(){const e=r.useContext(B);if(void 0===e)throw new u.dV("NavbarMobileSidebarProvider");return e}var q=n(8193);n(205);const H=r.createContext(void 0);function G(){const e=(0,r.useContext)(H);if(null==e)throw new u.dV("ScrollControllerProvider");return e}const W=()=>q.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function V(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return function(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=G(),a=(0,r.useRef)(W()),o=(0,u._q)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=W();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=l?n(!1):i+u{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return a.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}const K=r.createContext(null);function Q(e){let{children:t}=e;const n=function(){const e=U(),t=(0,M.YL)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,u.ZC)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return(0,d.jsx)(K.Provider,{value:n,children:t})}function Y(e){if(e.component){const t=e.component;return(0,d.jsx)(t,{...e.props})}}function X(){const e=(0,r.useContext)(K);if(!e)throw new u.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,M.YL)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:Y(o)})),[a,o,t])}function Z(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:o}=X();return(0,d.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,d.jsxs)("div",{className:(0,a.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":o}),children:[(0,d.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,d.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var J=n(5293);function ee(e){return(0,d.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,d.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})})}function te(e){return(0,d.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,d.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})})}const ne={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function re(e){let{className:t,buttonClassName:n,value:r,onChange:o}=e;const i=(0,x.A)(),l=(0,s.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,s.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,s.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,d.jsx)("div",{className:(0,a.A)(ne.toggle,t),children:(0,d.jsxs)("button",{className:(0,a.A)("clean-btn",ne.toggleButton,!i&&ne.toggleButtonDisabled,n),type:"button",onClick:()=>o("dark"===r?"light":"dark"),disabled:!i,title:l,"aria-label":l,"aria-live":"polite",children:[(0,d.jsx)(ee,{className:(0,a.A)(ne.toggleIcon,ne.lightToggleIcon)}),(0,d.jsx)(te,{className:(0,a.A)(ne.toggleIcon,ne.darkToggleIcon)})]})})}const ae=r.memo(re),oe={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function ie(e){let{className:t}=e;const n=(0,k.p)().navbar.style,r=(0,k.p)().colorMode.disableSwitch,{colorMode:a,setColorMode:o}=(0,J.G)();return r?null:(0,d.jsx)(ae,{className:t,buttonClassName:"dark"===n?oe.darkNavbarColorModeToggle:void 0,value:a,onChange:o})}var le=n(8774),se=n(6025),ue=n(4586);const ce={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};function de(e){let{className:t,children:n}=e;const o=(0,x.A)(),{colorMode:i}=(0,J.G)();return(0,d.jsx)(d.Fragment,{children:(o?"dark"===i?["dark"]:["light"]:["light","dark"]).map((e=>{const o=n({theme:e,className:(0,a.A)(t,ce.themedComponent,ce[`themedComponent--${e}`])});return(0,d.jsx)(r.Fragment,{children:o},e)}))})}function pe(e){const{sources:t,className:n,alt:r,...a}=e;return(0,d.jsx)(de,{className:n,children:e=>{let{theme:n,className:o}=e;return(0,d.jsx)("img",{src:t[n],alt:r,className:o,...a})}})}function fe(e){let{logo:t,alt:n,imageClassName:r}=e;const a={light:(0,se.A)(t.src),dark:(0,se.A)(t.srcDark||t.src)},o=(0,d.jsx)(pe,{className:t.className,sources:a,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,d.jsx)("div",{className:r,children:o}):o}function ge(e){const{siteConfig:{title:t}}=(0,ue.A)(),{navbar:{title:n,logo:r}}=(0,k.p)(),{imageClassName:a,titleClassName:o,...i}=e,l=(0,se.A)(r?.href||"/"),s=n?"":t,u=r?.alt??s;return(0,d.jsxs)(le.A,{to:l,...i,...r?.target&&{target:r.target},children:[r&&(0,d.jsx)(fe,{logo:r,alt:u,imageClassName:a}),null!=n&&(0,d.jsx)("b",{className:o,children:n})]})}function me(){return(0,d.jsx)(ge,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function he(){const e=U();return(0,d.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle(),children:(0,d.jsx)(j,{color:"var(--ifm-color-emphasis-600)"})})}function ye(){return(0,d.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,d.jsx)(me,{}),(0,d.jsx)(ie,{className:"margin-right--md"}),(0,d.jsx)(he,{})]})}var be=n(6654),ve=n(1252);const we={iconExternalLink:"iconExternalLink_nPIU"};function ke(e){let{width:t=13.5,height:n=13.5}=e;return(0,d.jsx)("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:we.iconExternalLink,children:(0,d.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}function xe(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:a,label:o,html:i,isDropdownLink:l,prependBaseUrlToHref:s,...u}=e;const c=(0,se.A)(r),p=(0,se.A)(t),f=(0,se.A)(a,{forcePrependBaseUrl:!0}),g=o&&a&&!(0,be.A)(a),m=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,d.jsxs)(d.Fragment,{children:[o,g&&(0,d.jsx)(ke,{...l&&{width:12,height:12}})]})};return a?(0,d.jsx)(le.A,{href:s?f:a,...u,...m}):(0,d.jsx)(le.A,{to:c,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?(0,ve.G)(n,t.pathname):t.pathname.startsWith(p)},...u,...m})}function Se(e){let{className:t,isDropdownItem:n=!1,...r}=e;const o=(0,d.jsx)(xe,{className:(0,a.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,d.jsx)("li",{children:o}):o}function Ee(e){let{className:t,isDropdownItem:n,...r}=e;return(0,d.jsx)("li",{className:"menu__list-item",children:(0,d.jsx)(xe,{className:(0,a.A)("menu__link",t),...r})})}function Ce(e){let{mobile:t=!1,position:n,...r}=e;const a=t?Ee:Se;return(0,d.jsx)(a,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var Te=n(4577),_e=n(9169);const Ae={dropdownNavbarItemMobile:"dropdownNavbarItemMobile_S0Fm"};function je(e,t){return e.some((e=>function(e,t){return!!(0,_e.ys)(e.to,t)||!!(0,ve.G)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function Le(e){let{items:t,position:n,className:o,onClick:i,...l}=e;const s=(0,r.useRef)(null),[u,c]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[s]),(0,d.jsxs)("div",{ref:s,className:(0,a.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":u}),children:[(0,d.jsx)(xe,{"aria-haspopup":"true","aria-expanded":u,role:"button",href:l.to?void 0:"#",className:(0,a.A)("navbar__link",o),...l,onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),c(!u))},children:l.children??l.label}),(0,d.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(ct,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function Re(e){let{items:t,className:n,position:o,onClick:i,...s}=e;const u=function(){const{siteConfig:{baseUrl:e}}=(0,ue.A)(),{pathname:t}=(0,l.zy)();return t.replace(e,"/")}(),c=je(t,u),{collapsed:p,toggleCollapsed:f,setCollapsed:g}=(0,Te.u)({initialState:()=>!c});return(0,r.useEffect)((()=>{c&&g(!c)}),[u,c,g]),(0,d.jsxs)("li",{className:(0,a.A)("menu__list-item",{"menu__list-item--collapsed":p}),children:[(0,d.jsx)(xe,{role:"button",className:(0,a.A)(Ae.dropdownNavbarItemMobile,"menu__link menu__link--sublist menu__link--sublist-caret",n),...s,onClick:e=>{e.preventDefault(),f()},children:s.children??s.label}),(0,d.jsx)(Te.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:p,children:t.map(((e,t)=>(0,r.createElement)(ct,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function Ne(e){let{mobile:t=!1,...n}=e;const r=t?Re:Le;return(0,d.jsx)(r,{...n})}var Pe=n(2131);function Oe(e){let{width:t=20,height:n=20,...r}=e;return(0,d.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,d.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})})}const De="iconLanguage_nlXk";var Me=n(961);function Ie(){return r.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var Fe=n(9188),Be=["translations"];function ze(){return ze=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var He="Ctrl";var Ge=r.forwardRef((function(e,t){var n=e.translations,a=void 0===n?{}:n,o=qe(e,Be),i=a.buttonText,l=void 0===i?"Search":i,s=a.buttonAriaLabel,u=void 0===s?"Search":s,c=$e((0,r.useState)(null),2),d=c[0],p=c[1];return(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?p("\u2318"):p(He))}),[]),r.createElement("button",ze({type:"button",className:"DocSearch DocSearch-Button","aria-label":u},o,{ref:t}),r.createElement("span",{className:"DocSearch-Button-Container"},r.createElement(Fe.W,null),r.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),r.createElement("span",{className:"DocSearch-Button-Keys"},null!==d&&r.createElement(r.Fragment,null,r.createElement(We,{reactsToKey:d===He?He:"Meta"},d===He?r.createElement(Ie,null):d),r.createElement(We,{reactsToKey:"k"},"K"))))}));function We(e){var t=e.reactsToKey,n=e.children,a=$e((0,r.useState)(!1),2),o=a[0],i=a[1];return(0,r.useEffect)((function(){if(t)return window.addEventListener("keydown",e),window.addEventListener("keyup",n),function(){window.removeEventListener("keydown",e),window.removeEventListener("keyup",n)};function e(e){e.key===t&&i(!0)}function n(e){e.key!==t&&"Meta"!==e.key||i(!1)}}),[t]),r.createElement("kbd",{className:o?"DocSearch-Button-Key DocSearch-Button-Key--pressed":"DocSearch-Button-Key"},n)}var Ve=n(5260),Ke=n(4255),Qe=n(1062),Ye=n(2967);const Xe={button:{buttonText:(0,s.T)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),buttonAriaLabel:(0,s.T)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"})},modal:{searchBox:{resetButtonTitle:(0,s.T)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),resetButtonAriaLabel:(0,s.T)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),cancelButtonText:(0,s.T)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"}),cancelButtonAriaLabel:(0,s.T)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"})},startScreen:{recentSearchesTitle:(0,s.T)({id:"theme.SearchModal.startScreen.recentSearchesTitle",message:"Recent",description:"The title for recent searches"}),noRecentSearchesText:(0,s.T)({id:"theme.SearchModal.startScreen.noRecentSearchesText",message:"No recent searches",description:"The text when no recent searches"}),saveRecentSearchButtonTitle:(0,s.T)({id:"theme.SearchModal.startScreen.saveRecentSearchButtonTitle",message:"Save this search",description:"The label for save recent search button"}),removeRecentSearchButtonTitle:(0,s.T)({id:"theme.SearchModal.startScreen.removeRecentSearchButtonTitle",message:"Remove this search from history",description:"The label for remove recent search button"}),favoriteSearchesTitle:(0,s.T)({id:"theme.SearchModal.startScreen.favoriteSearchesTitle",message:"Favorite",description:"The title for favorite searches"}),removeFavoriteSearchButtonTitle:(0,s.T)({id:"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle",message:"Remove this search from favorites",description:"The label for remove favorite search button"})},errorScreen:{titleText:(0,s.T)({id:"theme.SearchModal.errorScreen.titleText",message:"Unable to fetch results",description:"The title for error screen of search modal"}),helpText:(0,s.T)({id:"theme.SearchModal.errorScreen.helpText",message:"You might want to check your network connection.",description:"The help text for error screen of search modal"})},footer:{selectText:(0,s.T)({id:"theme.SearchModal.footer.selectText",message:"to select",description:"The explanatory text of the action for the enter key"}),selectKeyAriaLabel:(0,s.T)({id:"theme.SearchModal.footer.selectKeyAriaLabel",message:"Enter key",description:"The ARIA label for the Enter key button that makes the selection"}),navigateText:(0,s.T)({id:"theme.SearchModal.footer.navigateText",message:"to navigate",description:"The explanatory text of the action for the Arrow up and Arrow down key"}),navigateUpKeyAriaLabel:(0,s.T)({id:"theme.SearchModal.footer.navigateUpKeyAriaLabel",message:"Arrow up",description:"The ARIA label for the Arrow up key button that makes the navigation"}),navigateDownKeyAriaLabel:(0,s.T)({id:"theme.SearchModal.footer.navigateDownKeyAriaLabel",message:"Arrow down",description:"The ARIA label for the Arrow down key button that makes the navigation"}),closeText:(0,s.T)({id:"theme.SearchModal.footer.closeText",message:"to close",description:"The explanatory text of the action for Escape key"}),closeKeyAriaLabel:(0,s.T)({id:"theme.SearchModal.footer.closeKeyAriaLabel",message:"Escape key",description:"The ARIA label for the Escape key button that close the modal"}),searchByText:(0,s.T)({id:"theme.SearchModal.footer.searchByText",message:"Search by",description:"The text explain that the search is making by Algolia"})},noResultsScreen:{noResultsText:(0,s.T)({id:"theme.SearchModal.noResultsScreen.noResultsText",message:"No results for",description:"The text explains that there are no results for the following search"}),suggestedQueryText:(0,s.T)({id:"theme.SearchModal.noResultsScreen.suggestedQueryText",message:"Try searching for",description:"The text for the suggested query when no results are found for the following search"}),reportMissingResultsText:(0,s.T)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsText",message:"Believe this query should return results?",description:"The text for the question where the user thinks there are missing results"}),reportMissingResultsLinkText:(0,s.T)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText",message:"Let us know.",description:"The text for the link to report missing results"})}},placeholder:(0,s.T)({id:"theme.SearchModal.placeholder",message:"Search docs",description:"The placeholder of the input of the DocSearch pop-up modal"})};let Ze=null;function Je(e){let{hit:t,children:n}=e;return(0,d.jsx)(le.A,{to:t.url,children:n})}function et(e){let{state:t,onClose:n}=e;const r=(0,Ke.w)();return(0,d.jsx)(le.A,{to:r(t.query),onClick:n,children:(0,d.jsx)(s.A,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits},children:"See all {count} results"})})}function tt(e){let{contextualSearch:t,externalUrlRegex:a,...o}=e;const{siteMetadata:i}=(0,ue.A)(),s=(0,Qe.C)(),u=function(){const{locale:e,tags:t}=(0,Ye.af)();return[`language:${e}`,t.map((e=>`docusaurus_tag:${e}`))]}(),c=o.searchParameters?.facetFilters??[],p=t?function(e,t){const n=e=>"string"==typeof e?[e]:e;return[...n(e),...n(t)]}(u,c):c,f={...o.searchParameters,facetFilters:p},g=(0,l.W6)(),m=(0,r.useRef)(null),h=(0,r.useRef)(null),[y,b]=(0,r.useState)(!1),[v,w]=(0,r.useState)(void 0),k=(0,r.useCallback)((()=>Ze?Promise.resolve():Promise.all([n.e(9462).then(n.bind(n,9462)),Promise.all([n.e(1869),n.e(8913)]).then(n.bind(n,8913)),Promise.all([n.e(1869),n.e(416)]).then(n.bind(n,416))]).then((e=>{let[{DocSearchModal:t}]=e;Ze=t}))),[]),x=(0,r.useCallback)((()=>{k().then((()=>{m.current=document.createElement("div"),document.body.insertBefore(m.current,document.body.firstChild),b(!0)}))}),[k,b]),S=(0,r.useCallback)((()=>{b(!1),m.current?.remove(),h.current?.focus()}),[b]),E=(0,r.useCallback)((e=>{k().then((()=>{b(!0),w(e.key)}))}),[k,b,w]),C=(0,r.useRef)({navigate(e){let{itemUrl:t}=e;(0,ve.G)(a,t)?window.location.href=t:g.push(t)}}).current,T=(0,r.useRef)((e=>o.transformItems?o.transformItems(e):e.map((e=>({...e,url:s(e.url)}))))).current,_=(0,r.useMemo)((()=>e=>(0,d.jsx)(et,{...e,onClose:S})),[S]),A=(0,r.useCallback)((e=>(e.addAlgoliaAgent("docusaurus",i.docusaurusVersion),e)),[i.docusaurusVersion]);return function(e){var t=e.isOpen,n=e.onOpen,a=e.onClose,o=e.onInput,i=e.searchButtonRef;r.useEffect((function(){function e(e){var r;(27===e.keyCode&&t||"k"===(null===(r=e.key)||void 0===r?void 0:r.toLowerCase())&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?a():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||n()),i&&i.current===document.activeElement&&o&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&o(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,a,o,i])}({isOpen:y,onOpen:x,onClose:S,onInput:E,searchButtonRef:h}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Ve.A,{children:(0,d.jsx)("link",{rel:"preconnect",href:`https://${o.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})}),(0,d.jsx)(Ge,{onTouchStart:k,onFocus:k,onMouseOver:k,onClick:x,ref:h,translations:Xe.button}),y&&Ze&&m.current&&(0,Me.createPortal)((0,d.jsx)(Ze,{onClose:S,initialScrollY:window.scrollY,initialQuery:v,navigator:C,transformItems:T,hitComponent:Je,transformSearchClient:A,...o.searchPagePath&&{resultsFooterComponent:_},...o,searchParameters:f,placeholder:Xe.placeholder,translations:Xe.modal}),m.current)]})}function nt(){const{siteConfig:e}=(0,ue.A)();return(0,d.jsx)(tt,{...e.themeConfig.algolia})}const rt={navbarSearchContainer:"navbarSearchContainer_Bca1"};function at(e){let{children:t,className:n}=e;return(0,d.jsx)("div",{className:(0,a.A)(n,rt.navbarSearchContainer),children:t})}var ot=n(4070),it=n(1754);var lt=n(5597);const st=e=>e.docs.find((t=>t.id===e.mainDocId));const ut={default:Ce,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:a="",...o}=e;const{i18n:{currentLocale:i,locales:u,localeConfigs:c}}=(0,ue.A)(),p=(0,Pe.o)(),{search:f,hash:g}=(0,l.zy)(),m=[...n,...u.map((e=>{const n=`${`pathname://${p.createUrl({locale:e,fullyQualified:!1})}`}${f}${g}${a}`;return{label:c[e].label,lang:c[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...r],h=t?(0,s.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):c[i].label;return(0,d.jsx)(Ne,{...o,mobile:t,label:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Oe,{className:De}),h]}),items:m})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,d.jsx)(at,{className:n,children:(0,d.jsx)(nt,{})})},dropdown:Ne,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:o=!1}=e;const i=o?"li":"div";return(0,d.jsx)(i,{className:(0,a.A)({navbar__item:!r&&!o,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,ot.zK)(r),i=(0,it.QB)(t,r),l=o?.path===i?.path;return null===i||i.unlisted&&!l?null:(0,d.jsx)(Ce,{exact:!0,...a,isActive:()=>l||!!o?.sidebar&&o.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,ot.zK)(r),i=(0,it.fW)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,d.jsx)(Ce,{exact:!0,...a,isActive:()=>o?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...a}=e;const o=(0,it.Vd)(r)[0],i=t??o.label,l=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(o).path;return(0,d.jsx)(Ce,{...a,label:i,to:l})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:a,dropdownItemsAfter:o,...i}=e;const{search:u,hash:c}=(0,l.zy)(),p=(0,ot.zK)(n),f=(0,ot.jh)(n),{savePreferredVersionName:g}=(0,lt.g1)(n),m=[...a,...f.map((e=>{const t=p.alternateDocVersions[e.name]??st(e);return{label:e.label,to:`${t.path}${u}${c}`,isActive:()=>e===p.activeVersion,onClick:()=>g(e.name)}})),...o],h=(0,it.Vd)(n)[0],y=t&&m.length>1?(0,s.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):h.label,b=t&&m.length>1?void 0:st(h).path;return m.length<=1?(0,d.jsx)(Ce,{...i,mobile:t,label:y,to:b,isActive:r?()=>!1:void 0}):(0,d.jsx)(Ne,{...i,mobile:t,label:y,to:b,items:m,isActive:r?()=>!1:void 0})}};function ct(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),a=ut[r];if(!a)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,d.jsx)(a,{...n})}function dt(){const e=U(),t=(0,k.p)().navbar.items;return(0,d.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(ct,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function pt(e){return(0,d.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,d.jsx)(s.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})})}function ft(){const e=0===(0,k.p)().navbar.items.length,t=X();return(0,d.jsxs)(d.Fragment,{children:[!e&&(0,d.jsx)(pt,{onClick:()=>t.hide()}),t.content]})}function gt(){const e=U();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?(0,d.jsx)(Z,{header:(0,d.jsx)(ye,{}),primaryMenu:(0,d.jsx)(dt,{}),secondaryMenu:(0,d.jsx)(ft,{})}):null}const mt={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function ht(e){return(0,d.jsx)("div",{role:"presentation",...e,className:(0,a.A)("navbar-sidebar__backdrop",e.className)})}function yt(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:r}}=(0,k.p)(),o=U(),{navbarRef:i,isNavbarVisible:l}=V(n);return(0,d.jsxs)("nav",{ref:i,"aria-label":(0,s.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,a.A)("navbar","navbar--fixed-top",n&&[mt.navbarHideable,!l&&mt.navbarHidden],{"navbar--dark":"dark"===r,"navbar--primary":"primary"===r,"navbar-sidebar--show":o.shown}),children:[t,(0,d.jsx)(ht,{onClick:o.toggle}),(0,d.jsx)(gt,{})]})}var bt=n(440);const vt={errorBoundaryError:"errorBoundaryError_a6uf",errorBoundaryFallback:"errorBoundaryFallback_VBag"};function wt(e){return(0,d.jsx)("button",{type:"button",...e,children:(0,d.jsx)(s.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function kt(e){let{error:t}=e;const n=(0,bt.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,d.jsx)("p",{className:vt.errorBoundaryError,children:n})}class xt extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const St="right";function Et(e){let{width:t=30,height:n=30,className:r,...a}=e;return(0,d.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...a,children:(0,d.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function Ct(){const{toggle:e,shown:t}=U();return(0,d.jsx)("button",{onClick:e,"aria-label":(0,s.T)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,d.jsx)(Et,{})})}const Tt={colorModeToggle:"colorModeToggle_DEke"};function _t(e){let{items:t}=e;return(0,d.jsx)(d.Fragment,{children:t.map(((e,t)=>(0,d.jsx)(xt,{onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t}),children:(0,d.jsx)(ct,{...e})},t)))})}function At(e){let{left:t,right:n}=e;return(0,d.jsxs)("div",{className:"navbar__inner",children:[(0,d.jsx)("div",{className:"navbar__items",children:t}),(0,d.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function jt(){const e=U(),t=(0,k.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??St)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),a=t.find((e=>"search"===e.type));return(0,d.jsx)(At,{left:(0,d.jsxs)(d.Fragment,{children:[!e.disabled&&(0,d.jsx)(Ct,{}),(0,d.jsx)(me,{}),(0,d.jsx)(_t,{items:n})]}),right:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(_t,{items:r}),(0,d.jsx)(ie,{className:Tt.colorModeToggle}),!a&&(0,d.jsx)(at,{children:(0,d.jsx)(nt,{})})]})})}function Lt(){return(0,d.jsx)(yt,{children:(0,d.jsx)(jt,{})})}function Rt(e){let{item:t}=e;const{to:n,href:r,label:a,prependBaseUrlToHref:o,...i}=t,l=(0,se.A)(n),s=(0,se.A)(r,{forcePrependBaseUrl:!0});return(0,d.jsxs)(le.A,{className:"footer__link-item",...r?{href:o?s:r}:{to:l},...i,children:[a,r&&!(0,be.A)(r)&&(0,d.jsx)(ke,{})]})}function Nt(e){let{item:t}=e;return t.html?(0,d.jsx)("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):(0,d.jsx)("li",{className:"footer__item",children:(0,d.jsx)(Rt,{item:t})},t.href??t.to)}function Pt(e){let{column:t}=e;return(0,d.jsxs)("div",{className:"col footer__col",children:[(0,d.jsx)("div",{className:"footer__title",children:t.title}),(0,d.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,d.jsx)(Nt,{item:e},t)))})]})}function Ot(e){let{columns:t}=e;return(0,d.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,d.jsx)(Pt,{column:e},t)))})}function Dt(){return(0,d.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function Mt(e){let{item:t}=e;return t.html?(0,d.jsx)("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):(0,d.jsx)(Rt,{item:t})}function It(e){let{links:t}=e;return(0,d.jsx)("div",{className:"footer__links text--center",children:(0,d.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,d.jsxs)(r.Fragment,{children:[(0,d.jsx)(Mt,{item:e}),t.length!==n+1&&(0,d.jsx)(Dt,{})]},n)))})})}function Ft(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,d.jsx)(Ot,{columns:t}):(0,d.jsx)(It,{links:t})}const Bt={footerLogoLink:"footerLogoLink_BH7S"};function zt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,se.h)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,d.jsx)(pe,{className:(0,a.A)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function $t(e){let{logo:t}=e;return t.href?(0,d.jsx)(le.A,{href:t.href,className:Bt.footerLogoLink,target:t.target,children:(0,d.jsx)(zt,{logo:t})}):(0,d.jsx)(zt,{logo:t})}function Ut(e){let{copyright:t}=e;return(0,d.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function qt(e){let{style:t,links:n,logo:r,copyright:o}=e;return(0,d.jsx)("footer",{className:(0,a.A)("footer",{"footer--dark":"dark"===t}),children:(0,d.jsxs)("div",{className:"container container-fluid",children:[n,(r||o)&&(0,d.jsxs)("div",{className:"footer__bottom text--center",children:[r&&(0,d.jsx)("div",{className:"margin-bottom--sm",children:r}),o]})]})})}function Ht(){const{footer:e}=(0,k.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:a}=e;return(0,d.jsx)(qt,{style:a,links:n&&n.length>0&&(0,d.jsx)(Ft,{links:n}),logo:r&&(0,d.jsx)($t,{logo:r}),copyright:t&&(0,d.jsx)(Ut,{copyright:t})})}const Gt=r.memo(Ht),Wt=(0,u.fM)([J.a,function(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,k.p)(),t=(0,x.A)(),[n,a]=(0,r.useState)((()=>!!t&&T()));(0,r.useEffect)((()=>{a(T())}),[]);const o=(0,r.useCallback)((()=>{_(!0),a(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=C.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;C.set(t),r&&_(!1),!r&&T()||a(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:o})),[e,n,o])}();return(0,d.jsx)(A.Provider,{value:n,children:t})},function(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return(0,d.jsx)(H.Provider,{value:n,children:t})},lt.VQ,i.Jx,function(e){let{children:t}=e;return(0,d.jsx)(M.y_,{children:(0,d.jsx)($,{children:(0,d.jsx)(Q,{children:t})})})}]);function Vt(e){let{children:t}=e;return(0,d.jsx)(Wt,{children:t})}var Kt=n(1107);function Qt(e){let{error:t,tryAgain:n}=e;return(0,d.jsx)("main",{className:"container margin-vert--xl",children:(0,d.jsx)("div",{className:"row",children:(0,d.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,d.jsx)(Kt.A,{as:"h1",className:"hero__title",children:(0,d.jsx)(s.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,d.jsx)("div",{className:"margin-vert--lg",children:(0,d.jsx)(wt,{onClick:n,className:"button button--primary shadow--lw"})}),(0,d.jsx)("hr",{}),(0,d.jsx)("div",{className:"margin-vert--md",children:(0,d.jsx)(kt,{error:t})})]})})})}const Yt={mainWrapper:"mainWrapper_z2l0"};function Xt(e){const{children:t,noFooter:n,wrapperClassName:r,title:l,description:s}=e;return(0,b.J)(),(0,d.jsxs)(Vt,{children:[(0,d.jsx)(i.be,{title:l,description:s}),(0,d.jsx)(w,{}),(0,d.jsx)(D,{}),(0,d.jsx)(Lt,{}),(0,d.jsx)("div",{id:p,className:(0,a.A)(y.G.wrapper.main,Yt.mainWrapper,r),children:(0,d.jsx)(o.A,{fallback:e=>(0,d.jsx)(Qt,{...e}),children:t})}),!n&&(0,d.jsx)(Gt,{})]})}},1463:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(5260),a=n(4848);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return(0,a.jsxs)(r.A,{children:[t&&(0,a.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,a.jsx)("meta",{name:"docusaurus_version",content:n}),o&&(0,a.jsx)("meta",{name:"docusaurus_tag",content:o}),i&&(0,a.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,a.jsx)("meta",{name:"docsearch:version",content:n}),o&&(0,a.jsx)("meta",{name:"docsearch:docusaurus_tag",content:o})]})}},4577:(e,t,n)=>{"use strict";n.d(t,{N:()=>y,u:()=>s});var r=n(6540),a=n(8193),o=n(205);var i=n(4848);const l="ease-in-out";function s(e){let{initialState:t}=e;const[n,a]=(0,r.useState)(t??!1),o=(0,r.useCallback)((()=>{a((e=>!e))}),[]);return{collapsed:n,setCollapsed:a,toggleCollapsed:o}}const u={display:"none",overflow:"hidden",height:"0px"},c={display:"block",overflow:"visible",height:"auto"};function d(e,t){const n=t?u:c;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function p(e){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function f(e){let{collapsibleRef:t,collapsed:n,animation:a}=e;const o=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=function(){const t=e.scrollHeight;return{transition:`height ${a?.duration??p(t)}ms ${a?.easing??l}`,height:`${t}px`}}();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return d(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(r(),requestAnimationFrame((()=>{e.style.height=u.height,e.style.overflow=u.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{r()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,a])}function g(e){if(!a.A.canUseDOM)return e?u:c}function m(e){let{as:t="div",collapsed:n,children:a,animation:o,onCollapseTransitionEnd:l,className:s,disableSSRStyle:u}=e;const c=(0,r.useRef)(null);return f({collapsibleRef:c,collapsed:n,animation:o}),(0,i.jsx)(t,{ref:c,style:u?void 0:g(n),onTransitionEnd:e=>{"height"===e.propertyName&&(d(c.current,n),l?.(n))},className:s,children:a})}function h(e){let{collapsed:t,...n}=e;const[a,l]=(0,r.useState)(!t),[s,u]=(0,r.useState)(t);return(0,o.A)((()=>{t||l(!0)}),[t]),(0,o.A)((()=>{a&&u(t)}),[a,t]),a?(0,i.jsx)(m,{...n,collapsed:s}):null}function y(e){let{lazy:t,...n}=e;const r=t?h:m;return(0,i.jsx)(r,{...n})}},5293:(e,t,n)=>{"use strict";n.d(t,{G:()=>y,a:()=>h});var r=n(6540),a=n(8193),o=n(9532),i=n(9466),l=n(6342),s=n(4848);const u=r.createContext(void 0),c="theme",d=(0,i.Wf)(c),p={light:"light",dark:"dark"},f=e=>e===p.dark?p.dark:p.light,g=e=>a.A.canUseDOM?f(document.documentElement.getAttribute("data-theme")):f(e),m=e=>{d.set(f(e))};function h(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.p)(),[a,o]=(0,r.useState)(g(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(o(t),a&&m(t)):(o(n?window.matchMedia("(prefers-color-scheme: dark)").matches?p.dark:p.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",f(a))}),[a]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=d.get();null!==t&&i(f(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const s=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||s.current?s.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:a,setColorMode:i,get isDarkTheme(){return a===p.dark},setLightTheme(){i(p.light)},setDarkTheme(){i(p.dark)}})),[a,i])}();return(0,s.jsx)(u.Provider,{value:n,children:t})}function y(){const e=(0,r.useContext)(u);if(null==e)throw new o.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},5597:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>y,XK:()=>w,g1:()=>v});var r=n(6540),a=n(4070),o=n(7065),i=n(6342),l=n(1754),s=n(9532),u=n(9466),c=n(4848);const d=e=>`docs-preferred-version-${e}`,p={save:(e,t,n)=>{(0,u.Wf)(d(e),{persistence:t}).set(n)},read:(e,t)=>(0,u.Wf)(d(e),{persistence:t}).get(),clear:(e,t)=>{(0,u.Wf)(d(e),{persistence:t}).del()}},f=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const g=r.createContext(null);function m(){const e=(0,a.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>f(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=p.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(p.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){p.save(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function h(e){let{children:t}=e;const n=m();return(0,c.jsx)(g.Provider,{value:n,children:t})}function y(e){let{children:t}=e;return l.C5?(0,c.jsx)(h,{children:t}):(0,c.jsx)(c.Fragment,{children:t})}function b(){const e=(0,r.useContext)(g);if(!e)throw new s.dV("DocsPreferredVersionContextProvider");return e}function v(e){void 0===e&&(e=o.W);const t=(0,a.ht)(e),[n,i]=b(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}function w(){const e=(0,a.Gy)(),[t]=b();function n(n){const r=e[n],{preferredVersionName:a}=t[n];return r.versions.find((e=>e.name===a))??null}const r=Object.keys(e);return Object.fromEntries(r.map((e=>[e,n(e)])))}},5600:(e,t,n)=>{"use strict";n.d(t,{GX:()=>u,YL:()=>s,y_:()=>l});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function l(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(!e)throw new a.dV("NavbarSecondaryMenuContentProvider");return e[0]}function u(e){let{component:t,props:n}=e;const o=(0,r.useContext)(i);if(!o)throw new a.dV("NavbarSecondaryMenuContentProvider");const[,l]=o,s=(0,a.Be)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},4090:(e,t,n)=>{"use strict";n.d(t,{w:()=>a,J:()=>o});var r=n(6540);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},4255:(e,t,n)=>{"use strict";n.d(t,{b:()=>l,w:()=>s});var r=n(6540),a=n(4586),o=n(7485);const i="q";function l(){return(0,o.l)(i)}function s(){const{siteConfig:{baseUrl:e,themeConfig:t}}=(0,a.A)(),{algolia:{searchPagePath:n}}=t;return(0,r.useCallback)((t=>`${e}${n}?${i}=${encodeURIComponent(t)}`),[e,n])}},4581:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(6540),a=n(8193);const o={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(e){let{desktopBreakpoint:t=i}=void 0===e?{}:e;const[n,l]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){l(function(e){if(!a.A.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?o.desktop:o.mobile}(t))}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]),n}},7559:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{blogFooterTagsRow:"theme-blog-footer-tags-row",blogFooterEditMetaRow:"theme-blog-footer-edit-meta-row"}}},1754:(e,t,n)=>{"use strict";n.d(t,{C5:()=>l,Vd:()=>s,QB:()=>c,fW:()=>u});var r=n(6540),a=n(4070),o=n(5597);function i(e){return Array.from(new Set(e))}const l=!!a.Gy;function s(e){const{activeVersion:t}=(0,a.zK)(e),{preferredVersion:n}=(0,o.g1)(e),l=(0,a.r7)(e);return(0,r.useMemo)((()=>i([t,n,l].filter(Boolean))),[t,n,l])}function u(e,t){const n=s(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function c(e,t){const n=s(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${i(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}},481:(e,t,n)=>{"use strict";n.d(t,{s:()=>a});var r=n(4586);function a(e){const{siteConfig:t}=(0,r.A)(),{title:n,titleDelimiter:a}=t;return e?.trim().length?`${e.trim()} ${a} ${n}`:n}},7485:(e,t,n)=>{"use strict";n.d(t,{$Z:()=>i,l:()=>s});var r=n(6540),a=n(6347),o=n(9532);function i(e){!function(e){const t=(0,a.W6)(),n=(0,o._q)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function l(e){return function(e){const t=(0,a.W6)();return(0,r.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}function s(e){const t=l(e)??"",n=function(){const e=(0,a.W6)();return(0,r.useCallback)(((t,n,r)=>{const a=new URLSearchParams(e.location.search);n?a.set(t,n):a.delete(t),(r?.push?e.push:e.replace)({search:a.toString()})}),[e])}();return[t,(0,r.useCallback)(((t,r)=>{n(e,t,r)}),[n,e])]}},5500:(e,t,n)=>{"use strict";n.d(t,{Jx:()=>f,be:()=>c,e3:()=>p});var r=n(6540),a=n(4164),o=n(5260),i=n(6803),l=n(6025),s=n(481),u=n(4848);function c(e){let{title:t,description:n,keywords:r,image:a,children:i}=e;const c=(0,s.s)(t),{withBaseUrl:d}=(0,l.h)(),p=a?d(a,{absolute:!0}):void 0;return(0,u.jsxs)(o.A,{children:[t&&(0,u.jsx)("title",{children:c}),t&&(0,u.jsx)("meta",{property:"og:title",content:c}),n&&(0,u.jsx)("meta",{name:"description",content:n}),n&&(0,u.jsx)("meta",{property:"og:description",content:n}),r&&(0,u.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),p&&(0,u.jsx)("meta",{property:"og:image",content:p}),p&&(0,u.jsx)("meta",{name:"twitter:image",content:p}),i]})}const d=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const i=r.useContext(d),l=(0,a.A)(i,t);return(0,u.jsxs)(d.Provider,{value:l,children:[(0,u.jsx)(o.A,{children:(0,u.jsx)("html",{className:l})}),n]})}function f(e){let{children:t}=e;const n=(0,i.A)(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const o=`plugin-id-${n.plugin.id}`;return(0,u.jsx)(p,{className:(0,a.A)(r,o),children:t})}},9532:(e,t,n)=>{"use strict";n.d(t,{Be:()=>u,ZC:()=>l,_q:()=>i,dV:()=>s,fM:()=>c});var r=n(6540),a=n(205),o=n(4848);function i(e){const t=(0,r.useRef)(e);return(0,a.A)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function l(e){const t=(0,r.useRef)();return(0,a.A)((()=>{t.current=e})),t.current}class s extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function u(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function c(e){return t=>{let{children:n}=t;return(0,o.jsx)(o.Fragment,{children:e.reduceRight(((e,t)=>(0,o.jsx)(t,{children:e})),n)})}}},1252:(e,t,n)=>{"use strict";function r(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}n.d(t,{G:()=>r})},9169:(e,t,n)=>{"use strict";n.d(t,{ys:()=>r});n(6540),n(8328),n(4586);function r(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}},2967:(e,t,n)=>{"use strict";n.d(t,{Cy:()=>i,af:()=>l});var r=n(4070),a=n(4586),o=n(5597);const i="default";function l(){const{i18n:e}=(0,a.A)(),t=(0,r.Gy)(),n=(0,r.gk)(),l=(0,o.XK)();const s=[i,...Object.keys(t).map((function(e){const r=n?.activePlugin.pluginId===e?n.activeVersion:void 0,a=l[e],o=t[e].versions.find((e=>e.isLast));return function(e,t){return`docs-${e}-${t}`}(e,(r??a??o).name)}))];return{locale:e.currentLocale,tags:s}}},9466:(e,t,n)=>{"use strict";n.d(t,{Wf:()=>s});n(6540);const r="localStorage";function a(e){let{key:t,oldValue:n,newValue:r,storage:a}=e;if(n===r)return;const o=document.createEvent("StorageEvent");o.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,a),window.dispatchEvent(o)}function o(e){if(void 0===e&&(e=r),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,i||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),i=!0),null}var t}let i=!1;const l={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function s(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(e);const n=o(t?.persistence);return null===n?l:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{const r=n.getItem(e);n.setItem(e,t),a({key:e,oldValue:r,newValue:t,storage:n})}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{const t=n.getItem(e);n.removeItem(e),a({key:e,oldValue:t,newValue:null,storage:n})}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}},listen:t=>{try{const r=r=>{r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}catch(r){return console.error(`Docusaurus storage error, can't listen for changes of key=${e}`,r),()=>{}}}}}},2131:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(4586),a=n(6347),o=n(440);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:l}}=(0,r.A)(),{pathname:s}=(0,a.zy)(),u=(0,o.applyTrailingSlash)(s,{trailingSlash:n,baseUrl:e}),c=l===i?e:e.replace(`/${l}/`,"/"),d=u.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${c}`:`${c}${e}/`}(n)}${d}`}}}},6342:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(4586);function a(){return(0,r.A)().siteConfig.themeConfig}},8126:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var r=n(4586);function a(){const{siteConfig:{themeConfig:e}}=(0,r.A)();return e}},1062:(e,t,n)=>{"use strict";n.d(t,{C:()=>l});var r=n(6540),a=n(1252),o=n(6025),i=n(8126);function l(){const{withBaseUrl:e}=(0,o.h)(),{algolia:{externalUrlRegex:t,replaceSearchResultPathname:n}}=(0,i.c)();return(0,r.useCallback)((r=>{const o=new URL(r);if((0,a.G)(t,o.href))return r;const i=`${o.pathname+o.hash}`;return e(function(e,t){return t?e.replaceAll(new RegExp(t.from,"g"),t.to):e}(i,n))}),[e,t,n])}},2983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=void 0;const r=n(2566);function a(e){return e.endsWith("/")?e:`${e}/`}function o(e){return(0,r.removeSuffix)(e,"/")}t.addTrailingSlash=a,t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),l="/"===i||i===r?i:(s=i,n?a(s):o(s));var s;return e.replace(i,l)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=o},253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},440:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var a=n(2983);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}}),Object.defineProperty(t,"addTrailingSlash",{enumerable:!0,get:function(){return a.addTrailingSlash}}),Object.defineProperty(t,"addLeadingSlash",{enumerable:!0,get:function(){return a.addLeadingSlash}}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return a.removeTrailingSlash}});var o=n(2566);Object.defineProperty(t,"addPrefix",{enumerable:!0,get:function(){return o.addPrefix}}),Object.defineProperty(t,"removeSuffix",{enumerable:!0,get:function(){return o.removeSuffix}}),Object.defineProperty(t,"addSuffix",{enumerable:!0,get:function(){return o.addSuffix}}),Object.defineProperty(t,"removePrefix",{enumerable:!0,get:function(){return o.removePrefix}});var i=n(253);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return i.getErrorCausalChain}})},2566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=void 0,t.addPrefix=function(e,t){return e.startsWith(t)?e:`${t}${e}`},t.removeSuffix=function(e,t){return""===t?e:e.endsWith(t)?e.slice(0,-t.length):e},t.addSuffix=function(e,t){return e.endsWith(t)?e:`${e}${t}`},t.removePrefix=function(e,t){return e.startsWith(t)?e.slice(t.length):e}},1513:(e,t,n)=>{"use strict";n.d(t,{zR:()=>w,TM:()=>T,yJ:()=>f,sC:()=>A,AO:()=>p});var r=n(8168);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r=0;p--){var f=i[p];"."===f?o(i,p):".."===f?(o(i,p),d++):d&&(o(i,p),d--)}if(!u)for(;d--;d)i.unshift("..");!u||""===i[0]||i[0]&&a(i[0])||i.unshift("");var g=i.join("/");return n&&"/"!==g.substr(-1)&&(g+="/"),g};var l=n(1561);function s(e){return"/"===e.charAt(0)?e:"/"+e}function u(e){return"/"===e.charAt(0)?e.substr(1):e}function c(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function f(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.A)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=f(e,t,m(),w.location);c.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(4363),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,g=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(g){var a=f(n);a&&a!==g&&e(t,a,r)}var i=c(n);d&&(i=i.concat(d(n)));for(var l=s(t),m=s(n),h=0;h{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,a,o,i,l],c=0;(s=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},4634:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},119:(e,t,n)=>{"use strict";n.r(t)},1043:(e,t,n)=>{"use strict";n.r(t)},5947:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function a(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),u=o.querySelector(r.barSelector),c=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(u,i(e,c,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),u=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&f(a),u!=document.body&&c(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&f(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function u(e,t){return("string"==typeof e?e:p(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=p(e),r=n+t;u(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=p(e);u(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function p(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},5302:(e,t,n)=>{var r=n(4634);e.exports=f,e.exports.parse=o,e.exports.compile=function(e,t){return l(o(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=p;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,i=0,l="",c=t&&t.delimiter||"/";null!=(n=a.exec(e));){var d=n[0],p=n[1],f=n.index;if(l+=e.slice(i,f),i=f+d.length,p)l+=p[1];else{var g=e[i],m=n[2],h=n[3],y=n[4],b=n[5],v=n[6],w=n[7];l&&(r.push(l),l="");var k=null!=m&&null!=g&&g!==m,x="+"===v||"*"===v,S="?"===v||"*"===v,E=n[2]||c,C=y||b;r.push({name:h||o++,prefix:m||"",delimiter:E,optional:S,repeat:x,partial:k,asterisk:!!w,pattern:C?u(C):w?".*":"[^"+s(E)+"]+?"})}}return i{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},8722:(e,t,n)=>{const r=n(6969),a=n(8380),o=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...o,...Object.keys(Prism.languages)];a(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(3157).resolve(t)],delete Prism.languages[e],n(3157)(t),o.add(e)}))}i.silent=!1,e.exports=i},9700:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=o.length);s++){var u=l[s];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=o[a],d=n.tokenStack[c],p="string"==typeof u?u:u.content,f=t(r,c),g=p.indexOf(f);if(g>-1){++a;var m=p.substring(0,g),h=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=p.substring(g+f.length),b=[];m&&b.push.apply(b,i([m])),b.push(h),y&&b.push.apply(b,i([y])),"string"==typeof u?l.splice.apply(l,[s,1].concat(b)):u.content=b}}else u.content&&i(u.content)}return l}(n.tokens)}}}})}(Prism)},8692:(e,t,n)=>{var r={"./":8722};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=8692},3157:(e,t,n)=>{var r={"./":8722};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=3157},8380:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n "));var l={},s=e[r];if(s){function u(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in l))for(var i in a(t,o),l[t]=!0,n[t])l[i]=!0}t(s.require,u),t(s.optional,u),t(s.modify,u)}n[r]=l,o.pop()}}return function(e){var t=n[e];return t||(a(e,r),t=n[e]),t}}function a(e){for(var t in e)return!0;return!1}return function(o,i,l){var s=function(e){var t={};for(var n in e){var r=e[n];for(var a in r)if("meta"!=a){var o=r[a];t[a]="string"==typeof o?{title:o}:o}}return t}(o),u=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var a in n={},e){var o=e[a];t(o&&o.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+a+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+a+" because it is a component.");n[t]=a}))}return n[r]||r}}(s);i=i.map(u),l=(l||[]).map(u);var c=n(i),d=n(l);i.forEach((function e(n){var r=s[n];t(r&&r.require,(function(t){t in d||(c[t]=!0,e(t))}))}));for(var p,f=r(s),g=c;a(g);){for(var m in p={},g){var h=s[m];t(h&&h.modify,(function(e){e in d&&(p[e]=!0)}))}for(var y in d)if(!(y in c))for(var b in f(y))if(b in c){p[y]=!0;break}for(var v in g=p)c[v]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,a){var o=a?a.series:void 0,i=a?a.parallel:e,l={},s={};function u(e){if(e in l)return l[e];s[e]=!0;var a,c=[];for(var d in t(e))d in n&&c.push(d);if(0===c.length)a=r(e);else{var p=i(c.map((function(e){var t=u(e);return delete s[e],t})));o?a=o(p,(function(){return r(e)})):r(e)}return l[e]=a}for(var c in n)u(c);var d=[];for(var p in s)d.push(l[p]);return i(d)}(f,c,t,n)}};return w}}();e.exports=t},2694:(e,t,n)=>{"use strict";var r=n(6925);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:(e,t,n)=>{"use strict";var r=n(6540),a=n(9982);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n