Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert the code to an installable package qpt-pls #2

Open
quantshah opened this issue Aug 27, 2021 · 7 comments
Open

Convert the code to an installable package qpt-pls #2

quantshah opened this issue Aug 27, 2021 · 7 comments

Comments

@quantshah
Copy link

I accidentally created PR #1 when I meant to open a discussion.

@Hannoskaj Thank you for this nice code and implementation of the algorithm. I am one of the developers of the qutip project (qutip.org) and I am interested in using your implementation of quantum process tomography.

I have been working with state tomography and have recently started exploring quantum process tomography.

I wanted to standardise the code a little bit more into a python package that can be eventually installed as simply as pip install qpt-pls or python setup.py install and used easily by others as a normal python package. I am going to develop the code a bit more in a fork of your repository under (https://github.com/quantshah/qpt-pls).

I have been publishing all my code as installable python packages (e.g. qst-cgan, piqs). I would be happy to help develop this into a python package and benchmark against other process tomography methods such as CPTPprojection.

@Hannoskaj
Copy link
Owner

Thank you! It will probably be more convenient!

(By the way, yout link to your notebook on state tomography failed with 404 for me).

@quantshah
Copy link
Author

quantshah commented Aug 27, 2021 via email

@quantshah
Copy link
Author

Hi, I am making a QuTiP tutorial using your code for the minimum HIP implementation:

Please let me know if I need to cite your original code and paper better or if you have any other suggestions. The PR is here:

https://github.com/qutip/qutip-notebooks/blob/710baa7d6fc6c679b4a06bc7695de9538c0ccdd0/examples/tomography-process-tomo-pls.ipynb

@quantshah
Copy link
Author

If you are active on Twitter then please check out : https://twitter.com/quantshah/status/1448681993277952005

Thanks

@Hannoskaj
Copy link
Owner

I am not on Twitter :)

Thank you for your work on the tutorial!

If you need help to understand any point, you can write me (I think my mail address should at least be in the article).
What benchmarks do you want to try (yes, I can read Twitter :))?

A few comments on the state of your notebook:

  • You have left a SS (my scipy.stats) in the function sampling [68]
  • I see you have completely removed the conditions to stop the loops when we have converged. You could erase
    the flat line at the end of your last figure, if you wanted…
    I guess it's because you did not want to use final_CPTP_by_mixing ?
  • [70] From your commented part (with batch_size), you had a misunderstanding on what Choi_LS_Pauli does.
    In the code, we are drawing the random number of times each input-measurement result appears; this allows to simulate all the repetitions and take the LS estimator at a speed that is independent on the number of measurements. We are not summing the LS estimators for each measurement. We could, but that's not efficient.

By the way, do you want a better version of proj_CP_threshold? I realised toward the end of the writing of the article that I could change it so that I would always be in the good regime (the bottom line in Figure 6). It was late to redo the experiments, and I will add it in the article on the algorithm itself, but I can already update the repository here if you want.

@quantshah
Copy link
Author

quantshah commented Oct 15, 2021

Hi @Hannoskaj thank you so much for your comments. I will try to incorporate them in the notebook. Do you mind continuing the discussion about the tutorial on the PR in QuTiP (qutip/qutip-notebooks#133) ? This way you can also be part of the review process which would be very helpful. I want to add your contact and name to the notebook as well if that is alright. After all it is your code.

  • I will remove the SS and replace it with stats.
  • I wanted to see how many iterations it took to converge but I will use the final_CPTP_by_mixing code to terminate the iterations in the update.
  • For the rewriting of Choi_LS_Pauli, my intention was to do a benchmark on a random subset of the total number of input-output measurement settings. I have noticed that even if we do not sample all Pauli configurations, it is possible to get the correct Choi matrix. Therefore, I wanted to sort of make an "online" prediction that works with whatever subset of the data you provide and improves as you get more data.

I definitely would be happy to incorporate a better version of proj_CP_threshold if you want to share. Please do.

@quantshah
Copy link
Author

Dear @Hannoskaj I updated the qutip notebook for a demonstration of your HIP switch algorithm here: https://github.com/qutip/qutip-notebooks/blob/241f77edd9f3f821da715959d5ee1c6eaada7f78/examples/tomography-process-tomo-pls.ipynb

Would you be willing to review the code and PR: qutip/qutip-notebooks#133

It is a self-contained demonstration of your paper with the code from here. I could not for some reason get the HIP switch to work for a 5 qubit QFT process reconstruction. I am going to use your code for some more benchmarks on a current project of mine and it would be great if I get some feedback on whether I used the full power of your algorithm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants