Video length is 5:14

VQE with MATLAB

Dive deep into the variational quantum eigensolver (VQE), a hybrid quantum-classical algorithm designed to find the lowest eigenvalue of a matrix. VQE is particularly useful in solving optimization problems and is widely applied in quantum chemistry and quantum simulations. Learn how to implement this algorithm using MATLAB® and MATLAB Support Package for Quantum Computing to determine the minimum ground state energy of a chemistry Hamiltonian. The VQE leverages the variational principle of physics to solve eigenvalues of matrices using classical computing methods, which can be challenging—especially for large matrices with complex numbers. By utilizing quantum computing, VQE offers a more efficient approach. In quantum mechanics, any measurable variable is called an observable, represented mathematically as a matrix. When measured, these observables yield discrete or quantized values known as eigenvalues, with corresponding eigenvectors. A Hamiltonian, representing the total energy of a system, is a key observable in quantum mechanics. The VQE algorithm estimates the lowest eigenvalue by applying the variational method. The VQE process involves two main parts: the ansatz and the classical optimizer. The ansatz is a quantum circuit with tunable parameters, mimicking a system’s ground state wavefunction or eigenvectors. The classical optimizer adjusts the parameters of the ansatz to minimize energy, iteratively finding the actual ground state. For this demo, explore a chemistry problem Hamiltonian in the second quantized form, using Pauli matrices X, Y, and Z and identity gates. Begin by defining the Hamiltonian and solving it classically to establish a benchmark for the VQE algorithm. Next, construct the ansatz and plot the quantum circuit. Then, define an optimizer using Global Optimization Toolbox to minimize the eigenvalues of the Hamiltonian. The optimizer simulates the circuit iteratively, converging to a minimum eigenvalue close to the classically calculated value. Finally, extract the optimal rotational gate values and run the circuit on both the MATLAB simulator and a hardware device hosted on AWS®. By comparing the results, verify the successful implementation of the VQE.

Published: 10 Jul 2024