Brief Introduction:

Variational ansatz-based imaginary time evolution(VITE), or imaginary-time Ansatz optimization(as referred in Ref) is a method to project the trajectory of imaginary time evolution onto the ansatz manifold. The basic idea is to solve the imaginary time evolution equation(McLachlan’s variational principle):

ψ(τ)τ=(HEτ)ψ(τ)\frac{\partial |\psi(\tau)\rangle}{\partial \tau} = -(H - E_{\tau})|\psi(\tau)\rangle

Where

Eτ=ψ(τ)Hψ(τ)E_{\tau} = \langle \psi(\tau)|H|\psi(\tau) \rangle

What makes it different from conventional imaginary time evolution method is that it uses the function space of ansatz θψθ(τ)\theta \mapsto |\psi_{\theta}(\tau)\rangle as the solution space. By doing so, the evolution of state vector ψ|\psi \rangle is transformed into evolution of parameters θ\theta. For more details, please refer to the Appendix of the paper.

In short, the VITE is to obey the following update rule:

θ(τ+δτ)=θ(τ)+A1(τ)C(τ)δτ\theta(\tau + \delta \tau) = \theta(\tau) + A^{-1}(\tau) \cdot C(\tau)\delta \tau

Where

Aij(τ)=Real(ϕ(τ)θiϕ(τ)θj)A_{ij}(\tau) = \mathrm{Real}\left(\frac{\partial \langle \phi(\tau)|}{\partial \theta_i} \frac{\partial |\phi(\tau) \rangle}{\partial \theta_j}\right) Ci(τ)=Real(ϕ(τ)θiHϕ(τ))C_{i}(\tau) = -\mathrm{Real} \left(\frac{\partial \langle \phi(\tau)|}{\partial \theta_i} H |\phi(\tau) \rangle \right)

This is actually equivalent to applying a preconditioner A1A^{-1} to the gradient descent method:

θ(τ+δτ)=θ(τ)A1(τ)grad(θ(τ))δτ\theta(\tau + \delta \tau) = \theta(\tau) - A^{-1}(\tau) \cdot \mathrm{grad}(\theta(\tau))\delta \tau

Recent propose of quantum natural gradient descent(QNGD) also connects to the precontitioner AA of VITE. In QNGD, the update rule is as follows:

θ(τ+δτ)=θ(τ)F1(τ)grad(θ(τ))δτ\theta(\tau + \delta \tau) = \theta(\tau) - F^{-1}(\tau) \cdot \mathrm{grad}(\theta(\tau))\delta \tau

Where

Fij(τ)=4Real(ϕ(τ)θiϕ(τ)θjϕ(τ)θiϕ(τ)ϕ(τ)ϕ(τ)θj)F_{ij}(\tau) = 4 \mathrm{Real}\left(\frac{\partial \langle \phi(\tau)|}{\partial \theta_i} \frac{\partial |\phi(\tau) \rangle}{\partial \theta_j} - \frac{\partial \langle \phi(\tau)|}{\partial \theta_i} |\phi(\tau)\rangle \langle \phi(\tau)| \frac{\partial |\phi(\tau)\rangle}{\partial \theta_j}\right)

We see that both VITE and QNGD can be seen as cases for applying Hessian-like preconditioner to the gradient descent method.

Calculation of Hessian-like matrix

The calculation of the form Real(ϕ(τ)θiϕ(τ)θj)\mathrm{Real}\left(\frac{\partial \langle \phi(\tau)|}{\partial \theta_i} \frac{\partial |\phi(\tau) \rangle}{\partial \theta_j}\right), from the viewpoint of the physical implementation of quantum computation, requires doing hadamard test at both side of the circuit, i.e. the left circuit with parameter θi\theta_i and the right circuit with parameter θj\theta_j. From the viewpoint of the numerical simulation, it becomes a little interesting, since forward mode differentiation(including forward mode numerical differentiation method and hadamard test method) has a complexity of O(N2)O(N^2), which is not efficient enough. Since most numerical simulator use a more efficient(complexity of O(N)O(N)) differentiation method, i.e. reverse mode or backpropogation, here is the question that, if reverse mode could be used in the calculation of the Hessian-like matrix defined above.

It is actually possible, just do the hybrid mode!

In a forward-reverse hybrid mode, we firstly do forward-mode symbolic rewriting of the left circuit, such that the new circuit has the AB\langle A|B\rangle form:

AB=Real(ϕ(τ)ϕ(τ)θi) \langle A|B\rangle = \mathrm{Real}\left( \frac{\partial \langle \phi(\tau)| \phi(\tau) \rangle}{\partial \theta_i} \right)

and then using backpropogation to calculate the gradient with respect to each θj\theta_j in the right circuit. That's it!

The only thing left is to proof that this is mathematically solid, that is, we need to prove:

Real(ϕ(τ)θiϕ(τ)θj)=Real(ϕ(τ)ϕ(τ)θi)/θj \mathrm{Real}\left(\frac{\partial \langle \phi(\tau)|}{\partial \theta_i} \frac{\partial |\phi(\tau) \rangle}{\partial \theta_j}\right) = \partial \mathrm{Real}\left( \frac{\partial \langle \phi(\tau)| \phi(\tau) \rangle}{\partial \theta_i} \right) / \partial \theta_j

It is actually straightforward, let's firstly define

f(θj)=ϕ(τ)ϕ(τ)θif(\theta_j) = \frac{\partial \langle \phi(\tau)| \phi(\tau) \rangle}{\partial \theta_i}

without of loss of generality, we can also say:

f(θj)=u(θj)+iv(θj) f(\theta_j) = u(\theta_j) + i v(\theta_j)

where uu and vv are real function, and θj\theta_j is a real variable. Thus, we easily have:

f(θj)θj=u(θj)θj+iv(θj)θj \frac{\partial f(\theta_j)}{\partial \theta_j} = \frac{\partial u(\theta_j)}{\partial \theta_j} + i \frac{\partial v(\theta_j)}{\partial \theta_j}

thus

Real(f(θj)θj)=u(θj)θj=Real(f(θj))θj \mathrm{Real}\left( \frac{\partial f(\theta_j)}{\partial \theta_j}\right) = \frac{\partial u(\theta_j)}{\partial \theta_j} = \frac{\partial \mathrm{Real}\left( f(\theta_j) \right) }{\partial \theta_j}

expanding ff into ϕ(τ)ϕ(τ)θi\frac{\partial \langle \phi(\tau)| \phi(\tau) \rangle}{\partial \theta_i} we immediately have

Real(ϕ(τ)θiϕ(τ)θj)=Real(ϕ(τ)ϕ(τ)θi)/θj \mathrm{Real}\left(\frac{\partial \langle \phi(\tau)|}{\partial \theta_i} \frac{\partial |\phi(\tau) \rangle}{\partial \theta_j}\right) = \partial \mathrm{Real}\left( \frac{\partial \langle \phi(\tau)| \phi(\tau) \rangle}{\partial \theta_i} \right) / \partial \theta_j






CC BY-SA 4.0 Septimia Zenobia. Last modified: May 28, 2024. Website built with Franklin.jl and the Julia programming language.