To be continued

HHL

Reference

  1. Lloyd, Seth. "Quantum algorithm for solving linear systems of equations." APS March Meeting Abstracts. Vol. 2010. 2010. [arXiv:0811.3171]
  2. Morrell Jr, Hector Jose, and Hiu Yung Wong. "Step-by-Step HHL Algorithm Walkthrough to Enhance the Understanding of Critical Quantum Computing Concepts." arXiv:2108.09004 (2021).
  3. Learn Quantum Computation using Qiskit. online book
  4. Duan, Bojia, et al. "A survey on HHL algorithm: From theory to application in quantum machine learning." Physics Letters A 384.24 (2020): 126595.

1. Basic idea of HHL

1.1. Question

The goal of HHL is solve the linear equation Ax⃗=b⃗ A \vec{x}=\vec{b} where

  • matrix AA and a vector b⃗\vec{b} are given
  • find x⃗\vec{x} satisfying this linear equation

we can convert the equation into x⃗=A−1b⃗ \vec{x}=A^{-1} \vec{b}

1.1.1. example

the linear equation Ax⃗=b⃗(1−13−131)(x0x1)=(01) \begin{aligned} A \vec{x}&=\vec{b}\\ \left(\begin{array}{cc} 1 & -\frac{1}{3} \\ -\frac{1}{3} & 1 \end{array}\right) \left(\begin{array}{l} x_0 \\ x_1 \end{array}\right) &= \left(\begin{array}{l} 0 \\ 1 \end{array}\right) \end{aligned} find x⃗=(3898)\vec{x}=\left(\begin{array}{c} \frac{3}{8} \\ \frac{9}{8} \end{array}\right) satisfying this linear equation Ax⃗=b⃗(1−13−131)(3898)=(01) \begin{aligned} A \vec{x}&=\vec{b}\\ \left(\begin{array}{cc} 1 & -\frac{1}{3} \\ -\frac{1}{3} & 1 \end{array}\right) \left(\begin{array}{l} \frac{3}{8} \\ \frac{9}{8} \end{array}\right) &= \left(\begin{array}{l} 0 \\ 1 \end{array}\right) \end{aligned}

1.2. Mathematical Preliminaries

Matrix AA should be Hermitian. If not, the AA can be converted to Hermitian by (0AA†0) \left(\begin{array}{ll} 0 & A \\ A^{\dagger} & 0 \end{array}\right) Since matrix AA is Hermitian, it has a spectral decomposition A=∑j=0N−1λj∣uj⟩⟨uj∣ A=\sum_{j=0}^{N-1} \lambda_j\left|u_j\right\rangle\left\langle u_j\right| where

  • λj\lambda_j is jj-th eigenvalue of matrix AA
  • ∣uj⟩\left|u_j\right\rangle is jj-th eigenvector of matrix AA

the inverse of AA can be written as A−1=∑j=0N−1λj−1∣uj⟩⟨uj∣ A^{-1}=\sum_{j=0}^{N-1} \lambda_j^{-1}\left|u_j\right\rangle\left\langle u_j\right| Since AA is invertible and Hermitian, it must have an orthogonal basis of eigenvectors, and thus we can write bb in the eigenbasis of AA as ∣b⟩=∑j=0N−1bj∣uj⟩,bj∈C |b\rangle=\sum_{j=0}^{N-1} b_j\left|u_j\right\rangle, \quad b_j \in \mathbb{C} The eigenbase of AA must be orthogonal eigenvectors ⟨ui∣uj⟩=δij\left\langle u_i \mid u_j\right\rangle=\delta_{i j} since AA is invertible and Hermitian, so we can write bb in the eigenbasis of AA as ∣b⟩=∑j=0N−1bj∣uj⟩ |b\rangle=\sum_{j=0}^{N-1} b_j\left|u_j\right\rangle The solution of the linear equation also can be written in the eigenbasis ∣x⟩=A−1∣b⟩=∑j=0N−1λj−1bj∣uj⟩ |x\rangle=A^{-1}|b\rangle=\sum_{j=0}^{N-1} \lambda_j^{-1} b_j\left|u_j\right\rangle

1.3. Steps of the HHL algorithm

Overview of the HHL algorithm flow

  1. Initialize the vector b⃗\vec{b} to be quantum state ∣b⟩|b\rangle
  2. Estimate the eigenvalues of matrix AA
    • Apply Quantum Phase Estimation (QPE) to get the value of
  3. Ancilla bit Rotation: -
  4. Inverse Quantum Phase Estimation (IQPE)
  5. Measurement
    • Measure the auxiliary qubit in the computational basis.

1.3.1. State Preparation

There are total nb+n+1n_b+n+1 qubits and they are initialized as ∣Ψ0⟩=∣0⋯0⟩b∣0⋯0⟩c∣0⟩a=∣0⟩⊗nb∣0⟩⊗n∣0⟩ \left|\Psi_0\right\rangle=|0 \cdots 0\rangle_b|0 \cdots 0\rangle_c|0\rangle_a=|0\rangle^{\otimes n_b}|0\rangle^{\otimes n}|0\rangle where

  • nbn_b qubits state ∣0⋯0⟩b|0 \cdots 0\rangle_b in the b-register
  • nn qubits (clock qubits) state ∣0⋯0⟩c|0 \cdots 0\rangle_c in the c-register
  • state ∣0⟩a|0\rangle_a of ancilla qubit

where registers of quantum circuit are

  • b-register
    • rotated to have the amplitudes correspond to the coefficients of b⃗\vec{b}. That is
  • c-register (clock qubits)
    • related to the time (clock) in the controlled rotation in the QPE
    • c-register stores the values of the phase of the eigenvalues of the AA matrix after the QPE.
    • There are nn qubits (clock qubits) in the c-register.
  • ancilla qubit

∣0⋯0⟩b|0 \cdots 0\rangle_b in the b-register needs to be rotated to have the amplitudes correspond to the coefficients of b⃗\vec{b}. That is b⃗=(β0β1⋮βNb−1)⇕∣b⟩=β0∣0⟩+β1∣1⟩+⋯+βNb−1∣Nb−1⟩ \begin{aligned} \vec{b}&=\left(\begin{array}{c} \beta_0 \\ \beta_1 \\ \vdots \\ \beta_{N_b-1} \end{array}\right) \\ \Updownarrow \\|b\rangle &=\beta_0|0\rangle+\beta_1|1\rangle+\cdots+\beta_{N_b-1}\left|N_b-1\right\rangle \end{aligned} After state preparation ∣Ψ1⟩=∣b⟩b∣0⋯0⟩c∣0⟩a \left|\Psi_1\right\rangle=|b\rangle_b|0 \cdots 0\rangle_c|0\rangle_a

1.3.2. Quantum Phase Estimation

Quantum Phase Estimation (QPE) has three components

  1. the superposition of the clock qubits through Hadamard gates,
  2. controlled rotation
  3. Inverse Quantum Fourier Transform (IQFT). The goal of QPE is to estimate the phase of the eigenvalues of the unitary rotation matrix, U=eiAtU=e^{i A t}, in the controlled gate, C−UC-U, (Fig. 1) used in the QPE. Again, this gate encodes the matrix AA

Hadamard gates

Apply the Hadamard gates to the clock qubits to create a superposition of the clock qubits ∣Ψ2⟩=I⊗nb⊗H⊗n⊗I∣Ψ1⟩=∣b⟩12n2(∣0⟩+∣1⟩)⊗n∣0⟩ \begin{aligned} \left|\Psi_2\right\rangle &=I^{\otimes n_b} \otimes H^{\otimes n} \otimes I\left|\Psi_1\right\rangle \\ &=|b\rangle \frac{1}{2^{\frac{n}{2}}}(|0\rangle+|1\rangle)^{\otimes n}|0\rangle \end{aligned}

controlled rotation

applying AA to its eigenvector ∣uj⟩\left|u_j\right\rangle, A∣uj⟩=∑i=02nb−1λi∣ui⟩⟨ui∣∣uj⟩=∑i=02nb−1λi∣ui⟩δij=λj∣uj⟩ \begin{aligned} A\left|u_j\right\rangle &=\sum_{i=0}^{2^{n_b}-1} \lambda_i\left|u_i\right\rangle\left\langle u_i|| u_j\right\rangle \\ &=\sum_{i=0}^{2^{n_b-1}} \lambda_i\left|u_i\right\rangle \delta_{i j} \\ &=\lambda_j\left|u_j\right\rangle \end{aligned}

1.3.3. Rotation

1.4. Example: 4-qubit

Reference: Learn Quantum Computation using Qiskit. online book

To solve linear equation Ax⃗=b⃗ A \vec{x}=\vec{b} where

  • matrix AA and a vector b⃗\vec{b} are given
  • find x⃗\vec{x} satisfying this linear equation

To be continued

results matching ""

    No results matching ""