Quantum Computing Asked by rexrayne on August 6, 2021
In Quantum Algorithm Implementations for Beginners is an example of the Quantum PCA with an given 2 x 2 covariance matrix $sum$.
The steps for state preparation are given in the paper. The steps are:
calculate covariance matrix $sum$ from the data
compute density matrix $rho = frac{1}{Tr(sum)}*sum$
I wanna comprehend the example from the paper. So far I got the density matrix $rho$. I would be glad if someone could explain me how to calculate the quantum state $| psi rangle$ and futhermore $U_{prep}$.
In an article Towards Pricing Financial Derivatives with an IBM Quantum Computer PCA is implemented in a practical way with an example.
Operator $U_{prep}$ is realized with $mathrm{U3}$ gates but parameters for some gates presented in the article seems wrong (maybe typo). See this thread for more information, correct $mathrm{U3}$ parameters values and a way how to implement PCA on IBM Q.
EDIT: How to find parameters $theta$, $phi$ and $lambda$ for implementation of $U_{prep}$ with $mathrm{U3}$ gate.
$mathrm{U3}$ gate has this form:
$$ mathrm{U3}= begin{pmatrix} cos(theta/2) & -mathrm{e}^{ilambda}sin(theta/2) mathrm{e}^{iphi}sin(theta/2) & mathrm{e}^{i(phi+lambda)}cos(theta/2) end{pmatrix}. $$
Firstly, you have to factor out some complex number (denote $c$) from $U_{prep}$ in order to have a real number on position $u_{11}$. After that you can easily calculate $theta$ from $cos(theta/2)$. Then, it is not problem to find $phi$ from $mathrm{e}^{iphi}sin(theta/2)$ and finnaly $lambda$ from $mathrm{e}^{i(phi+lambda)}cos(theta/2)$.
The number $c$ factored out in the first step is a global phase. It is not important in case $mathrm{U3}$ is used in its single qubit form. But if the gate is used as controlled one, the global phase cannot be neglected. So, you will have controlled $mathrm{U3}$ and controlled global phase gate.
Correct answer by Martin Vesely on August 6, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP