qiskit-advocate / qamp-spring-22

Qiskit advocate mentorship program (QAMP) spring 22 cohort (Mar - Jun 2022)
13 stars 1 forks source link

Migrate `AdaptVQE` from Qiskit Nature to Terra #3

Open mrossinek opened 2 years ago

mrossinek commented 2 years ago

Description

The AdaptVQE algorithm, originally implemented in Qiskit Aqua as the outcome of the Qiskit Hackathon Europe 2019, link. Since then, it has been refactored multiple times, most recently during the QAMP Fall 2021 to leverage Qiskit Terra's gradient framework link.

This time around, we would like to take the algorithm one step further by decoupling it from Qiskit Nature and migrate it to Qiskit Terra, making it more widely available. More details will be provided soon.

Deliverables

Migrate the AdaptVQE algorithm from Qiskit Nature to Terra.

Mentors details

Number of mentees

1

Type of mentees

This project will be continued from https://github.com/qiskit-advocate/qamp-fall-21/issues/5 by @fs1132429

HuangJunye commented 2 years ago

It's great to the continuation of mentorship project. @fs1132429 @dlasecki can you please comment here so that I can assign you to the issue? Thank you.

HuangJunye commented 2 years ago

Note to other advocates: this project is a continuation from QAMP Fall 21 and therefore is not open for application.

dlasecki commented 2 years ago

Sure.

fs1132429 commented 2 years ago

yes!

fs1132429 commented 2 years ago

qamp-spring22.pptx Here is the ppt slides.

fs1132429 commented 2 years ago

Checkpoint 2: AdaptVQE is an algorithm that creates a compact ansatz by gradually building up the ansatz circuit by appending the excitation with the largest energy gradient to the circuit. This results in a wavefunction ansatz that is uniquely formed by the algorithm. Traditional VQE has a fixed or ad hoc ansatz. This affects the simulation as variational flexibility depends on the ansatz. But AdaptVQE builds up the ansatz rather than having a fixed one. AdaptVQE is currently in Qiskit Nature but we are migrating it to Qiskit Terra. Since the first checkpoint, we’ve been focusing on removing all Qiskit Nature specific code from AdaptVQE . We also changed the parent class from GroundStateEigensolver to VQE. We have been trying to integrate all the available VQE functions into AdaptVQE code. This involves removing the function parameters like qubit_convertor,solver ,delta and adding new parameters like excitation pool and ansatz(which is optional). The excitation pool was previously constructed by UCC in Qiskit Nature but now the user will have to input it. The solve method of AdaptVQE is refactored to compute_minimum_eigensolver to be analogous to VQE and users will have to input the main operator in this function. AdaptVQE test has also been added to check out if the refactored code works or not. There are still some discrepancies mainly with regards to gradient and construction of operator but we are still trying to figure it out. A draft PR has also been created to comply with the suggested changes.

fs1132429 commented 2 years ago
Screenshot 2022-05-04 at 10 55 06 PM
fs1132429 commented 2 years ago

Final presentation : final_spring.pptx