7

I'm working on solving a linear system with the quantum algorithm HHL. I don't understand how I can recover my vector $|x\rangle$ of real solution of the system starting from the states measured with ancilla qubit in $|1\rangle$. I found something about using tomography but I don't know how to apply it successfully to my circuit with Qiskit.

Can someone help me? Many thanks.

Sanchayan Dutta
  • 17,945
  • 8
  • 50
  • 112

1 Answers1

4

Quick answer: You will not be able to fully recover $x$.

Explanations:

  1. By design, the HHL algorithm stores $x$ in the amplitudes of a quantum state. Because of how quantum mechanics works, the vector representing the quantum state (i.e. containing all the amplitudes of the quantum state) needs to be of unit-norm (according to the Euclidean norm). Because of this, the result stored in the amplitudes of your quantum state is (most of the time) not $\vec{x}$ but rather $\vert x \rangle = \frac{\vec{x}}{\vert\vert\vec{x}\vert\vert}$. Also because quantum states are defined up to a global-phase, the most general expression of the "solution" of the linear system stored in the amplitudes is $$\vert x \rangle = e^{i\phi}\frac{\vec{x}}{\vert\vert\vec{x}\vert\vert}.$$

  2. As said in point 1, the HHL algorithm stores the result of the linear system provided by the user in the amplitudes of a quantum state. The problem is that these amplitudes are not directly measurable. You can measure the value of your qubits and the measured value will depend (probabilistically) on the underlying amplitudes, but you can't measure the amplitudes.

    One way to approximate the amplitudes (up to a global phase) is to use quantum state tomography. Here are some links related to quantum state tomography in Qiskit:

Adrien Suau
  • 5,172
  • 22
  • 58