qiskit-advocate / qamp-spring-22

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

Implement new features and improve documentation in Operators #20

Open ikkoham opened 2 years ago

ikkoham commented 2 years ago

Description

The aim of this project is to make code contributions to Qiskit. We will solve the issues around operators (opflow, quantum_info.operators, nature.operators). For example,

As above, there are easy to hard issues.

Deliverables

Code contribution (creating PRs. to Qiskit Terra or Nature)

Mentors details

Number of mentees

3

Type of mentees

anonymousr007 commented 2 years ago

Hello sir,

I am Rishabh, an undergraduate final year computer science and engineering student and I am interested in this project. My interests: Quantum Information and Quantum Error Correction

Thanks & Regards Rishabh

kUmezawa commented 2 years ago

This is our presentation for the first checkpoint!

#20 Implement new features and improve documentation in Operators.pdf

anonymousr007 commented 2 years ago

Hi, I see this pdf and I am interested in this. So, What's the further process to get selected as a mentee?

HuangJunye commented 2 years ago

Hi @anonymousr007, you will need to first apply to the qiskit advocate program. You can find more information about how to apply in the application guide. If you have more questions, you can ask in the#qiskit-advocate-application channel. Thank you!

HuangJunye commented 2 years ago

@daiki0623 @YumaNK Can you please comment in the issue so that I can assign you? Thank you.

YumaNK commented 2 years ago

OK, please assign me to this issue.

anonymousr007 commented 2 years ago

Hi @anonymousr007, you will need to first apply to the qiskit advocate program. You can find more information about how to apply in the application guide. If you have more questions, you can ask in the#qiskit-advocate-application channel. Thank you!

Okay sir, thanks to clear it @HuangJunye. Yes, I have some questions.

  1. Actually, I participated in most of the IBM Challenges
    • IBM Quantum Challenge Fall 2020
    • ICPC Quantum Computing Challenge powered by IBM Quantum
    • IBM Quantum Challenge 2021
    • Qiskit - Quantum Machine Learning Summer School 2021
    • IBM Quantum Africa Challenge 2021
    • IBM Quantum Challenge Fall 2021 So, do my points count in all different or mix up all?
  2. I am working on the implementation of Quantum Error Correction research papers for Qiskit Advocate. So, qiskit-ignis is officially deprecated?
daimurat commented 2 years ago

@HuangJunye Sorry, I'm late, thank you.

ikkoham commented 2 years ago

@anonymousr007 Ignis is deprecated. you can use qiskit-experiments alternatively.

HuangJunye commented 2 years ago

@anonymousr007 That looks great. In order not to mix up the conversations with the QAMP project here, can you please ask your questions on Qiskit Slack workspace? My slack ID is @Junye Thank you!

YumaNK commented 2 years ago

Checkpoint 2

Relating PR: https://github.com/Qiskit/qiskit-terra/pull/7874 Relating issue: https://github.com/Qiskit/qiskit-terra/issues/6624

  1. make code more readable and efficient In the previous Checkpoint phase, I did PullRequest the code that I only confirmed that input and output were as expected. The matrix calculation block, which is less readable, took up most of the code. Reflecting the comments received from @jakelishman during the PullRequest, I rewrite the code to make the matrix calculation part faster and more readable. This improvement will make it easier to debug in the future, and also make it helpful for external contributors to catch up when they get interested to understand this function.

  2. docstring I added the method description and usage as it has been only minimally described up to now. We hope that this method will be easy to find and use when users need this function.

  3. add test code In the previous Checkpoint phase, we had not added test code for the newly added methods. We added the test code and verified that the methods work as expected with wider coverage. We also found that the test code for the related existing methods had some problems and made corrections with the advice of the mentor.

  4. Understanding of Simultaneous Measurement The development focused on the Grouping of Pauli Operator but expanded our understanding of how its output is used. The grouped Pauli Operator is capable of simultaneous measurement of expectation values for each group. However, its measurement basis must be a basis with simultaneous diagonalization. For example, in the simultaneous measurement of the expectation values of XX and YY, the Bell basis is used as the measurement basis. I deepened my understanding of the theory of simultaneous measurement behind Pauli Operator's Grouping.

image

image

daimurat commented 2 years ago

Checkpoint 2

Now Operator class cannot calculate left side scalar multiplication. For example, this code will arise an error but it should be calculated correctly.

from qiskit.quantum_info import Pauli
Pauli("X") * -1j

So I add new method __mul__ to BaseOperator to enable to calculate this scalar multiplication.

qamp2022_checkpoint2

kUmezawa commented 2 years ago

Checkpoint 2

  1. A short (500 words or less) update on the work I’ve achieved since Checkpoint 1.

Added two methods for the following functions to SparsePauliOp. Added 7 cases of tests related to them. sent a pull request.

Relating PRs https://github.com/Qiskit/qiskit-terra/pull/8016

【argsort】 Returns the composition of permutations in the order of sorting by coefficient and sorting by Pauli. By using the weight kwarg the output can additionally be sorted by the number of non-identity terms in the Pauli, where the set of all Pauli's of a given weight are still ordered lexicographically.

【sort】 After sorting the coefficients using numpy's argsort, sort by Pauli.Pauli sort takes precedence.If Pauli is the same, it will be sorted by coefficient.By using the weight kwarg the output can additionally be sorted by the number of non-identity terms in the Pauli, where the set of all Pauli's of a given weight are still ordered lexicographically.

  1. A visual representation of my project so far.

image image

kUmezawa commented 2 years ago

@HuangJunye Sorry, I accidentally removed my assignment. Could you assign me again?

HuangJunye commented 2 years ago

@kUmezawa No problem. Assigned you again :)

daimurat commented 2 years ago

This is our presentation for final showcase.

#20 Implement new features and improve documentation in Operators.pdf .