I was studying the VQLS from the tutorial :https://github.com/qiskit-community/qiskit-textbook/blob/main/content/ch-paper-implementations/vqls.ipynb I am kind of stuck to understand how to convert a non-unitary matrix into quantum circuit as done in the tutorial because it is practically impossible for anyone to think like that as shown below: $$ A=0.45Z_3+0.55{\mathbb I} $$ Also, how would the circuit look like? It would be really great if someone can help me understand this concept because it practically imposssible to implement this without any API or algorithm? Also, what would be complexity of the algorithm because what I think is that it very easy to solve this on classical computer than on quantum computer?
3 Answers
One thing that you can try and do is embed the matrix $A$ inside a larger matrix which is unitary. For example, you're looking for $$ A=\begin{bmatrix} 1 & 0 \\ 0 & 0.1 \end{bmatrix} $$ so why not try $$ U_A=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 0.1 & \sqrt{0.99} \\ 0 & \sqrt{0.99} & -0.1 \end{bmatrix}. $$ You then implement $A$ by applying $U_A$ (on a 3-dimensional system, but prepared in your 2-dimensional subspace), and then applying a measurement with projectors $$ P_{\text{good}}=|0\rangle\langle 0|+|1\rangle\langle 1|,\qquad P_{\text{bad}}=|2\rangle\langle 2|. $$ If you get the good answer, then you have successfully implemented the evolution you wanted. If you get the bad answer, you have failed.
A 3-dimensional subspace is the smallest required to make this work. For an implementation on qiskit, I'm imagining that you want to describe it in terms of qubits, so you probably need to add an extra level, perhaps something like $$ U_A=\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0.1 & i\sqrt{0.99} & 0 \\ 0 & i\sqrt{0.99} & 0.1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}, $$ which I have chosen to write in the form of a partial swap, which therefore has a well understood decomposition in terms of standard gates.
-
$\begingroup$ Thank you for response @DaftWullie. Somehow, the VLQS algorithm employ some different technique than this. Some researcher in this video tried explaining this concept youtube.com/watch?v=zgELTGM0FaU but somehow his explanation is not correct totally. $\endgroup$– ManuCommented Sep 17 at 12:53
@DaftWullie answer is perfectly fine if you need to a quantum circuit for $A$. However, in the context of VQLS this quantum circuit is not required.
In variational quantum algorithms we need to construct a cost function that can be evaluated with a low-depth parameterized quantum circuit.
Recall that, $A$ is a linear combination of unitaries,
$$A = \displaystyle\sum_{n} c_n \ A_n$$
In VQLS, to evaluate the cost function we compute every possible term $\langle 0 | V(k)^{\dagger} A_m^{\dagger} A_n V(k) |0\rangle$ where $V(k)$ is the unitary of the ansatz.
-
$\begingroup$ Thank you for the reponse @Egretta.Thula for the response. Can you explain this with an example? $\endgroup$– ManuCommented Sep 17 at 12:55
-
$\begingroup$ Thank you @Geetha for the response. It would be really helpful if you can explain your algorithm? $\endgroup$– ManuCommented Oct 1 at 3:46