XanaduAI / QHack2022

QHack—The one-of-a-kind quantum computing hackathon
https://qhack.ai
88 stars 124 forks source link

Parameter shift rule for a parameter dependent Hamiltonian to study convergence properties #79

Open MQS-mark opened 2 years ago

MQS-mark commented 2 years ago

Team Name:

MQS

Project Description:

In a VQE algorithm, the parameters of the variational circuit are updated by the classical optimizer. Classical optimizers rely on calculating the gradient of the cost function at each iteration. In the case of applying VQE to find the ground state of a molecule, the cost function is the expectation value of the Hamiltonian of the molecular system. There are multiple ways to calculate the gradient of a function, and one of the best ways to do this is using the parameter shift rule. In the most commonly studied case of finding the ground state energy of a molecule, the Hamiltonian itself is independent of the parameters θ. For some models, such as PCM-VQE, which models the ground state energy of a molecule surrounded by an implicit solvent, this is no longer true. In such a model, the Hamiltonian itself is modified by the electronic wavefunction because the electronic structure interacts with the solvent, meaning that we have a parameter dependent Hamiltonian. This means that the parameter-shift rule needs to be modified in order to be used.

Therefore, for situations with a parameter-dependent Hamiltonian, a custom parameter-shift rule needs to be derived. In the code provided in the PCM-VQE preprint, the finite difference method is used for gradient calculation. In the paper it is mentioned that it has not been yet determined how the parameter-dependence of the Hamiltonian affects the convergence properties of the VQE algorithm. As a first step to exploring this topic, it would be beneficial to replace the finite-difference method with a parameter-shift rule. This would disentangle the approximation errors from the genuinely novel effects that the simulation of this model carries with it. To finally assess the convergence properties, there are lots of variables to explore, such as initial parameter values, size of orbital basis set and the gate composition of the circuit.

Presentation:

https://github.com/MQSdk/parameter_shift_H_theta

Source code:

https://github.com/MQSdk/parameter_shift_H_theta

Which challenges/prizes would you like to submit your project for?

  1. Amazon Braket Challenge

  2. Simulation Challenge

  3. Quantum Chemistry Challenge

  4. Science Challenge

  5. Hybrid Algorithms Challenge

isaacdevlugt commented 2 years ago

Hey @MQS-mark thank you for your submission! Just make sure that the hyperlinks direct our team directly to what is asked. It looks like your presentation hyperlink that you provided just goes to your repository. Is there a specific notebook, PDF, etc, that we should look at? Also, there's still time to post your code that you used for your project. Make sure to commit code to your repository before then!

KaurKristjuhan commented 2 years ago

Hi @isaacdevlugt , we added the presentation and code into the repository now!