Shadows
PR Description
Implement a demo of the classical shadows algorithm.
I was unsure on how to use rebase or pre-commit.
Some notes
-
[x] Please make sure that the notebook runs successfully with the latest Classiq version.
-
[x] Please make sure that you placed the files in an appropriate folder
- [x] And that the file names are clear, descriptive, and match the notebook content.
- [x] Note that we require the file names of
.ipynband.qmodto be unique across this repository.
- [x] Note that we require the file names of
- [x] Plus, please make sure that all required files are included:
.qmod,.synthesis_options.json,.metadata.json - [x] And that images are embedded inside the notebook, not added as external files
- [x] And that the file names are clear, descriptive, and match the notebook content.
-
[x] If applicable, please include link to the paper on which the notebook is based, in the notebook itself.
-
[ ] Please use
rebaseon your branch (no merge commits) -
[x] Please link this PR to the relevant issue
-
[ ] Please make sure to run
pre-commitwhen commiting changes- [ ] If you're using
gitin the terminal, make sure to installpre-commitvia runningpip install pre-commitfollowed bypre-commit install- [ ] More info at the
pre-commitdocumentation
- [ ] More info at the
- [ ] Note that Classiq runs automatic code linting. Meaning that one of the tests verifies the output of
pre-commit. - [ ] Also note that
pre-commitmay minorly alter some files. Make sure togit addthe changes done bypre-commit
- [ ] If you're using
Check out this pull request onΒ ![]()
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
@gzemlevskiy17 are you still working on this?
@TomerGoldfriend Yes, sorry I was working on developing the Classiq challenge for the FLIQ hackathon. I will update this PR soon.
Hi @gzemlevskiy17 ! Still plan to complete this project?
Hi @NadavClassiq. Yes! The project is finished, but I am still figuring out how to adhere to the contributing guidelines. I actually have a few questions:
I ran pre-commit and one test did not pass, specifically:
Auto add test............................................................Failed
- hook id: auto-add-tests
- exit code: 1
Executable `.internal/pre_commit_tools/auto_add_tests.py` is not executable
What should I do about this?
Also, since classical shadows involves applying random unitary gates, the circuit, and thus the quantum model, vary, so I don't know if I should generate a .qmod file as per the guidelines.
Finally, I am unsure of the git workflow I should follow, particularly where rebase comes in.
Hi @gzemlevskiy17!
-
Custom auto tests are not required in the community/paper_implementation_project/, which is where you should first contribute. We might later on move the notebook to a different location, and take care the testing issue.
-
Regarding the qmods, if you can make it work in a reproducible way, using a random seed, that would be great :) Anyway, qmods are required, at least the final one. Whenever you are done, I will take a closer look and, worst case, will give a note.
-
Regarding the GitHub workflow, you don't really need to rebase at the moment, as only you work on these files. Rebase is used to take your branch and add newer changes that were rebased and merged while you were still working.
Lmk if you need further help :)
@NadavClassiq Thank you!
If I am contributing to community/, what would I write for the qmod_type and level tags in the metadata.json file? Also, the paper name is "Predicting Many Properties of a Quantum System from Very Few Measurements", which is very long. Should I use that name for the filenames or is it fine if I named all the files "classical_shadows..."
Hi @gzemlevskiy17 !
You can use a shorter name, just write the full name with a proper link in the notebook.
Regarding the metadata.json, just keep it as it is from the algorithm you have copied it from.
Lmk if you need anything else :)
@NadavClassiq I've pushed my latest changes.
One part of my code uses a list of PauliTerms as a Hamiltonian, but since that has been deprecated as input for ExecutionSession.estimate(), it generates a warning. I decided to keep it, because another part of my code uses hamiltonian_to_matrix(), which needs a PauliTerm.
Great Job @gzemlevskiy17 !
I'll be reviewing it soon, maybe with feedback and suggestions for improvement.
Thanks for the efforts!
@gzemlevskiy17 any updates on this?
@TomerGoldfriend Thank you for the suggestions! Sorry for the delay, I have had a busy start to the semester. I will be working on it this weekend.
@TomerGoldfriend I replied to some of your comments on ReviewNB, could you please take a look?
@TomerGoldfriend I replied to some of your comments on ReviewNB, could you please take a look?
Sure @gzemlevskiy17 , thanks for the update.
@TomerGoldfriend Were you able to take a look at my questions? If not, please advise how to proceed, thanks!
@TomerGoldfriend Were you able to take a look at my questions? If not, please advise how to proceed, thanks!
@gzemlevskiy17 not yet, I will review until the end of this week.
@gzemlevskiy17 I think I answered all your questions, please let me know if otherwise.
π₯ New notebook just dropped!
@amir-naveh , @TomerGoldfriend β come check out this shiny new addition to our repo.
@TomerGoldfriend I believe I fixed addressed all of your comments, could you please take a look?
@TomerGoldfriend I believe I fixed addressed all of your comments, could you please take a look?
Great @gzemlevskiy17 ! I will review.
@gzemlevskiy17 any updates on this?
@TomerGoldfriend I've increased the number of snapshots to 200, which yields a better result but has a longer runtime (~8 minutes).
@TomerGoldfriend I've increased the number of snapshots to 200, which yields a better result but has a longer runtime (~8 minutes).
@gzemlevskiy17 so all is good? did you go over all my recent comments (which I sent before your last commit).