From 7632de59a70659a08336178b90aacd0c963d79d4 Mon Sep 17 00:00:00 2001 From: huehou Date: Thu, 16 Jan 2025 15:35:20 +0800 Subject: [PATCH] Expanded angle encoding, draft for reshape function (in comments) --- book.bib | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- data.Rmd | 54 +++++++++++++++++++++++++++++++++++++++++++++---- index.Rmd | 2 ++ 3 files changed, 111 insertions(+), 5 deletions(-) diff --git a/book.bib b/book.bib index 9962c5f..425ac3b 100644 --- a/book.bib +++ b/book.bib @@ -6510,4 +6510,62 @@ @article{Beals_2013 publisher={The Royal Society}, author={Beals, Robert and Brierley, Stephen and Gray, Oliver and Harrow, Aram W. and Kutin, Samuel and Linden, Noah and Shepherd, Dan and Stather, Mark}, year={2013}, - month=may, pages={20120686} } \ No newline at end of file + month=may, pages={20120686} } + +@article{shin2023exponential, + title = {Exponential data encoding for quantum supervised learning}, + author = {Shin, S. and Teo, Y. S. and Jeong, H.}, + journal = {Phys. Rev. A}, + volume = {107}, + issue = {1}, + pages = {012422}, + numpages = {20}, + year = {2023}, + month = {Jan}, + publisher = {American Physical Society}, + doi = {10.1103/PhysRevA.107.012422}, + url = {https://link.aps.org/doi/10.1103/PhysRevA.107.012422} +} + +@article{larose2020robust, + title={Robust data encodings for quantum classifiers}, + author={LaRose, Ryan and Coyle, Brian}, + journal={Physical Review A}, + volume={102}, + number={3}, + pages={032420}, + year={2020}, + publisher={APS} +} + +@article{perez2020data, + title={Data re-uploading for a universal quantum classifier}, + author={P{\'e}rez-Salinas, Adri{\'a}n and Cervera-Lierta, Alba and Gil-Fuster, Elies and Latorre, Jos{\'e} I}, + journal={Quantum}, + volume={4}, + pages={226}, + year={2020}, + publisher={Verein zur F{\"o}rderung des Open Access Publizierens in den Quantenwissenschaften} +} + +@article{grant2018hierarchical, + title={Hierarchical quantum classifiers}, + author={Grant, Edward and Benedetti, Marcello and Cao, Shuxiang and Hallam, Andrew and Lockhart, Joshua and Stojevic, Vid and Green, Andrew G and Severini, Simone}, + journal={npj Quantum Information}, + volume={4}, + number={1}, + pages={65}, + year={2018}, + publisher={Nature Publishing Group UK London} +} + +@article{cao2020cost, + title={Cost-function embedding and dataset encoding for machine learning with parametrized quantum circuits}, + author={Cao, Shuxiang and Wossnig, Leonard and Vlastakis, Brian and Leek, Peter and Grant, Edward}, + journal={Physical Review A}, + volume={101}, + number={5}, + pages={052309}, + year={2020}, + publisher={APS} +} \ No newline at end of file diff --git a/data.Rmd b/data.Rmd index 84e3508..8337d6b 100644 --- a/data.Rmd +++ b/data.Rmd @@ -95,9 +95,35 @@ Check that Equation \@ref(eq:matrix-state1) is equivalent to +From an algorithms perspective, amplitude encoding is useful because it requires a logarithmic number of qubits with respect to the vector size, which might seem to lead to an exponential saving in physical resources when compared to classical encoding techniques. However, a major drawback of amplitude encoding is that, in the worst case, for the majority of states, it requires a circuit of size $\Omega(N)$. + -From an algorithms perspective, amplitude encoding is useful because it requires a logarithmic number of qubits with respect to the vector size, which might seem to lead to an exponential saving in physical resources when compared to classical encoding techniques. A major drawback of amplitude encoding is that, in the worst case, for the majority of states, it requires a circuit of size $\Omega(N)$. + + + + + + + + + + + + + + + + + + + + + + + + + @@ -126,14 +152,34 @@ A & . \\ ### Angle encoding {#sec:angle-encoding} -Another way to encode vectors, as defined by [@schuld2021machine], is with angle encoding. This technique encodes information as angles of the Pauli rotations $\sigma_x(\theta)$, $\sigma_y(\theta)$, $\sigma_z(\theta)$. Given a vector $x \in \mathbb{R}^n$, with all elements in the interval $[0,2\pi]$; the technique seeks to apply $\sigma_{\alpha}^i(x_i)$, where $\alpha \in \{x,y,z \}$ and $i$ refers to the target qubit. The resulting state is said to be an angle encoding of $x$ and has a form given by +Another way to encode vectors, as defined by [@schuld2021machine;@grant2018hierarchical;@cao2020cost], is with angle encoding, also known as qubit encoding [@larose2020robust]. This technique encodes information as angles of the Pauli rotations $R_x(\theta)$, $R_y(\theta)$, $R_z(\theta)$. Given a vector $x \in \mathbb{R}^n$, with all elements in the interval $[0,2\pi)$, the technique seeks to apply $R_{\alpha}^i(x_i)$, where $\alpha \in \{x,y,z \}$ and $i$ refers to the target qubit. The resulting state is said to be an angle encoding of $x$ and has a form given by \begin{equation} - \ket{x} = \prod_{i=1}^{n} \sigma_{\alpha}^{i}(x_i)\ket{0}^{\otimes n} + \ket{x} = \prod_{i=1}^{n} R_{\alpha}^{i}(x_i)\ket{0}^{\otimes n} \,. (\#eq:angle-encoding) \end{equation} -This technique's advantages lies in its efficient resource utilization, which scales linearly for number of qubits. One major drawback is that it is difficult to perform arithmetic operations on the resulting state, making it difficult to apply to quantum algorithms. +A more efficient form of angle encoding, called dense angle encoding [@larose2020robust], encodes odd entries as the rotation angle, and even entries as the phase difference between $\ket{0}$ and $\ket{1}$, i.e., + +\begin{equation} + \ket{x} = \prod_{i=1}^{\lceil n/2 \rceil} R_{z}^{i}(x_{2i}) R_{y}^{i}(x_{2i-1})\ket{0}^{\otimes \lceil n/2 \rceil} \,. +\end{equation} + +This shows that one can encode 2 vector entries in 1 qubit under angle encoding. This leads to the most general form of angle encoding [@larose2020robust;@perez2020data] + +\begin{equation} + \ket{x} = \prod_{i=1}^{\lceil n/2 \rceil} U^i(x_{2i-1}, x_{2i}) \ket{0}^{\otimes \lceil n/2 \rceil} \,, +\end{equation} +where $U^i$ is a general unitary operation, that depends on $x_{2i-1}$ and $x_{2i}$, acting on qubit $i$. + +These techniques are useful because it uses resource efficiently specifically for NISQ architectures, which scales linearly with the number of qubits and the depth. One major drawback is that it is difficult to perform arithmetic operations on the resulting state, and to our knowledge there is no non-variational algorithms using this encoding yet. + +An equivalent encoding scheme is the exponential encoding with the form [@shin2023exponential] + +\begin{equation} + \ket{x} = \prod_{i=0}^{n-1} \prod_{j=0}^{m-1} R_z^{mi+j+1}(\beta_{ij} x_i) \ket{0}^{\otimes mn} \,, +\end{equation} +where we repeat the angle encoding $m$ times for each $x_i$ with different weights $\beta_{ij}$. This might be useful in some applications, for example for quantum supervised learning. diff --git a/index.Rmd b/index.Rmd index ec10dba..a85cc11 100644 --- a/index.Rmd +++ b/index.Rmd @@ -51,6 +51,8 @@ github-repo: "scinawa/quantumalgorithms.org" \newcommand{\poly}{\text{poly}} +\newcommand{\I}{\mathrm{i}} +\newcommand{\Exp}[1]{\mathrm{e}^{#1}}