Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
🔥 New notebook just dropped! @amir-naveh , @TomerGoldfriend — come check out this shiny new addition to our repo. |
| @@ -0,0 +1,1338 @@ | |||
| { | |||
There was a problem hiding this comment.
Note that the relation between the old (list of Pauli) and new (SparsePauliOp) is actually: Pauli.Z(0) * Pauli.Z(1) ---> [Pauli.I,Pauli.I,Pauli.I,Pauli.Z, Pauli.Z]. I am not sure it is worth to mention this, since it might be too confusing. So as long you are not mentioning the old list of Pauli, I think it is fine not to add such a comment. Just for your information.
Reply via ReviewNB
| @@ -0,0 +1,1338 @@ | |||
| { | |||
There was a problem hiding this comment.
I believe it will be too much to change your code, but just a suggestion for the future.
You can work with QubitOperator from openfermion, they have all the arithmetic (including commutators and norms). Then you can use from classiq.applications.chemistry.op_utils import qubit_op_to_pauli_terms to map the QubitOperator to SparsePauliOp.
Reply via ReviewNB
| @@ -0,0 +1,1338 @@ | |||
| { | |||
There was a problem hiding this comment.
tests/resources/timeouts.yaml
Outdated
| U.qmod: 10 | ||
| WS_iQuHack_2025_final.ipynb: 200 | ||
| X.qmod: 10 | ||
| adaptive_qaoa_lib.ipynb: 20 |
There was a problem hiding this comment.
Increase the number here with 1.5 or 2 factor of the actual time you observe locally.
| # test quantum programs | ||
| validate_quantum_program_size( | ||
| tb.ref_pydantic("qprog"), | ||
| expected_width=None, |
There was a problem hiding this comment.
You can have a look at other file tests and see what to fill in. For example, test_shor.py.
In particular, the # test notebook content is optional, but it can be very useful to verify the functional result of the notebook.
If you did not generate a qmod python variable in the notebook then remove validate_quantum_model(tb.ref("qmod")).
For the validate_quantum_program_size please add numbers with some buffer compared to what you actually see.
|
🌟 Fantastic work @hnnq! Your very first PR to classiq-library has been merged! 🎉🥳 If you're feeling adventurous, why not dive into another issue and keep contributing? The Classiq community would love to see more from you! 🚀 Happy coding! 👩💻👨💻 |
PR Description
implementation of the Adaptive QAOA paper
the notebook solves a simple Hamiltonian using both "vanilla" and adaptive QAOA
Please make sure that the notebook runs successfully with the latest Classiq version.
Please make sure that you placed the files in an appropriate folder
.ipynband.qmodto be unique across this repository..qmod,.synthesis_options.json,.metadata.jsonIf 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)Please link this PR to the relevant issue
Please make sure to run
pre-commitwhen commiting changesgitin the terminal, make sure to installpre-commitvia runningpip install pre-commitfollowed bypre-commit installpre-commitdocumentationpre-commit.pre-commitmay minorly alter some files. Make sure togit addthe changes done bypre-commit