qiskit-advocate / qamp-fall-22

Qiskit advocate mentorship program (QAMP) fall 22 cohort (Sep - Dec 2022)
15 stars 7 forks source link

Enhancement of Aer-based `quantum_info` #23

Closed hhorii closed 1 year ago

hhorii commented 1 year ago

Description

AerStatevector will be released in Qiskit-Aer 0.11. AerStatevector supports qiskit.quantum_info.states.Statevector interface with Qiskit-Aer statevector and provide much better performance than it. In this project, mentees develop more classes of quantum_info with Qiskit-Aer, such as Densitymatrix and StabilizerState.

Deliverables

New python classes: AerDensitymatrix and AerStatevectorState

Mentors details

Number of mentees

2

Type of mentees

derwind commented 1 year ago

Hi @hhorii, I probably do not strictly meet the requirements, but I would like to see if there is any area where I can help. First of all I am a software developer with a career of almost 20 years. I have used Python 2/3 since 2015 to now. I have some experience in OSS in areas unrelated to quantum computing as a contributor. I have also used C++ intermittently from 2003 to 2015 mostly for embedded systems. But I don't have deep knowledge for neither Denstymatrix nor StabilizerState in quantm_info. I have played with binding of python and C++ using Boost.Pytho beforen, but I have no experience using them for business purposes.

hhorii commented 1 year ago

@derwind Thank you for your comment. I believe that you do not need C++ implementation to implement Densitymatrix but knowledge of C++ will be very helpful to understand the current implementation of AerStatevector. Binding part was already done by using pybind11. AerStatevector is now under review here. I expect that you implement AerDensitmatrix as I am implementing AerStatevector. The scope of development may be narrow than what you expected. Please tell me still you are interested in this porject.

In my opinion, implementation of AerStabilizerState needs knowledge of StabilizerState.

derwind commented 1 year ago

@hhorii Thank you for your reply. There is still some uncertainty for me due to lack of my knowledge , but I am willing to take on the challenge since I believe this is a good first step in understanding Qiskit itself and how to better utilize it in the future. First of all I checked out your PR#1590 locally to understand the situation, built qiskit-aer and ran the following code:

>>> from qiskit import QuantumCircuit
>>> from qiskit_aer.quantum_info.states.aer_statevector import AerStatevector
>>> qc = QuantumCircuit(1)
>>> sv = AerStatevector(qc)
>>> sv.trace()
1.0

I have no knowledge of StabilizerState, so when tackling this issue, I would like to implement the AerDensitymatrix class, which relates to a density matrix that I am relatively familiar with. I will be looking up the concept etc I don't know as I go along.

derwind commented 1 year ago

Checkpoint 1

The presentation slide is: Enhancement_of_Aer-based_quantum_info.pdf

derwind commented 1 year ago

Checkpoint 2

Review of Checkpoint 1

Review briefly what we have accomplished up to checkpoint 1.

Tasks and progress

Remaining tasks and progress to this point are listed below. Checked areas are those that are complete or nearly complete:

implementation

performance

By-products

Here are some of the by-products of during the tasks

PR1621

The image below is an example of the display in a local environment:

qiskit_textbook

Current impression

At the start of the project, I was confused by many things I did not know, but through weekly discussions with my mentor @hhorii, the situation gradually became clearer. Since the nature of the project is software development, we encountered many puzzling behaviors and bugs, but I feel that we have been able to solve them one by one in cooperation with my mentor. There are still a few hurdles to overcome before implementation is complete, but I believe that we can overcome them by continuing to move forward. Thank you.

derwind commented 1 year ago

Final Showcase

I attached the slide used in the Final Showcase and the Jupyter notebook used in the performance measurement demo.

Enhancement_of_Aer-based_quantum_info.pdf performance_check_dm.ipynb.zip

Now all but one of the milestones declared in Checkpoint 2 have been achieved. That item is "Create a PR on GitHub and have it merged", which is ended with the creation of a draft PR. This, however, is actually for the good. Instead of forcing ourselves to create a PR and pretend to be perfect, we chose to continue with our QAMP journey. We will keep going to finish in the very near future!

GemmaDawson commented 1 year ago

Congratulations on completing all the requirements for QAMP Fall 2022!! 🌟🌟🌟