A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

# Tag Info

I know that $b$ can be decomposed mathematically as $b= c_1u_1 + > \cdots + c_nu_n$ since these eigenvectors form an orthonormal basis. Why only consider the effect on $|u_j \rangle$? As you say, you know you can decompose $b$ in terms of the $|u_j \rangle$, so by linearity, if we know the effect on one basis state (which is pedagogically easier to ...
Note: the graphics have been generated with the LaTeX code available here. Credits to @Niel de Beaudrap. Yes it is possible! The HHL algorithm can be schematically depicted as Let's split down the parts: The first part aims at computing an approximation of the eigenvalues of $H$, $H = A$ if $A$ is hermitian, else $H = \begin{pmatrix} 0 & A \\ A^\... 4 You can draw the circuit using construct_circuit().draw(). In the tutorial you are talking about, if you scroll down to the 4x4 randomly generated section that uses params5 you can run print(hhl.construct_circuit()), after the line hhl = HHL.init_params(params5, algo_input). This may take a little while to complete but it should eventually print out ASCII ... 3 Be careful! They don't apply$e^{i\pi A}$and$e^{i\pi A/2}$. They apply $$|0\rangle\langle 0|\otimes I\otimes I+|1\rangle\langle 1| \otimes I\otimes e^{i\pi A}$$ and $$I\otimes |0\rangle\langle 0|\otimes I+I\otimes |1\rangle\langle 1|\otimes e^{i\pi A/2},$$ i.e. controlled versions of the gates, controlled off two different qubits. So, consider the 4 ... 3 Define the states $$|\psi_t\rangle=\left\{\begin{array}{cc} |t\rangle\otimes(U_{t-1}U_{t-2}\ldots U_1|\psi\rangle) & t=1,2,\ldots T \\ |t\rangle\otimes(U_{T}U_{T-1}\ldots U_1|\psi\rangle) & t=T+1,T+2,\ldots 2T \\ |t\rangle\otimes(U_{3T+1-t}U_{3T-t}\ldots U_1|\psi\rangle) & t=2T+1,2T+2,\ldots 3T \end{array}\right.$$ Now let $$U=\frac{2}{T}\sum_{... 3 Let's assume that you have a Hermitian matrix$$ H=\left(\begin{array}{cc} 0 & A^\dagger \\ A & 0 \end{array}\right). $$Let |b\rangle be the state that we want to apply A to, extended to work on the space that H acts on. So, our aim is to implement H|b\rangle. Let X be the standard Pauli X matrix. If we implement a unitary evolution$$ ... 3 1) Are we not applying the conditional Hamiltonian evolution to$|\Psi_0 \rangle |b \rangle$? The operation $$\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau| \otimes e^{iA\tau t_0 / T}$$ is a controlled operation. You can read it as:$\forall \tau \in [0, T-1]$, if the first register is in the state$\vert \tau \rangle$, apply$e^{iA\tau t_0 / T}$. ... 3 Disclaimer: I'm the one that wrote the code of the 4x4 HHL. Controlling a quantum gate$U$can be achieved by controlling each of the$U_i$gates that are composing$U$. For the specific example you are considering, the implementation is available online. Some remarks about the code: I think the code is not up to date with the last version of Qiskit. I ... 2 Note that the ancilla qubit in your example has dimension 2, not 1, because it goes into a superposition of 2 basis states,$|0\rangle$and$|1\rangle$. For the HHL algorithm, you need an ancilla capable of recording the three options "nothing", "well" and "ill". As such, you need a Hilbert space of dimension 3 (also called a qutrit). Now, it is true that ... 2 In the HHL algorithm, they are solving a linear system$Ax=b$. This is achieved by embedding$A$into a Hermitian matrix such as $$H=\left(\begin{array}{cc} 0 & A \\ A^\dagger & 0 \end{array}\right).$$ If$A$has singular values$\lambda$, then$H$has eigenvalues$\pm\lambda$. So to all intents and purposes, they are the same thing in this context.... 2 The credit for this answer goes to met927 in the previous post. So please upvote that answer instead of this one. met927's response answered my question. Not setting up some of the parameters to make system draw faster was my error. So thank you met927 for responding quickly and answering my question! Below is a snippet that one can run quite quickly (... 2 Quick answer: You will not be able to fully recover$x$. Explanations: 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 ... 1 I tend to find the bit about the geometric random variable a bit misleading. What they're trying to say is that if you apply$A^{-1}$to$|1\rangle|\psi\rangle$and you measure the first register, you'll get the answer$t$with a probability that goes like$e^{-t/T}$(approximately, assuming large$T\$), and that's a geometric distribution. Now, I think the ...