{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 基于MindSpore Quantum的Grover搜索算法和龙算法\n",
    "\n",
    "[![下载Notebook](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.5.0/resource/_static/logo_notebook.svg)](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/notebook/r2.5.0/mindquantum/zh_cn/case_library/mindspore_grover_search_algorithm.ipynb) \n",
    "[![下载样例代码](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.5.0/resource/_static/logo_download_code.svg)](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/notebook/r2.5.0/mindquantum/zh_cn/case_library/mindspore_grover_search_algorithm.py) \n",
    "[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.5.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.5.0/docs/mindquantum/docs/source_zh_cn/case_library/grover_search_algorithm.ipynb)\n",
    "\n",
    "## 概述\n",
    "\n",
    "如果你听过量子计算,那么你一定听说过Grover搜索算法。1996年,Lov Grover \\[1\\] 提出了Grover搜索算法,它是一种利用量子状态的叠加性进行并行计算并实现加速的算法。Grover搜索算法被公认为是继Shor算法后的第二大量子算法,也是第一个被完整的实验实现的量子算法,它解决的是无序数据库搜索问题。1997年,Bennett \\[2\\] 等人证明,对于非结构化的量子搜索问题,至少需要$\\Omega(\\sqrt{N})$​次量子查询,因此Grover搜索算法对于该问题是渐进意义下的最优算法。\n",
    "\n",
    "无序数据库搜索问题(Unordered  Database Search problem)就是从一个海量元素的无序数据库中,找到某些满足要求的元素。由于数据库中元素的数量是巨大的且这些元素是无序排列的,所以,要验证给定的元素是否满足要求很容易,但反过来,要找到这些元素却不是一件容易的事。\n",
    "\n",
    "求解无序数据库搜索问题(不妨假设只有一个目标搜索数据),经典算法所需的时间复杂度为$\\mathcal{O}(N)$,而Grover搜索算法所需的时间复杂度仅为$\\mathcal{O}(\\sqrt{N})$,相比经典算法具有平方加速,展示了量子计算的强大性能。此外,Grover搜索算法中用到的振幅扩大技巧,对许多启发式的经典搜索算法可以实现加速,因而具有广泛的应用。\n",
    "\n",
    "本文档将会介绍Grover搜索算法的基本原理,以及通过两个具体的小例子来展示如何利用MindSpore Quantum实现该算法。\n",
    "\n",
    "## 问题描述\n",
    "\n",
    "我们需要在一组无序的$N$元素集合(数据库)中进行搜索。将数据库中的元素与索引(从$0$到$N-1$之间的整数)建立一一对应,我们关注于搜索这些元素的索引。考虑将该搜索问题表示为一个关于输入$x$的函数$f(x)$,其中$x$为$0$到$N-1$之间的整数。那么,函数$f$定义为:\n",
    "\n",
    "$$\n",
    "\\begin{equation}\n",
    "f(x)=\\begin{cases}0,x\\neq x_{target}\\\\\\\\\n",
    "1,x=x_{target}\n",
    "\\end{cases}\n",
    "\\end{equation}.\n",
    "$$\n",
    "\n",
    "不失一般性,假设$N=2^n$​,那么在量子系统中,索引以量子态$|0\\rangle,|1\\rangle,...,|N-1\\rangle$​(或$|00...0\\rangle,|00...1\\rangle,...,|11...1\\rangle$​)表示,也即我们可以使用$n$​个量子比特存储这些索引。\n",
    "\n",
    "同时假设搜索问题只有一个目标态$|\\omega\\rangle$。Grover搜索算法的目标就是以极大的概率将$|\\omega\\rangle$搜索出来。\n",
    "\n",
    "## Grover搜索算法的基本原理\n",
    "\n",
    "Grover搜索算法的基本原理:首先通过 [Hadamard](https://www.mindspore.cn/mindquantum/docs/zh-CN/r0.10/core/gates/mindquantum.core.gates.HGate.html) 门产生均匀叠加态,然后反复调用Grover迭代(或称为$G$算子),以放大目标项的概率振幅同时抑制非目标项的概率振幅(该方法称之为振幅放大),最后对末态进行测量,那么就能以极大的概率得到目标态$|\\omega\\rangle$​​。\n",
    "\n",
    "下面介绍Grover算法的主要步骤。\n",
    "\n",
    "### Step 1:数据库初始化\n",
    "\n",
    "对$|0\\rangle^{\\otimes n}$​​​​执行$H^{\\otimes n}$​​​​​操作,使得数据库被初始为一个均匀叠加态,即\n",
    "\n",
    "$$\n",
    "|\\psi_0\\rangle=H^{\\otimes n}|0\\rangle^{\\otimes n}=\\frac{1}{\\sqrt{N}}\\sum_{i=0}^{N-1}|i\\rangle.\n",
    "$$\n",
    "\n",
    "### Step 2:Grover迭代\n",
    "\n",
    "Grover迭代又可以分解为四步:\n",
    "\n",
    "#### 子步骤一\n",
    "\n",
    "执行Oracle算子$U_{\\omega}$​,翻转目标态$|\\omega \\rangle$​​​​​的相位。\n",
    "\n",
    "为了将需要寻找的数据和其他的数据区别开,最简单的方法就是翻转目标态的相位(增加一个负号),此时我们需要构造一个Oracle算子$U_{\\omega}$,其作用如下:\n",
    "\n",
    "$$\n",
    "\\begin{equation}\n",
    "U_{\\omega}|x\\rangle=\\begin{cases}\n",
    "&|x\\rangle,x\\neq \\omega&\\\\\\\\\n",
    "-&|x\\rangle,x=\\omega&\n",
    "\\end{cases}\n",
    "\\end{equation}.\n",
    "$$\n",
    "\n",
    "由于当$x=\\omega$​时,$f(\\omega)=1$​,那么$U_{\\omega}$​​的作用还可以表示成:\n",
    "\n",
    "$$\n",
    "U_{\\omega}|x\\rangle=(-1)^{f(x)}|x\\rangle,\n",
    "$$\n",
    "\n",
    "其矩阵表达式为\n",
    "\n",
    "$$\n",
    "\\begin{equation}\n",
    "U_{\\omega}=\n",
    "\\left[\n",
    "\\begin{array}{ccc}\n",
    "     (-1)^{f(0)} & 0           & \\dots  & 0            \\\\\\\\\n",
    "     0           & (-1)^{f(1)} & \\dots  & 0            \\\\\\\\\n",
    "     \\vdots      & \\vdots      & \\ddots & \\vdots       \\\\\\\\\n",
    "     0           & 0           & \\dots  & (-1)^{f(N-1)}\n",
    "\\end{array}\n",
    "\\right]\n",
    "\\end{equation}.\n",
    "$$\n",
    "\n",
    "#### 子步骤二\n",
    "\n",
    "执行$H^{\\otimes n}$操作。\n",
    "\n",
    "对$n$位量子比特执行$H^{\\otimes n}$操作。\n",
    "\n",
    "#### 子步骤三\n",
    "\n",
    "执行条件相移算子$P$。\n",
    "\n",
    "条件相移算子$P$能使$|0\\rangle$​态以外的每个态的相位都翻转,其作用如下:\n",
    "\n",
    "$$\n",
    "\\begin{equation}\n",
    "P|x\\rangle=\\begin{cases}&|0\\rangle,x= 0&\\\\\\\\\n",
    "-&|x\\rangle,x\\neq0&\n",
    "\\end{cases}\n",
    "\\end{equation}.\n",
    "$$\n",
    "\n",
    "其矩阵表达式为\n",
    "\n",
    "$$\n",
    "\\begin{equation}\n",
    "P = 2(|0\\rangle\\langle0|)^{\\otimes n} - I_n =\n",
    "\\left[\n",
    "\\begin{array}{ccc}\n",
    "     1      & 0      & \\dots  & 0            \\\\\\\\\n",
    "     0      & -1     & \\dots  & 0            \\\\\\\\\n",
    "     \\vdots & \\vdots & \\ddots & \\vdots       \\\\\\\\\n",
    "     0      & 0      & \\dots  & -1\n",
    "\\end{array}\n",
    "\\right]\n",
    "\\end{equation}.\n",
    "$$\n",
    "\n",
    "#### 子步骤四\n",
    "\n",
    "再次执行$H^{\\otimes n}$操作。\n",
    "\n",
    "至此,完整的$G$算子可以表示为\n",
    "\n",
    "$$\n",
    "G = H^{\\otimes n} [2(|0\\rangle\\langle0|)^{\\otimes n} - I_n] H^{\\otimes n} U_{\\omega}.\n",
    "$$\n",
    "\n",
    "注意:$G$算子需要迭代的次数为\n",
    "\n",
    "$$\n",
    "r = \\left[ \\frac{\\pi}{4} \\sqrt{\\frac{N}{M}} \\right] \\sim O(\\sqrt{N}),\n",
    "$$\n",
    "\n",
    "其中,M表示目标态的个数。\n",
    "\n",
    "### Step 3:测量\n",
    "\n",
    "对末态进行$\\\\{|0\\rangle,|1\\rangle\\\\}$基测量,就能以极大的概率得到目标态$|\\omega \\rangle$。\n",
    "\n",
    "Grover搜索算法的完整量子线路模型如下所示:\n",
    "\n",
    "![grover algorithm circuit](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.5.0/docs/mindquantum/docs/source_zh_cn/images/grover_algorithm_circuit.png)\n",
    "\n",
    "## 构造翻转量子比特相位的酉算子\n",
    "\n",
    "通过上述介绍,我们发现,Grover搜索算法中最关键的部分就是存在可以翻转量子比特相位的酉算子,Oracle算子$U_{\\omega}$可以翻转目标态的相位,条件相移算子$P$可以翻转$|0\\rangle$态以外的每个态的相位。\n",
    "\n",
    "接下来,我们将构造可以翻转某一位量子比特相位的酉算子,定义如下:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from mindquantum.core.circuit import Circuit\n",
    "from mindquantum.core.gates import Z\n",
    "\n",
    "def bitphaseflip_operator(phase_inversion_qubit, n_qubits):   # 定义可以翻转某一位量子比特相位的函数\n",
    "    s = [1 for i in range(1 << n_qubits)]\n",
    "    for i in phase_inversion_qubit:\n",
    "        s[i] = -1\n",
    "    if s[0] == -1:\n",
    "        for i in range(len(s)):\n",
    "            s[i] = -1 * s[i]\n",
    "    circuit = Circuit()\n",
    "    length = len(s)\n",
    "    cz = []\n",
    "    for i in range(length):\n",
    "        if s[i] == -1:\n",
    "            cz.append([])\n",
    "            current = i\n",
    "            t = 0\n",
    "            while current != 0:\n",
    "                if (current & 1) == 1:\n",
    "                    cz[-1].append(t)\n",
    "                t += 1\n",
    "                current = current >> 1\n",
    "            for j in range(i + 1, length):\n",
    "                if i & j == i:\n",
    "                    s[j] = -1 * s[j]\n",
    "    for i in cz:\n",
    "        if i:\n",
    "            if len(i) > 1:\n",
    "                circuit += Z.on(i[-1], i[:-1])\n",
    "            else:\n",
    "                circuit += Z.on(i[0])\n",
    "\n",
    "    return circuit"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在, `bitphaseflip_operator()` 函数就可以实现翻转某一位量子比特的相位,只需要输入需要翻转相位的目标量子态和量子比特总数即可。\n",
    "\n",
    "举个例子,我们现在生成3​​量子比特的均匀叠加态,运行如下代码:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"156.8\" height=\"200.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><rect x=\"0\" y=\"0.0\" width=\"156.8\" height=\"200.0\" fill=\"#ffffff\" /><text x=\"20.0\" y=\"40.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q0: </text><text x=\"20.0\" y=\"100.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q1: </text><text x=\"20.0\" y=\"160.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q2: </text><line x1=\"48.8\" x2=\"136.8\" y1=\"40.0\" y2=\"40.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"136.8\" y1=\"100.0\" y2=\"100.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"136.8\" y1=\"160.0\" y2=\"160.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"72.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text></svg>"
      ],
      "text/plain": [
       "<mindquantum.io.display.circuit_svg_drawer.SVGCircuit at 0x7f8d90094d00>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pylint: disable=W0104\n",
    "from mindquantum.core.circuit import UN\n",
    "from mindquantum.core.gates import H\n",
    "from mindquantum.simulator import Simulator\n",
    "\n",
    "n_qubits = 3                                 # 设定量子比特数为3\n",
    "sim = Simulator('mqvector', n_qubits)        # 使用mqvector模拟器,命名为sim\n",
    "\n",
    "circuit = Circuit()                          # 初始化量子线路,命名为circuit\n",
    "circuit += UN(H, n_qubits)                   # 每位量子比特上执行H门操作\n",
    "\n",
    "sim.apply_circuit(circuit)                   # 通过模拟器sim运行搭建好的量子线路circuit\n",
    "\n",
    "circuit.svg()                                # 打印此时的量子线路circuit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "√2/4¦000⟩\n",
      "√2/4¦001⟩\n",
      "√2/4¦010⟩\n",
      "√2/4¦011⟩\n",
      "√2/4¦100⟩\n",
      "√2/4¦101⟩\n",
      "√2/4¦110⟩\n",
      "√2/4¦111⟩\n"
     ]
    }
   ],
   "source": [
    "print(sim.get_qs(True))                      # 打印模拟器sim中运行量子线路circuit后的末态"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到此时的量子线路,以及我们成功生成了3量子比特的均匀叠加态。\n",
    "\n",
    "假设我们需要翻转$|4\\rangle$态的相位,只需调用我们定义好的`bitphaseflip_operator()`函数即可,运行如下代码:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"396.8\" height=\"200.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><rect x=\"0\" y=\"0.0\" width=\"396.8\" height=\"200.0\" fill=\"#ffffff\" /><text x=\"20.0\" y=\"40.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q0: </text><text x=\"20.0\" y=\"100.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q1: </text><text x=\"20.0\" y=\"160.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q2: </text><line x1=\"48.8\" x2=\"376.8\" y1=\"40.0\" y2=\"40.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"376.8\" y1=\"100.0\" y2=\"100.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"376.8\" y1=\"160.0\" y2=\"160.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"72.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"132.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"152.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"212.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"212.8\" x2=\"212.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"192.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"212.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"272.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"272.8\" x2=\"272.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"252.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"272.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"332.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"332.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"332.8\" x2=\"332.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"312.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"332.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text></svg>"
      ],
      "text/plain": [
       "<mindquantum.io.display.circuit_svg_drawer.SVGCircuit at 0x7f8d900949d0>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pylint: disable=W0104\n",
    "sim.reset()                                                      # 重置模拟器sim维护好的量子态,使得初始化的量子态为|000>\n",
    "\n",
    "phase_inversion_qubit = [4]                                      # 翻转|4>态的相位\n",
    "operator = bitphaseflip_operator(phase_inversion_qubit, n_qubits)# 调用我们定义好的bitphaseflip_operator()函数\n",
    "\n",
    "circuit += operator                                              # 在量子线路circuit中添加翻转|4>态的相位所需的量子门\n",
    "\n",
    "sim.apply_circuit(circuit)                                       # 通过模拟器sim再次运行搭建好的量子线路circuit\n",
    "\n",
    "circuit.svg()                                                    # 打印此时的量子线路circuit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "√2/4¦000⟩\n",
      "√2/4¦001⟩\n",
      "√2/4¦010⟩\n",
      "√2/4¦011⟩\n",
      "-√2/4¦100⟩\n",
      "√2/4¦101⟩\n",
      "√2/4¦110⟩\n",
      "√2/4¦111⟩\n"
     ]
    }
   ],
   "source": [
    "print(sim.get_qs(True))                                          # 打印模拟器sim中运行量子线路circuit后的末态"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到此时的量子线路,以及$|100\\rangle$​​的相位翻转为-1,运行如下代码:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n"
     ]
    }
   ],
   "source": [
    "print(int('100', 2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到,发生相位翻转的$|100\\rangle$态即为我们希望相位翻转的$|4\\rangle$态。\n",
    "\n",
    "假设我们需要翻转除$|0\\rangle$态以外的每个态的相位,运行如下代码:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"456.8\" height=\"200.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><rect x=\"0\" y=\"0.0\" width=\"456.8\" height=\"200.0\" fill=\"#ffffff\" /><text x=\"20.0\" y=\"40.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q0: </text><text x=\"20.0\" y=\"100.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q1: </text><text x=\"20.0\" y=\"160.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q2: </text><line x1=\"48.8\" x2=\"436.8\" y1=\"40.0\" y2=\"40.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"436.8\" y1=\"100.0\" y2=\"100.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"436.8\" y1=\"160.0\" y2=\"160.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"72.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"132.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"152.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"132.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"152.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"212.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"212.8\" x2=\"212.8\" y1=\"40.0\" y2=\"100.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"192.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"212.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"132.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"152.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"272.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"272.8\" x2=\"272.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"252.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"272.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"332.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"332.8\" x2=\"332.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"312.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"332.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"392.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"392.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"392.8\" x2=\"392.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"372.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"392.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text></svg>"
      ],
      "text/plain": [
       "<mindquantum.io.display.circuit_svg_drawer.SVGCircuit at 0x7f8d90094dc0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pylint: disable=W0104\n",
    "n_qubits = 3                                                     # 设定量子比特数为3\n",
    "sim1 = Simulator('mqvector', n_qubits)                           # 使用mqvector模拟器,命名为sim1\n",
    "\n",
    "operator1 = bitphaseflip_operator([i for i in range(1, pow(2, n_qubits))], n_qubits) # 调用我们定义好的bitphaseflip_operator()函数,翻转除|0>态以外的每个态的相位,命名为operator1\n",
    "\n",
    "circuit1 = Circuit()                                             # 初始化量子线路,命名为circuit1\n",
    "circuit1 += UN(H, n_qubits)                                      # 每位量子比特上执行H门操作\n",
    "circuit1 += operator1                                            # 在量子线路circuit1中添加翻转除|0>态以外的每个态的相位所需的量子门\n",
    "\n",
    "sim1.apply_circuit(circuit1)                                     # 通过模拟器sim1运行搭建好的量子线路circuit1\n",
    "\n",
    "circuit1.svg()                                                         # 打印此时的量子线路circuit1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "√2/4¦000⟩\n",
      "-√2/4¦001⟩\n",
      "-√2/4¦010⟩\n",
      "-√2/4¦011⟩\n",
      "-√2/4¦100⟩\n",
      "-√2/4¦101⟩\n",
      "-√2/4¦110⟩\n",
      "-√2/4¦111⟩\n"
     ]
    }
   ],
   "source": [
    "print(sim1.get_qs(True))                                         # 打印模拟器sim1中运行量子线路circuit1后的末态"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到此时的量子线路,以及我们成功翻转除$|0\\rangle$态以外的每个态的相位。\n",
    "\n",
    "也就是说,我们定义的函数`bitphaseflip_operator()`可以实现Grover搜素算法中的Oracle算子$U_{\\omega}$和条件相移算子$P$。\n",
    "\n",
    "## 利用MindSpore Quantum实现Grover搜素算法实例\n",
    "\n",
    "### 实例1:$n=3$​,$|\\omega\\rangle=|2\\rangle$(单目标)\n",
    "\n",
    "首先,我们需要定义$G$算子,运行如下代码:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def G(phase_inversion_qubit, n_qubits):           # 定义Grover搜索算法中的G算子\n",
    "    operator = bitphaseflip_operator(phase_inversion_qubit, n_qubits)\n",
    "    operator += UN(H, n_qubits)\n",
    "    operator += bitphaseflip_operator([i for i in range(1, pow(2, n_qubits))], n_qubits)\n",
    "    operator += UN(H, n_qubits)\n",
    "    return operator"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "然后,我们根据Grover搜索算法的量子线路模型在MindSpore Quantum中搭建对应的量子线路:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1476.8\" height=\"200.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><rect x=\"0\" y=\"0.0\" width=\"1476.8\" height=\"200.0\" fill=\"#ffffff\" /><text x=\"20.0\" y=\"40.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q0: </text><text x=\"20.0\" y=\"100.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q1: </text><text x=\"20.0\" y=\"160.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q2: </text><line x1=\"48.8\" x2=\"1456.8\" y1=\"40.0\" y2=\"40.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"1456.8\" y1=\"100.0\" y2=\"100.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"1456.8\" y1=\"160.0\" y2=\"160.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"72.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"132.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"152.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"212.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"212.8\" x2=\"212.8\" y1=\"40.0\" y2=\"100.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"192.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"212.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"272.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"272.8\" x2=\"272.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"252.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"272.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"332.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"332.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"332.8\" x2=\"332.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"312.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"332.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"372.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"392.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"372.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"392.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"372.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"392.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"432.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"452.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"432.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"452.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"512.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"512.8\" x2=\"512.8\" y1=\"40.0\" y2=\"100.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"492.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"512.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"432.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"452.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"572.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"572.8\" x2=\"572.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"552.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"572.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"632.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"632.8\" x2=\"632.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"612.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"632.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"692.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"692.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"692.8\" x2=\"692.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"672.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"692.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"732.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"752.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"732.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"752.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"732.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"752.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"792.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"812.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"872.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"872.8\" x2=\"872.8\" y1=\"40.0\" y2=\"100.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"852.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"872.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"932.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"932.8\" x2=\"932.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"912.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"932.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"992.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"992.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"992.8\" x2=\"992.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"972.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"992.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"1032.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1052.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"1032.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1052.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"1032.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1052.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"1092.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1112.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"1092.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1112.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1172.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1172.8\" x2=\"1172.8\" y1=\"40.0\" y2=\"100.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1152.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1172.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"1092.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1112.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1232.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1232.8\" x2=\"1232.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1212.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1232.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1292.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1292.8\" x2=\"1292.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1272.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1292.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1352.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1352.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1352.8\" x2=\"1352.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1332.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1352.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"1392.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1412.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"1392.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1412.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"1392.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1412.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text></svg>"
      ],
      "text/plain": [
       "<mindquantum.io.display.circuit_svg_drawer.SVGCircuit at 0x7f8d09e91ca0>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pylint: disable=W0104\n",
    "from numpy import pi, sqrt\n",
    "\n",
    "n_qubits = 3                                      # 设定量子比特数为3\n",
    "phase_inversion_qubit = [2]                       # 设定需要翻转相位的目标态,在这里翻转|2>态的相位\n",
    "\n",
    "N = 2 ** (n_qubits)                               # 计算出数据库中元素的总个数\n",
    "M = len(phase_inversion_qubit)                    # 计算出目标态的总个数\n",
    "\n",
    "r = int(pi / 4 * sqrt(N / M))                     # 设定G算子迭代次数为r\n",
    "\n",
    "sim2 = Simulator('mqvector', n_qubits)            # 使用mqvector模拟器,命名为sim2\n",
    "\n",
    "circuit2 = Circuit()                              # 初始化量子线路,命名为circuit2\n",
    "circuit2 += UN(H, n_qubits)                       # 每位量子比特上执行H门操作\n",
    "\n",
    "for i in range(r):                                # 循环执行G算子r次\n",
    "    circuit2 += G(phase_inversion_qubit, n_qubits)\n",
    "\n",
    "sim2.apply_circuit(circuit2)                      # 通过模拟器sim2运行搭建好的量子线路circuit2\n",
    "\n",
    "circuit2.svg()                                    # 打印此时的量子线路circuit2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-√2/16¦000⟩\n",
      "-√2/16¦001⟩\n",
      "0.9722718241315036¦010⟩\n",
      "-√2/16¦011⟩\n",
      "-√2/16¦100⟩\n",
      "-√2/16¦101⟩\n",
      "-√2/16¦110⟩\n",
      "-√2/16¦111⟩\n"
     ]
    }
   ],
   "source": [
    "print(sim2.get_qs(True))                          # 打印模拟器sim2中运行量子线路circuit2后的末态"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到,$|010\\rangle$态的振幅为0.9722718241315036,相比于其他的量子态,这是极大的振幅,也就是说,若我们测量此时的状态,将会以极大的概率得到目标态$|010\\rangle$​,运行如下代码进行测量:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"415.6\" height=\"327.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><rect x=\"0\" y=\"0\" width=\"415.6\" height=\"327.0\" fill=\"#ffffff\" /><text x=\"10\" y=\"17.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" >Shots:\n",
       " 1000 </text><text x=\"10\" y=\"31.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" >Keys: q2 q1 q0 </text><line x1=\"45.599999999999994\" x2=\"405.6\" y1=\"62.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"45.599999999999994\" x2=\"45.599999999999994\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"47.599999999999994\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.0 </text><line x1=\"45.599999999999994\" x2=\"45.599999999999994\" y1=\"62.0\" y2=\"317.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"105.6\" x2=\"105.6\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"107.6\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.185 </text><line x1=\"105.6\" x2=\"105.6\" y1=\"62.0\" y2=\"317.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"165.6\" x2=\"165.6\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"167.6\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.369 </text><line x1=\"165.6\" x2=\"165.6\" y1=\"62.0\" y2=\"317.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"225.6\" x2=\"225.6\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"227.6\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.554 </text><line x1=\"225.6\" x2=\"225.6\" y1=\"62.0\" y2=\"317.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"285.6\" x2=\"285.6\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"287.6\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.738 </text><line x1=\"285.6\" x2=\"285.6\" y1=\"62.0\" y2=\"317.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"345.6\" x2=\"345.6\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"347.6\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.923 </text><line x1=\"345.6\" x2=\"345.6\" y1=\"62.0\" y2=\"317.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><text x=\"36.599999999999994\" y=\"85.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >000 </text><line x1=\"38.599999999999994\" x2=\"45.599999999999994\" y1=\"85.0\" y2=\"85.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"45.599999999999994\" y=\"73.0\" width=\"4.225352112676056\" height=\"24\" id=\"bar_0_1703865955884384993\" fill=\"#5e7ce0\" /><text x=\"59.82535211267605\" y=\"85.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_0_1703865955884412293\" fill-opacity=\"0\" >13 </text><text x=\"36.599999999999994\" y=\"115.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >001 </text><line x1=\"38.599999999999994\" x2=\"45.599999999999994\" y1=\"115.0\" y2=\"115.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"45.599999999999994\" y=\"103.0\" width=\"2.275189599133261\" height=\"24\" id=\"bar_1_1703865955884432293\" fill=\"#16acff\" /><text x=\"57.87518959913326\" y=\"115.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_1_1703865955884449393\" fill-opacity=\"0\" >7 </text><text x=\"36.599999999999994\" y=\"145.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >010 </text><line x1=\"38.599999999999994\" x2=\"45.599999999999994\" y1=\"145.0\" y2=\"145.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"45.599999999999994\" y=\"133.0\" width=\"300.0\" height=\"24\" id=\"bar_2_1703865955884463893\" fill=\"#5e7ce0\" /><text x=\"355.6\" y=\"145.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_2_1703865955884477493\" fill-opacity=\"0\" >923 </text><text x=\"36.599999999999994\" y=\"175.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >011 </text><line x1=\"38.599999999999994\" x2=\"45.599999999999994\" y1=\"175.0\" y2=\"175.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"45.599999999999994\" y=\"163.0\" width=\"2.275189599133261\" height=\"24\" id=\"bar_3_1703865955884490393\" fill=\"#16acff\" /><text x=\"57.87518959913326\" y=\"175.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_3_1703865955884498593\" fill-opacity=\"0\" >7 </text><text x=\"36.599999999999994\" y=\"205.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >100 </text><line x1=\"38.599999999999994\" x2=\"45.599999999999994\" y1=\"205.0\" y2=\"205.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"45.599999999999994\" y=\"193.0\" width=\"4.550379198266522\" height=\"24\" id=\"bar_4_1703865955884510993\" fill=\"#5e7ce0\" /><text x=\"60.15037919826652\" y=\"205.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_4_1703865955884519193\" fill-opacity=\"0\" >14 </text><text x=\"36.599999999999994\" y=\"235.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >101 </text><line x1=\"38.599999999999994\" x2=\"45.599999999999994\" y1=\"235.0\" y2=\"235.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"45.599999999999994\" y=\"223.0\" width=\"4.225352112676056\" height=\"24\" id=\"bar_5_1703865955884531693\" fill=\"#16acff\" /><text x=\"59.82535211267605\" y=\"235.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_5_1703865955884552393\" fill-opacity=\"0\" >13 </text><text x=\"36.599999999999994\" y=\"265.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >110 </text><line x1=\"38.599999999999994\" x2=\"45.599999999999994\" y1=\"265.0\" y2=\"265.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"45.599999999999994\" y=\"253.0\" width=\"3.2502708559046587\" height=\"24\" id=\"bar_6_1703865955884564593\" fill=\"#5e7ce0\" /><text x=\"58.850270855904654\" y=\"265.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_6_1703865955884572793\" fill-opacity=\"0\" >10 </text><text x=\"36.599999999999994\" y=\"295.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >111 </text><line x1=\"38.599999999999994\" x2=\"45.599999999999994\" y1=\"295.0\" y2=\"295.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"45.599999999999994\" y=\"283.0\" width=\"4.225352112676056\" height=\"24\" id=\"bar_7_1703865955884583993\" fill=\"#16acff\" /><text x=\"59.82535211267605\" y=\"295.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_7_1703865955884591593\" fill-opacity=\"0\" >13 </text><animate xlink:href=\"#bar_0_1703865955884384993\" attributeName=\"width\" from=\"0\" to=\"4.225352112676056\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 4.225352112676056\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_1_1703865955884432293\" attributeName=\"width\" from=\"0\" to=\"2.275189599133261\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 2.275189599133261\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_2_1703865955884463893\" attributeName=\"width\" from=\"0\" to=\"300.0\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 300.0\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_3_1703865955884490393\" attributeName=\"width\" from=\"0\" to=\"2.275189599133261\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 2.275189599133261\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_4_1703865955884510993\" attributeName=\"width\" from=\"0\" to=\"4.550379198266522\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 4.550379198266522\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_5_1703865955884531693\" attributeName=\"width\" from=\"0\" to=\"4.225352112676056\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 4.225352112676056\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_6_1703865955884564593\" attributeName=\"width\" from=\"0\" to=\"3.2502708559046587\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 3.2502708559046587\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_7_1703865955884583993\" attributeName=\"width\" from=\"0\" to=\"4.225352112676056\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 4.225352112676056\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_2_1703865955884463893\" attributeName=\"fill\" from=\"#5e7ce0\" to=\"#fac209\" dur=\"0.15s\" calcMode=\"spline\" values=\"#5e7ce0; #fac209\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_0_1703865955884412293\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_1_1703865955884449393\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_2_1703865955884477493\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_3_1703865955884498593\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_4_1703865955884519193\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_5_1703865955884552393\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_6_1703865955884572793\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_7_1703865955884591593\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><text x=\"210.3\" y=\"41.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"middle\" >probability </text></svg>"
      ],
      "text/plain": [
       "<mindquantum.io.display.measure_res_svg_drawer.SVGMeasure at 0x7f8d09e37bb0>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pylint: disable=W0104\n",
    "from mindquantum.core.gates import Measure\n",
    "\n",
    "sim2.reset()                                      # 重置模拟器sim2维护好的量子态,使得初始化的量子态为|000>\n",
    "\n",
    "circuit2 += UN(Measure(), circuit2.n_qubits)      # 对量子线路circuit2中的每一位量子比特添加测量门\n",
    "\n",
    "result = sim2.sampling(circuit2, shots=1000)      # 通过模拟器sim2对量子线路circuit2进行1000次的采样\n",
    "result.svg()                                      # 打印采样结果"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到,1000次采样中有923次的采样结果为`010`(由于具有随机性,每次运行有略微差距),将其转化为10进制数,运行如下代码:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n"
     ]
    }
   ],
   "source": [
    "print(int('010', 2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到,我们成功地搜索出$|2\\rangle$态。\n",
    "\n",
    "### 实例2:$n=5$,$|\\omega\\rangle=|5\\rangle$和$|11\\rangle$(多目标)\n",
    "\n",
    "实例1中实现的是单目标搜索,现在我们尝试实现多目标搜索。首先,$G$算子已经定义好了,我们只需设定量子比特数和需要翻转相位的目标态,然后搭建对应的量子线路即可,运行如下代码:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"6816.8\" height=\"320.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><rect x=\"0\" y=\"0.0\" width=\"6816.8\" height=\"320.0\" fill=\"#ffffff\" /><text x=\"20.0\" y=\"40.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q0: </text><text x=\"20.0\" y=\"100.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q1: </text><text x=\"20.0\" y=\"160.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q2: </text><text x=\"20.0\" y=\"220.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q3: </text><text x=\"20.0\" y=\"280.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q4: </text><line x1=\"48.8\" x2=\"6796.8\" y1=\"40.0\" y2=\"40.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"6796.8\" y1=\"100.0\" y2=\"100.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"6796.8\" y1=\"160.0\" y2=\"160.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"6796.8\" y1=\"220.0\" y2=\"220.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"6796.8\" y1=\"280.0\" y2=\"280.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"72.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><circle cx=\"152.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"152.8\" x2=\"152.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"132.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"152.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"212.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"212.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"212.8\" x2=\"212.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"192.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"212.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"272.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"272.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"272.8\" x2=\"272.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"252.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"272.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"332.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"332.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"332.8\" x2=\"332.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"312.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"332.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"392.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"392.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"392.8\" x2=\"392.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"372.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"392.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"452.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"452.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"452.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"452.8\" x2=\"452.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"432.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"452.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"512.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"512.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"512.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"512.8\" x2=\"512.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"492.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"512.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"572.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"572.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"572.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"572.8\" x2=\"572.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"552.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"572.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"612.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"632.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"612.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"632.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"612.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"632.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"612.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"632.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"612.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"632.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"672.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"692.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"672.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"692.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"752.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"752.8\" x2=\"752.8\" y1=\"40.0\" y2=\"100.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"732.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"752.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"672.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"692.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"812.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"812.8\" x2=\"812.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"792.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"812.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"872.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"872.8\" x2=\"872.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"852.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"872.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"932.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"932.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"932.8\" x2=\"932.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"912.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"932.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"672.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"692.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"992.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"992.8\" x2=\"992.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"972.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"992.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1052.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1052.8\" x2=\"1052.8\" y1=\"100.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1032.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1052.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1112.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1112.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1112.8\" x2=\"1112.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1092.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1112.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1172.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1172.8\" x2=\"1172.8\" y1=\"160.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1152.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1172.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1232.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1232.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1232.8\" x2=\"1232.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1212.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1232.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1292.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1292.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1292.8\" x2=\"1292.8\" y1=\"100.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1272.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1292.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1352.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1352.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1352.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1352.8\" x2=\"1352.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1332.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1352.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"672.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"692.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1412.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1412.8\" x2=\"1412.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1392.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1412.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1472.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1472.8\" x2=\"1472.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1452.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1472.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1532.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1532.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1532.8\" x2=\"1532.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1512.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1532.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1592.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1592.8\" x2=\"1592.8\" y1=\"160.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1572.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1592.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1652.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1652.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1652.8\" x2=\"1652.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1632.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1652.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1712.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1712.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1712.8\" x2=\"1712.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1692.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1712.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1772.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1772.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1772.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1772.8\" x2=\"1772.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1752.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1772.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1832.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1832.8\" x2=\"1832.8\" y1=\"220.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1812.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1832.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1892.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1892.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1892.8\" x2=\"1892.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1872.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1892.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"1952.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"1952.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"1952.8\" x2=\"1952.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1932.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1952.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2012.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2012.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2012.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2012.8\" x2=\"2012.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"1992.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2012.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2072.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2072.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2072.8\" x2=\"2072.8\" y1=\"160.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2052.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2072.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2132.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2132.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2132.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2132.8\" x2=\"2132.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2112.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2132.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2192.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2192.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2192.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2192.8\" x2=\"2192.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2172.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2192.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2252.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2252.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2252.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2252.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2252.8\" x2=\"2252.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2232.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2252.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"2292.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2312.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"2292.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2312.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"2292.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2312.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"2292.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2312.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"2292.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2312.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><circle cx=\"2372.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2372.8\" x2=\"2372.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2352.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2372.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2432.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2432.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2432.8\" x2=\"2432.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2412.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2432.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2492.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2492.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2492.8\" x2=\"2492.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2472.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2492.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2552.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2552.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2552.8\" x2=\"2552.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2532.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2552.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2612.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2612.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2612.8\" x2=\"2612.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2592.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2612.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2672.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2672.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2672.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2672.8\" x2=\"2672.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2652.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2672.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2732.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2732.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2732.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2732.8\" x2=\"2732.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2712.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2732.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2792.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2792.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"2792.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2792.8\" x2=\"2792.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2772.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2792.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"2832.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2852.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"2832.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2852.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"2832.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2852.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"2832.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2852.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"2832.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2852.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"2892.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2912.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"2892.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2912.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"2972.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"2972.8\" x2=\"2972.8\" y1=\"40.0\" y2=\"100.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"2952.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2972.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"2892.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2912.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3032.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3032.8\" x2=\"3032.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3012.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3032.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3092.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3092.8\" x2=\"3092.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3072.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3092.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3152.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3152.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3152.8\" x2=\"3152.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3132.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3152.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"2892.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2912.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3212.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3212.8\" x2=\"3212.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3192.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3212.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3272.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3272.8\" x2=\"3272.8\" y1=\"100.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3252.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3272.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3332.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3332.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3332.8\" x2=\"3332.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3312.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3332.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3392.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3392.8\" x2=\"3392.8\" y1=\"160.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3372.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3392.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3452.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3452.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3452.8\" x2=\"3452.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3432.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3452.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3512.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3512.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3512.8\" x2=\"3512.8\" y1=\"100.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3492.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3512.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3572.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3572.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3572.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3572.8\" x2=\"3572.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3552.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3572.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"2892.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"2912.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3632.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3632.8\" x2=\"3632.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3612.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3632.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3692.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3692.8\" x2=\"3692.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3672.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3692.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3752.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3752.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3752.8\" x2=\"3752.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3732.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3752.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3812.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3812.8\" x2=\"3812.8\" y1=\"160.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3792.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3812.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3872.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3872.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3872.8\" x2=\"3872.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3852.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3872.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3932.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3932.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3932.8\" x2=\"3932.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3912.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3932.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"3992.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3992.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"3992.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"3992.8\" x2=\"3992.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"3972.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"3992.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4052.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4052.8\" x2=\"4052.8\" y1=\"220.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4032.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4052.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4112.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4112.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4112.8\" x2=\"4112.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4092.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4112.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4172.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4172.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4172.8\" x2=\"4172.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4152.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4172.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4232.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4232.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4232.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4232.8\" x2=\"4232.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4212.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4232.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4292.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4292.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4292.8\" x2=\"4292.8\" y1=\"160.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4272.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4292.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4352.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4352.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4352.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4352.8\" x2=\"4352.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4332.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4352.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4412.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4412.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4412.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4412.8\" x2=\"4412.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4392.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4412.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4472.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4472.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4472.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4472.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4472.8\" x2=\"4472.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4452.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4472.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"4512.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4532.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"4512.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4532.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"4512.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4532.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"4512.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4532.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"4512.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4532.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><circle cx=\"4592.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4592.8\" x2=\"4592.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4572.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4592.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4652.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4652.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4652.8\" x2=\"4652.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4632.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4652.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4712.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4712.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4712.8\" x2=\"4712.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4692.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4712.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4772.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4772.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4772.8\" x2=\"4772.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4752.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4772.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4832.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4832.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4832.8\" x2=\"4832.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4812.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4832.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4892.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4892.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4892.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4892.8\" x2=\"4892.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4872.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4892.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"4952.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4952.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"4952.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"4952.8\" x2=\"4952.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4932.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"4952.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5012.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"5012.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"5012.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5012.8\" x2=\"5012.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"4992.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5012.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"5052.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5072.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"5052.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5072.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"5052.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5072.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"5052.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5072.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"5052.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5072.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"5112.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5132.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"5112.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5132.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5192.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5192.8\" x2=\"5192.8\" y1=\"40.0\" y2=\"100.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5172.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5192.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"5112.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5132.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5252.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5252.8\" x2=\"5252.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5232.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5252.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5312.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5312.8\" x2=\"5312.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5292.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5312.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5372.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"5372.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5372.8\" x2=\"5372.8\" y1=\"40.0\" y2=\"160.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5352.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5372.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"5112.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5132.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5432.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5432.8\" x2=\"5432.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5412.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5432.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5492.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5492.8\" x2=\"5492.8\" y1=\"100.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5472.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5492.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5552.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"5552.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5552.8\" x2=\"5552.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5532.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5552.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5612.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5612.8\" x2=\"5612.8\" y1=\"160.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5592.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5612.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5672.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"5672.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5672.8\" x2=\"5672.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5652.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5672.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5732.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"5732.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5732.8\" x2=\"5732.8\" y1=\"100.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5712.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5732.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5792.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"5792.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"5792.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5792.8\" x2=\"5792.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5772.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5792.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"5112.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5132.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5852.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5852.8\" x2=\"5852.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5832.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5852.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5912.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5912.8\" x2=\"5912.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5892.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5912.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"5972.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"5972.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"5972.8\" x2=\"5972.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"5952.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"5972.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6032.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6032.8\" x2=\"6032.8\" y1=\"160.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6012.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6032.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6092.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6092.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6092.8\" x2=\"6092.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6072.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6092.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6152.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6152.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6152.8\" x2=\"6152.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6132.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6152.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6212.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6212.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6212.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6212.8\" x2=\"6212.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6192.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6212.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6272.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6272.8\" x2=\"6272.8\" y1=\"220.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6252.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6272.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6332.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6332.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6332.8\" x2=\"6332.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6312.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6332.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6392.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6392.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6392.8\" x2=\"6392.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6372.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6392.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6452.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6452.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6452.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6452.8\" x2=\"6452.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6432.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6452.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6512.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6512.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6512.8\" x2=\"6512.8\" y1=\"160.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6492.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6512.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6572.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6572.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6572.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6572.8\" x2=\"6572.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6552.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6572.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6632.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6632.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6632.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6632.8\" x2=\"6632.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6612.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6632.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><circle cx=\"6692.8\" cy=\"40.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6692.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6692.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" /><circle cx=\"6692.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" /><line x1=\"6692.8\" x2=\"6692.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" /><rect x=\"6672.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6692.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"6732.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6752.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"6732.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6752.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"6732.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6752.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"6732.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6752.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"6732.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"6752.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text></svg>"
      ],
      "text/plain": [
       "<mindquantum.io.display.circuit_svg_drawer.SVGCircuit at 0x7f8d09e4df10>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pylint: disable=W0104\n",
    "n_qubits = 5                                      # 设定量子比特数为5\n",
    "phase_inversion_qubit = [5, 11]                   # 设定需要翻转相位的目标态,在这里翻转|5>态和|11>态的相位\n",
    "\n",
    "N = 2 ** (n_qubits)                               # 计算出数据库中元素的总个数\n",
    "M = len(phase_inversion_qubit)                    # 计算出目标态的总个数\n",
    "\n",
    "r = int(pi / 4 * sqrt(N / M))                     # 设定G算子迭代次数为r\n",
    "\n",
    "sim3 = Simulator('mqvector', n_qubits)            # 使用mqvector模拟器,命名为sim3\n",
    "\n",
    "circuit3 = Circuit()                              # 初始化量子线路,命名为circuit3\n",
    "circuit3 += UN(H, n_qubits)                       # 每位量子比特上执行H门操作\n",
    "\n",
    "for i in range(r):                                # 循环执行G算子r次\n",
    "    circuit3 += G(phase_inversion_qubit, n_qubits)\n",
    "\n",
    "sim3.apply_circuit(circuit3)                      # 通过模拟器sim3运行搭建好的量子线路circuit3\n",
    "\n",
    "circuit3.svg()                                          # 打印此时的量子线路circuit3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.035907766232129455¦00000⟩\n",
      "-0.035907766232129365¦00001⟩\n",
      "-0.03590776623212947¦00010⟩\n",
      "-0.035907766232129254¦00011⟩\n",
      "-0.03590776623212947¦00100⟩\n",
      "0.6932961018664989¦00101⟩\n",
      "-0.035907766232129455¦00110⟩\n",
      "-0.035907766232129365¦00111⟩\n",
      "-0.035907766232129455¦01000⟩\n",
      "-0.035907766232129365¦01001⟩\n",
      "-0.03590776623212947¦01010⟩\n",
      "0.6932961018664989¦01011⟩\n",
      "-0.03590776623212947¦01100⟩\n",
      "-0.035907766232129254¦01101⟩\n",
      "-0.035907766232129455¦01110⟩\n",
      "-0.035907766232129365¦01111⟩\n",
      "-0.0359077662321294¦10000⟩\n",
      "-0.03590776623212939¦10001⟩\n",
      "-0.03590776623212936¦10010⟩\n",
      "-0.03590776623212949¦10011⟩\n",
      "-0.03590776623212936¦10100⟩\n",
      "-0.03590776623212949¦10101⟩\n",
      "-0.0359077662321294¦10110⟩\n",
      "-0.03590776623212939¦10111⟩\n",
      "-0.0359077662321294¦11000⟩\n",
      "-0.03590776623212939¦11001⟩\n",
      "-0.03590776623212936¦11010⟩\n",
      "-0.03590776623212949¦11011⟩\n",
      "-0.03590776623212936¦11100⟩\n",
      "-0.03590776623212949¦11101⟩\n",
      "-0.0359077662321294¦11110⟩\n",
      "-0.03590776623212939¦11111⟩\n"
     ]
    }
   ],
   "source": [
    "print(sim3.get_qs(True))                          # 打印模拟器sim3中运行量子线路circuit3后的末态"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到,$|00101\\rangle$​​和$|01011\\rangle$​​态的振幅均为0.6932961018664989,相比于其他的量子态,这是极大的振幅,也就是说,若我们测量此时的状态,将会以极大的概率得到目标态$|00101\\rangle$​​和$|01011\\rangle$​​态,运行如下代码进行测量:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"430.0\" height=\"777.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><rect x=\"0\" y=\"0\" width=\"430.0\" height=\"777.0\" fill=\"#ffffff\" /><text x=\"10\" y=\"17.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" >Shots:\n",
       " 1000 </text><text x=\"10\" y=\"31.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" >Keys: q4 q3 q2 q1 q0 </text><line x1=\"60.0\" x2=\"420.0\" y1=\"62.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"60.0\" x2=\"60.0\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"62.0\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.0 </text><line x1=\"60.0\" x2=\"60.0\" y1=\"62.0\" y2=\"767.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"120.0\" x2=\"120.0\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"122.0\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.097 </text><line x1=\"120.0\" x2=\"120.0\" y1=\"62.0\" y2=\"767.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"180.0\" x2=\"180.0\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"182.0\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.195 </text><line x1=\"180.0\" x2=\"180.0\" y1=\"62.0\" y2=\"767.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"240.0\" x2=\"240.0\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"242.0\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.292 </text><line x1=\"240.0\" x2=\"240.0\" y1=\"62.0\" y2=\"767.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"300.0\" x2=\"300.0\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"302.0\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.39 </text><line x1=\"300.0\" x2=\"300.0\" y1=\"62.0\" y2=\"767.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"360.0\" x2=\"360.0\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"362.0\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.487 </text><line x1=\"360.0\" x2=\"360.0\" y1=\"62.0\" y2=\"767.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><text x=\"51.0\" y=\"85.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >00000 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"85.0\" y2=\"85.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"73.0\" width=\"1.2320328542094459\" height=\"24\" id=\"bar_0_1703866003671121380\" fill=\"#5e7ce0\" /><text x=\"71.23203285420945\" y=\"85.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_0_1703866003671151680\" fill-opacity=\"0\" >2 </text><text x=\"51.0\" y=\"115.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >00010 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"115.0\" y2=\"115.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"103.0\" width=\"1.2320328542094459\" height=\"24\" id=\"bar_1_1703866003671177480\" fill=\"#16acff\" /><text x=\"71.23203285420945\" y=\"115.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_1_1703866003671194680\" fill-opacity=\"0\" >2 </text><text x=\"51.0\" y=\"145.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >00011 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"145.0\" y2=\"145.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"133.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_2_1703866003671216580\" fill=\"#5e7ce0\" /><text x=\"70.61601642710473\" y=\"145.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_2_1703866003671229380\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"175.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >00101 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"175.0\" y2=\"175.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"163.0\" width=\"300.00000000000006\" height=\"24\" id=\"bar_3_1703866003671248580\" fill=\"#16acff\" /><text x=\"370.00000000000006\" y=\"175.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_3_1703866003671271480\" fill-opacity=\"0\" >487 </text><text x=\"51.0\" y=\"205.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >00110 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"205.0\" y2=\"205.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"193.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_4_1703866003671291580\" fill=\"#5e7ce0\" /><text x=\"70.61601642710473\" y=\"205.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_4_1703866003671305580\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"235.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >01010 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"235.0\" y2=\"235.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"223.0\" width=\"1.8480492813141687\" height=\"24\" id=\"bar_5_1703866003671326380\" fill=\"#16acff\" /><text x=\"71.84804928131416\" y=\"235.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_5_1703866003671339380\" fill-opacity=\"0\" >3 </text><text x=\"51.0\" y=\"265.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >01011 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"265.0\" y2=\"265.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"253.0\" width=\"294.4558521560576\" height=\"24\" id=\"bar_6_1703866003671361080\" fill=\"#5e7ce0\" /><text x=\"364.4558521560576\" y=\"265.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_6_1703866003671374280\" fill-opacity=\"0\" >478 </text><text x=\"51.0\" y=\"295.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >01101 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"295.0\" y2=\"295.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"283.0\" width=\"1.8480492813141687\" height=\"24\" id=\"bar_7_1703866003671420480\" fill=\"#16acff\" /><text x=\"71.84804928131416\" y=\"295.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_7_1703866003671524780\" fill-opacity=\"0\" >3 </text><text x=\"51.0\" y=\"325.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >01110 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"325.0\" y2=\"325.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"313.0\" width=\"1.2320328542094459\" height=\"24\" id=\"bar_8_1703866003671550080\" fill=\"#5e7ce0\" /><text x=\"71.23203285420945\" y=\"325.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_8_1703866003671564180\" fill-opacity=\"0\" >2 </text><text x=\"51.0\" y=\"355.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >01111 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"355.0\" y2=\"355.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"343.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_9_1703866003671585880\" fill=\"#16acff\" /><text x=\"70.61601642710473\" y=\"355.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_9_1703866003671598680\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"385.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >10000 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"385.0\" y2=\"385.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"373.0\" width=\"1.2320328542094459\" height=\"24\" id=\"bar_10_1703866003671620180\" fill=\"#5e7ce0\" /><text x=\"71.23203285420945\" y=\"385.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_10_1703866003671633080\" fill-opacity=\"0\" >2 </text><text x=\"51.0\" y=\"415.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >10001 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"415.0\" y2=\"415.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"403.0\" width=\"1.2320328542094459\" height=\"24\" id=\"bar_11_1703866003671653480\" fill=\"#16acff\" /><text x=\"71.23203285420945\" y=\"415.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_11_1703866003671666580\" fill-opacity=\"0\" >2 </text><text x=\"51.0\" y=\"445.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >10010 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"445.0\" y2=\"445.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"433.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_12_1703866003671685280\" fill=\"#5e7ce0\" /><text x=\"70.61601642710473\" y=\"445.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_12_1703866003671697880\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"475.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >10011 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"475.0\" y2=\"475.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"463.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_13_1703866003671716980\" fill=\"#16acff\" /><text x=\"70.61601642710473\" y=\"475.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_13_1703866003671729480\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"505.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >10100 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"505.0\" y2=\"505.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"493.0\" width=\"1.8480492813141687\" height=\"24\" id=\"bar_14_1703866003671750480\" fill=\"#5e7ce0\" /><text x=\"71.84804928131416\" y=\"505.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_14_1703866003671768780\" fill-opacity=\"0\" >3 </text><text x=\"51.0\" y=\"535.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >10101 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"535.0\" y2=\"535.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"523.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_15_1703866003671802580\" fill=\"#16acff\" /><text x=\"70.61601642710473\" y=\"535.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_15_1703866003671817780\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"565.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >10110 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"565.0\" y2=\"565.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"553.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_16_1703866003671837080\" fill=\"#5e7ce0\" /><text x=\"70.61601642710473\" y=\"565.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_16_1703866003671852080\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"595.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >10111 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"595.0\" y2=\"595.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"583.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_17_1703866003671872180\" fill=\"#16acff\" /><text x=\"70.61601642710473\" y=\"595.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_17_1703866003671885780\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"625.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >11001 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"625.0\" y2=\"625.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"613.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_18_1703866003671907680\" fill=\"#5e7ce0\" /><text x=\"70.61601642710473\" y=\"625.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_18_1703866003671921180\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"655.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >11100 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"655.0\" y2=\"655.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"643.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_19_1703866003671942680\" fill=\"#16acff\" /><text x=\"70.61601642710473\" y=\"655.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_19_1703866003671968480\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"685.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >11101 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"685.0\" y2=\"685.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"673.0\" width=\"0.6160164271047229\" height=\"24\" id=\"bar_20_1703866003671992180\" fill=\"#5e7ce0\" /><text x=\"70.61601642710473\" y=\"685.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_20_1703866003672006680\" fill-opacity=\"0\" >1 </text><text x=\"51.0\" y=\"715.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >11110 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"715.0\" y2=\"715.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"703.0\" width=\"1.2320328542094459\" height=\"24\" id=\"bar_21_1703866003672042680\" fill=\"#16acff\" /><text x=\"71.23203285420945\" y=\"715.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_21_1703866003672059280\" fill-opacity=\"0\" >2 </text><text x=\"51.0\" y=\"745.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >11111 </text><line x1=\"53.0\" x2=\"60.0\" y1=\"745.0\" y2=\"745.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"60.0\" y=\"733.0\" width=\"1.8480492813141687\" height=\"24\" id=\"bar_22_1703866003672088480\" fill=\"#5e7ce0\" /><text x=\"71.84804928131416\" y=\"745.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_22_1703866003672110780\" fill-opacity=\"0\" >3 </text><animate xlink:href=\"#bar_0_1703866003671121380\" attributeName=\"width\" from=\"0\" to=\"1.2320328542094459\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.2320328542094459\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_1_1703866003671177480\" attributeName=\"width\" from=\"0\" to=\"1.2320328542094459\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.2320328542094459\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_2_1703866003671216580\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_3_1703866003671248580\" attributeName=\"width\" from=\"0\" to=\"300.00000000000006\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 300.00000000000006\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_4_1703866003671291580\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_5_1703866003671326380\" attributeName=\"width\" from=\"0\" to=\"1.8480492813141687\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.8480492813141687\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_6_1703866003671361080\" attributeName=\"width\" from=\"0\" to=\"294.4558521560576\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 294.4558521560576\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_7_1703866003671420480\" attributeName=\"width\" from=\"0\" to=\"1.8480492813141687\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.8480492813141687\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_8_1703866003671550080\" attributeName=\"width\" from=\"0\" to=\"1.2320328542094459\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.2320328542094459\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_9_1703866003671585880\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_10_1703866003671620180\" attributeName=\"width\" from=\"0\" to=\"1.2320328542094459\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.2320328542094459\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_11_1703866003671653480\" attributeName=\"width\" from=\"0\" to=\"1.2320328542094459\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.2320328542094459\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_12_1703866003671685280\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_13_1703866003671716980\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_14_1703866003671750480\" attributeName=\"width\" from=\"0\" to=\"1.8480492813141687\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.8480492813141687\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_15_1703866003671802580\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_16_1703866003671837080\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_17_1703866003671872180\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_18_1703866003671907680\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_19_1703866003671942680\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_20_1703866003671992180\" attributeName=\"width\" from=\"0\" to=\"0.6160164271047229\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 0.6160164271047229\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_21_1703866003672042680\" attributeName=\"width\" from=\"0\" to=\"1.2320328542094459\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.2320328542094459\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_22_1703866003672088480\" attributeName=\"width\" from=\"0\" to=\"1.8480492813141687\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 1.8480492813141687\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_3_1703866003671248580\" attributeName=\"fill\" from=\"#16acff\" to=\"#fac209\" dur=\"0.15s\" calcMode=\"spline\" values=\"#16acff; #fac209\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_0_1703866003671151680\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_1_1703866003671194680\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_2_1703866003671229380\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_3_1703866003671271480\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_4_1703866003671305580\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_5_1703866003671339380\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_6_1703866003671374280\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_7_1703866003671524780\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_8_1703866003671564180\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_9_1703866003671598680\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_10_1703866003671633080\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_11_1703866003671666580\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_12_1703866003671697880\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_13_1703866003671729480\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_14_1703866003671768780\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_15_1703866003671817780\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_16_1703866003671852080\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_17_1703866003671885780\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_18_1703866003671921180\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_19_1703866003671968480\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_20_1703866003672006680\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_21_1703866003672059280\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_22_1703866003672110780\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><text x=\"217.5\" y=\"41.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"middle\" >probability </text></svg>"
      ],
      "text/plain": [
       "<mindquantum.io.display.measure_res_svg_drawer.SVGMeasure at 0x7f8d09da75e0>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pylint: disable=W0104\n",
    "sim3.reset()                                      # 重置模拟器sim3维护好的量子态,使得初始化的量子态为|00000>\n",
    "\n",
    "circuit3 += UN(Measure(), circuit3.n_qubits)      # 对量子线路circuit3中的每一位量子比特添加测量门\n",
    "\n",
    "result1 = sim3.sampling(circuit3, shots=1000)     # 通过模拟器sim3对量子线路circuit3进行1000次的采样\n",
    "result1.svg()                                     # 打印采样结果"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到,1000次采样中有487次的采样结果为`00101`和478次的采样结果为`01011`(由于具有随机性,每次运行会略有不同),将其转化为10进制数,运行如下代码:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5\n",
      "11\n"
     ]
    }
   ],
   "source": [
    "print(int('00101', 2))\n",
    "print(int('01011', 2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从运行的结果看到,我们成功地搜索出$|5\\rangle$​​和$|11\\rangle$​​​​​态。\n",
    "\n",
    "至此,我们介绍了Grover搜索算法的基本原理,以及通过两个具体的小例子来展示如何利用MindSpore Quantum实现该算法!赶紧动手体验一下量子编程的乐趣吧!\n",
    "\n",
    "## 龙算法\n",
    "\n",
    "除了在规模为4的数据库中找1个数据的场景,Grover算法不能够精确的搜索出所标记态。清华大学龙桂鲁教授在Grover算法基础之上提出量子精确搜索算法龙算法[3],能够以准确率为1的概率在所有场景中搜索出目标态。其主要思想是将Grover算子改写为如下的算子,\n",
    "\n",
    "$$L = -H^{\\otimes n} R_0 H^{\\otimes n} R_\\tau$$\n",
    "\n",
    "其中:$R_0 = (I+(e^{i\\theta}-1)\\left|0\\right>\\left<0\\right|)$,$R_\\tau = (I+(e^{i\\theta}-1)\\left|\\tau\\right>\\left<\\tau\\right|)$。在满足相位匹配条件时,\n",
    "\n",
    "$$\\theta = 2\\arcsin\\left(\\sin\\beta\\sin\\left(\\frac{\\pi}{4J_s+6}\\right)\\right)$$\n",
    "\n",
    "我们只需作用$J_s+1$次龙算子,就可以以概率1找到目标态,这里$\\beta=\\arcsin{\\sqrt{M/N}}$,$M$为标记态个数,$N$为数据库大小,$J_s>=[((\\pi/2)-\\beta)/\\beta]$。下面我们用MindSpore Quantum来实现。\n",
    "\n",
    "### 一般角度相位转动线路\n",
    "\n",
    "借助于辅助比特,我们搭建某个计算基矢一般角度相位转动线路。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "from mindquantum.core.gates import X, PhaseShift\n",
    "from mindquantum.core.circuit import Circuit\n",
    "def change_phase_with_anclia(which, n_qubits, phase):\n",
    "    c = Circuit()\n",
    "    which_bit = bin(which)[2:].zfill(n_qubits)[::-1]\n",
    "    polarity_circ = Circuit()\n",
    "    for idx, bit in enumerate(which_bit):\n",
    "        if bit == \"0\":\n",
    "            polarity_circ += X.on(idx)\n",
    "    c += polarity_circ\n",
    "    c += PhaseShift(phase).on(n_qubits, list(range(n_qubits)))\n",
    "    c += polarity_circ\n",
    "    return c"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 搭建龙算子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "from mindquantum.core.gates import BARRIER, Z\n",
    "\n",
    "def L(which, n_qubits, theta, phi):\n",
    "    U = UN(H, n_qubits)\n",
    "    R0 = change_phase_with_anclia(0, n_qubits, theta)\n",
    "    R_t = change_phase_with_anclia(which, n_qubits, phi)\n",
    "    g_ops = R_t + BARRIER + U + BARRIER + R0 + BARRIER + U + BARRIER\n",
    "    g_ops += Z.on(n_qubits)\n",
    "    return g_ops"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 完成量子精确搜索算法:龙算法\n",
    "\n",
    "这里我们以3比特数据库中搜索$\\left|2\\right>$态为例,完成龙算法。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1336.8\" height=\"260.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><rect x=\"0\" y=\"0.0\" width=\"1336.8\" height=\"260.0\" fill=\"#ffffff\" /><text x=\"20.0\" y=\"40.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q0: </text><text x=\"20.0\" y=\"100.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q1: </text><text x=\"20.0\" y=\"160.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q2: </text><text x=\"20.0\" y=\"220.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >q3: </text><line x1=\"48.8\" x2=\"1316.8\" y1=\"40.0\" y2=\"40.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"1316.8\" y1=\"100.0\" y2=\"100.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"1316.8\" y1=\"160.0\" y2=\"160.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"48.8\" x2=\"1316.8\" y1=\"220.0\" y2=\"220.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"72.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"72.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"92.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"132.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"152.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"132.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"152.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><circle cx=\"232.8\" cy=\"40.0\" r=\"4\" fill=\"#fac209\" /><circle cx=\"232.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" /><circle cx=\"232.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" /><line x1=\"232.8\" x2=\"232.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#fac209\" stroke-width=\"3\" /><rect x=\"192.8\" y=\"200.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" /><text x=\"232.8\" y=\"216.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >PS </text><text x=\"232.8\" y=\"232.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >2.1269 </text><rect x=\"292.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"312.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"292.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"312.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"352.8\" y=\"20.0\" width=\"0\" height=\"220\" fill=\"gray\" fill-opacity=\"0.8\" /><rect x=\"352.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"372.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"352.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"372.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"352.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"372.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"412.8\" y=\"20.0\" width=\"0\" height=\"220\" fill=\"gray\" fill-opacity=\"0.8\" /><rect x=\"412.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"432.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"412.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"432.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"412.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"432.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><circle cx=\"512.8\" cy=\"40.0\" r=\"4\" fill=\"#fac209\" /><circle cx=\"512.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" /><circle cx=\"512.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" /><line x1=\"512.8\" x2=\"512.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#fac209\" stroke-width=\"3\" /><rect x=\"472.8\" y=\"200.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" /><text x=\"512.8\" y=\"216.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >PS </text><text x=\"512.8\" y=\"232.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >2.1269 </text><rect x=\"572.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"592.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"572.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"592.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"572.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"592.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"632.8\" y=\"20.0\" width=\"0\" height=\"220\" fill=\"gray\" fill-opacity=\"0.8\" /><rect x=\"632.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"652.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"632.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"652.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"632.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"652.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"692.8\" y=\"20.0\" width=\"0\" height=\"220\" fill=\"gray\" fill-opacity=\"0.8\" /><rect x=\"692.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"712.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text><rect x=\"692.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"712.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"692.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"712.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><circle cx=\"792.8\" cy=\"40.0\" r=\"4\" fill=\"#fac209\" /><circle cx=\"792.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" /><circle cx=\"792.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" /><line x1=\"792.8\" x2=\"792.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#fac209\" stroke-width=\"3\" /><rect x=\"752.8\" y=\"200.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" /><text x=\"792.8\" y=\"216.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >PS </text><text x=\"792.8\" y=\"232.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >2.1269 </text><rect x=\"852.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"872.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"852.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"872.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"912.8\" y=\"20.0\" width=\"0\" height=\"220\" fill=\"gray\" fill-opacity=\"0.8\" /><rect x=\"912.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"932.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"912.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"932.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"912.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"932.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"972.8\" y=\"20.0\" width=\"0\" height=\"220\" fill=\"gray\" fill-opacity=\"0.8\" /><rect x=\"972.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"992.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"972.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"992.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"972.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"992.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><circle cx=\"1072.8\" cy=\"40.0\" r=\"4\" fill=\"#fac209\" /><circle cx=\"1072.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" /><circle cx=\"1072.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" /><line x1=\"1072.8\" x2=\"1072.8\" y1=\"40.0\" y2=\"220.0\" stroke=\"#fac209\" stroke-width=\"3\" /><rect x=\"1032.8\" y=\"200.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" /><text x=\"1072.8\" y=\"216.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >PS </text><text x=\"1072.8\" y=\"232.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >2.1269 </text><rect x=\"1132.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1152.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"1132.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1152.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"1132.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1152.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >X </text><rect x=\"1192.8\" y=\"20.0\" width=\"0\" height=\"220\" fill=\"gray\" fill-opacity=\"0.8\" /><rect x=\"1192.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1212.8\" y=\"40.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"1192.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1212.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"1192.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1212.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >H </text><rect x=\"1252.8\" y=\"20.0\" width=\"0\" height=\"220\" fill=\"gray\" fill-opacity=\"0.8\" /><rect x=\"1252.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" /><text x=\"1272.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >Z </text></svg>"
      ],
      "text/plain": [
       "<mindquantum.io.display.circuit_svg_drawer.SVGCircuit at 0x7f8d09e1e850>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "from mindquantum.core.gates import H\n",
    "from mindquantum.core.circuit import UN\n",
    "n_qubits = 3\n",
    "will_find = 2\n",
    "beta = np.arcsin(np.sqrt(1 / 2**n_qubits))\n",
    "Js = int((np.pi / 2 - beta) / 2 / beta)\n",
    "theta = 2 * np.arcsin(np.sin(np.pi / (4 * Js + 6)) / np.sin(beta))\n",
    "phi = theta\n",
    "\n",
    "g = L(will_find, n_qubits, theta, phi)            # 构建用于精确搜索的龙算子\n",
    "\n",
    "circ = UN(H, n_qubits) + X.on(n_qubits)\n",
    "for i in range(Js + 1):\n",
    "    circ += g\n",
    "circ.svg()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "接下来,我们计算线路的量子态。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(0.048708136684586345-0.9988130542902997j)¦1010⟩\n"
     ]
    }
   ],
   "source": [
    "print(circ.get_qs(ket=True))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "发现,除去相位,我们可以精确的得到目标态。通过采样,我们也可以得到如下类似的结果。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"422.8\" height=\"117.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><rect x=\"0\" y=\"0\" width=\"422.8\" height=\"117.0\" fill=\"#ffffff\" /><text x=\"10\" y=\"17.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" >Shots:\n",
       " 100 </text><text x=\"10\" y=\"31.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" >Keys: q3 q2 q1 q0 </text><line x1=\"52.8\" x2=\"412.8\" y1=\"62.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"52.8\" x2=\"52.8\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"54.8\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.0 </text><line x1=\"52.8\" x2=\"52.8\" y1=\"62.0\" y2=\"107.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><line x1=\"112.8\" x2=\"112.8\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"114.8\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.2 </text><line x1=\"112.8\" x2=\"112.8\" y1=\"62.0\" y2=\"107.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"172.8\" x2=\"172.8\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"174.8\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.4 </text><line x1=\"172.8\" x2=\"172.8\" y1=\"62.0\" y2=\"107.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"232.8\" x2=\"232.8\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"234.8\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.6 </text><line x1=\"232.8\" x2=\"232.8\" y1=\"62.0\" y2=\"107.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"292.8\" x2=\"292.8\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"294.8\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >0.8 </text><line x1=\"292.8\" x2=\"292.8\" y1=\"62.0\" y2=\"107.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><line x1=\"352.8\" x2=\"352.8\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><text x=\"354.8\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >1.0 </text><line x1=\"352.8\" x2=\"352.8\" y1=\"62.0\" y2=\"107.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" /><text x=\"43.8\" y=\"85.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >1010 </text><line x1=\"45.8\" x2=\"52.8\" y1=\"85.0\" y2=\"85.0\" stroke=\"#adb0b8\" stroke-width=\"1\" /><rect x=\"52.8\" y=\"73.0\" width=\"300.0\" height=\"24\" id=\"bar_0_1703866060200474819\" fill=\"#5e7ce0\" /><text x=\"362.8\" y=\"85.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_0_1703866060200500419\" fill-opacity=\"0\" >100 </text><animate xlink:href=\"#bar_0_1703866060200474819\" attributeName=\"width\" from=\"0\" to=\"300.0\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 300.0\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" /><animate xlink:href=\"#bar_0_1703866060200474819\" attributeName=\"fill\" from=\"#5e7ce0\" to=\"#fac209\" dur=\"0.15s\" calcMode=\"spline\" values=\"#5e7ce0; #fac209\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><animate xlink:href=\"#bar_text_0_1703866060200500419\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" /><text x=\"213.9\" y=\"41.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"middle\" >probability </text></svg>"
      ],
      "text/plain": [
       "<mindquantum.io.display.measure_res_svg_drawer.SVGMeasure at 0x7f8d901a9130>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from mindquantum.simulator import Simulator\n",
    "from mindquantum.core.gates import Measure\n",
    "\n",
    "sim = Simulator('mqvector', circ.n_qubits)\n",
    "res = sim.sampling(circ + UN(Measure(), circ.n_qubits), shots=100)\n",
    "res.svg()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<table border=\"1\">\n",
       "  <tr>\n",
       "    <th>Software</th>\n",
       "    <th>Version</th>\n",
       "  </tr>\n",
       "<tr><td>mindquantum</td><td>0.9.11</td></tr>\n",
       "<tr><td>scipy</td><td>1.10.1</td></tr>\n",
       "<tr><td>numpy</td><td>1.23.5</td></tr>\n",
       "<tr>\n",
       "    <th>System</th>\n",
       "    <th>Info</th>\n",
       "</tr>\n",
       "<tr><td>Python</td><td>3.9.16</td></tr><tr><td>OS</td><td>Linux x86_64</td></tr><tr><td>Memory</td><td>8.3 GB</td></tr><tr><td>CPU Max Thread</td><td>8</td></tr><tr><td>Date</td><td>Sat Dec 30 00:07:45 2023</td></tr>\n",
       "</table>\n"
      ],
      "text/plain": [
       "<mindquantum.utils.show_info.InfoTable at 0x7f8d09d8d220>"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from mindquantum.utils.show_info import InfoTable\n",
    "\n",
    "InfoTable('mindquantum', 'scipy', 'numpy')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### **参考文献:**\n",
    "\n",
    "\\[1\\] L. K. Grover, A fast quantum mechanical algorithm for database search\\[C\\]// Proceedings of the twenty-eighth annual ACM symposium on Theory of computing. ACM, 1996: 212-219.\n",
    "\n",
    "\\[2\\] G. Brassard, P. Hoyer, M. Mosca, et al. Quantum amplitude amplification and estimation\\[J\\]. Contemporary Mathematics, 2002, 305: 53-74.\n",
    "\n",
    "\\[3\\] Long G L. Grover algorithm with zero theoretical failure rate. Physical Rev A, 2001, 64: 022307."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}