How to simulate quantum mechanical systems: VQE and efficient computations of gradients

We start with a reminder on the VQE method with applications to the one-qubit system. We discussed this to some detail during the week of March 27-31. Here we revisit the one-qubit system and develop a VQE code for studying this system using gradient descent as a method to optimie the variational ansatz.

We start with a simple \( 2\times 2 \) Hamiltonian matrix expressed in terms of Pauli \( X \) and \( Z \) matrices, as discussed in the project text.

We define a symmetric matrix \( H\in {\mathbb{R}}^{2\times 2} \)

$$ H = \begin{bmatrix} H_{11} & H_{12} \\ H_{21} & H_{22} \end{bmatrix}, $$

We let \( H = H_0 + H_I \), where

$$ H_0= \begin{bmatrix} E_1 & 0 \\ 0 & E_2\end{bmatrix}, $$

is a diagonal matrix. Similarly,

$$ H_I= \begin{bmatrix} V_{11} & V_{12} \\ V_{21} & V_{22}\end{bmatrix}, $$

where \( V_{ij} \) represent various interaction matrix elements. We can view \( H_0 \) as the non-interacting solution

$$ \begin{equation} H_0\vert 0 \rangle =E_1\vert 0 \rangle, \tag{9} \end{equation} $$

and

$$ \begin{equation} H_0\vert 1\rangle =E_2\vert 1\rangle, \tag{10} \end{equation} $$

where we have defined the orthogonal computational one-qubit basis states \( \vert 0\rangle \) and \( \vert 1\rangle \).

We rewrite \( H \) (and \( H_0 \) and \( H_I \)) via Pauli matrices

$$ H_0 = \mathcal{E} I + \Omega \sigma_z, \quad \mathcal{E} = \frac{E_1 + E_2}{2}, \; \Omega = \frac{E_1-E_2}{2}, $$

and

$$ H_I = c \boldsymbol{I} +\omega_z\sigma_z + \omega_x\sigma_x, $$

with \( c = (V_{11}+V_{22})/2 \), \( \omega_z = (V_{11}-V_{22})/2 \) and \( \omega_x = V_{12}=V_{21} \). We let our Hamiltonian depend linearly on a strength parameter \( \lambda \)

$$ H=H_0+\lambda H_\mathrm{I}, $$

with \( \lambda \in [0,1] \), where the limits \( \lambda=0 \) and \( \lambda=1 \) represent the non-interacting (or unperturbed) and fully interacting system, respectively. The model is an eigenvalue problem with only two available states.

Here we set the parameters \( E_1=0 \), \( E_2=4 \), \( V_{11}=-V_{22}=3 \) and \( V_{12}=V_{21}=0.2 \).

The non-interacting solutions represent our computational basis. Pertinent to our choice of parameters, is that at \( \lambda\geq 2/3 \), the lowest eigenstate is dominated by \( \vert 1\rangle \) while the upper is \( \vert 0 \rangle \). At \( \lambda=1 \) the \( \vert 0 \rangle \) mixing of the lowest eigenvalue is \( 1\% \) while for \( \lambda\leq 2/3 \) we have a \( \vert 0 \rangle \) component of more than \( 90\% \). The character of the eigenvectors has therefore been interchanged when passing \( z=2/3 \). The value of the parameter \( V_{12} \) represents the strength of the coupling between the two states.