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

Demo about implementing Shor's algorithm with Catalyst #1010

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
58be460
Outlining Shor x Catalyst demo
Jan 7, 2024
746b48b
fix some formatting
Jan 7, 2024
ca74504
Update first sections of demo
glassnotes Feb 8, 2024
cb22759
Start discussion about JIT compilation
glassnotes Feb 8, 2024
8d870af
Merge branch 'master' into shortalyst
glassnotes Feb 8, 2024
8cba49a
Merge branch 'master' into shortalyst
glassnotes Nov 4, 2024
acff510
Start restructing demo.
glassnotes Nov 4, 2024
b1b2dab
Start explaining circuits and add some diagrams.
glassnotes Nov 6, 2024
f9191f2
Added the bulk of the explanation about the quantum circuits plus ass…
glassnotes Nov 15, 2024
e4f5b71
Fix missing brackets on images. Revert unintended changes to Haar demo
glassnotes Nov 15, 2024
6d8fd85
Merge branch 'master' into shortalyst
glassnotes Dec 2, 2024
acf8625
Fix typo. Shrink width of a few figures.
glassnotes Dec 2, 2024
d100a02
Expand on circuit implementation; new text and many diagrams (almost …
glassnotes Dec 2, 2024
9611e27
Add figures for one-qubit QPE. Update some other figures and text.
glassnotes Dec 5, 2024
328a309
Finish section about circuits, minus minor updates to graphics.
glassnotes Dec 5, 2024
cfaa568
Fix rendering issue
glassnotes Dec 5, 2024
47f97c3
Update many graphics; add meta graphic.
glassnotes Dec 9, 2024
07a3aed
Update demo text in circuit section.
glassnotes Dec 9, 2024
b9054f8
Finish circuits section.
glassnotes Dec 9, 2024
d0e6394
Merge branch 'master' into shortalyst
glassnotes Dec 10, 2024
d0578ac
Update graphics.
glassnotes Dec 11, 2024
ead6894
Update combined graphic
glassnotes Dec 11, 2024
10859d1
Update combined graphic
glassnotes Dec 11, 2024
a329cc8
Start adding code into demo.
glassnotes Dec 16, 2024
f99ca41
Update some figures to remove superfluous QFTs
glassnotes Dec 26, 2024
481fe11
Minor changes to demo text
glassnotes Dec 26, 2024
7f8a0cd
Merge branch 'master' into shortalyst
glassnotes Jan 6, 2025
109f595
Fix error in circuit diagram and description.
glassnotes Jan 6, 2025
6452838
Update description with new optimizations
glassnotes Jan 13, 2025
a6456fd
Finish describing initial controlled bit-wise optimization.
glassnotes Jan 15, 2025
8ff118c
Add additional classical-computed optimization for the doubly-control…
glassnotes Jan 15, 2025
b6bef7b
Fix condition in image
glassnotes Jan 15, 2025
a44625e
Merge branch 'master' into shortalyst
glassnotes Jan 15, 2025
116216b
Merge branch 'master' into shortalyst
glassnotes Jan 29, 2025
8ec784c
Add some code for helpers
glassnotes Jan 29, 2025
704c0c4
Merge branch 'master' into shortalyst
glassnotes Feb 7, 2025
4015a84
Finalizing figures and modifying text
glassnotes Feb 7, 2025
d214fbb
Add updated code
glassnotes Feb 7, 2025
1140530
Run black and remove some comments from the code
glassnotes Feb 7, 2025
18710e0
Add output to demo code so that we can build it.
glassnotes Feb 7, 2025
ed40c18
Update demonstrations/tutorial_shor_catalyst.py
josh146 Feb 7, 2025
cb3d9d1
Add JIT timing
glassnotes Feb 7, 2025
61b7a9e
Merge branch 'shortalyst' of github.com:PennyLaneAI/qml into shortalyst
glassnotes Feb 7, 2025
e294f8a
Add metadata file
glassnotes Feb 7, 2025
09a28a1
Fix plot for full build
glassnotes Feb 8, 2025
08c02cf
Update code for plotting. Start restructuring the introduction about …
glassnotes Feb 10, 2025
a43ae4d
Run black
glassnotes Feb 10, 2025
e5202d4
Intermediate commit while switching computers; more restructuring.
glassnotes Feb 10, 2025
554a8fe
Update main text. Conclusion to come
glassnotes Feb 10, 2025
8b1dcc7
Initial conclusions
glassnotes Feb 10, 2025
4f09930
Update metadata
glassnotes Feb 10, 2025
a90c1ff
First draft!
glassnotes Feb 10, 2025
b07d2d2
Update metadata file
glassnotes Feb 11, 2025
937edb2
Revert unintentional changes to haar demo
glassnotes Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,585 changes: 3,585 additions & 0 deletions _static/demonstration_assets/shor_catalyst/c-ua-basis-states-optimization.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,454 changes: 2,454 additions & 0 deletions _static/demonstration_assets/shor_catalyst/c-ua.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,028 changes: 2,028 additions & 0 deletions _static/demonstration_assets/shor_catalyst/compilation-stack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,627 changes: 2,627 additions & 0 deletions _static/demonstration_assets/shor_catalyst/doubly-controlled-adder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,694 changes: 2,694 additions & 0 deletions _static/demonstration_assets/shor_catalyst/fourier_adder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,029 changes: 2,029 additions & 0 deletions _static/demonstration_assets/shor_catalyst/fourier_adder_adjoint.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,291 changes: 4,291 additions & 0 deletions _static/demonstration_assets/shor_catalyst/fourier_adder_explanation-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,885 changes: 5,885 additions & 0 deletions _static/demonstration_assets/shor_catalyst/fourier_adder_explanation-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,583 changes: 4,583 additions & 0 deletions _static/demonstration_assets/shor_catalyst/fourier_adder_explanation-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,813 changes: 3,813 additions & 0 deletions _static/demonstration_assets/shor_catalyst/fourier_adder_explanation-4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,241 changes: 4,241 additions & 0 deletions _static/demonstration_assets/shor_catalyst/fourier_adder_explanation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,739 changes: 3,739 additions & 0 deletions _static/demonstration_assets/shor_catalyst/fourier_adder_modulo_n.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,003 changes: 3,003 additions & 0 deletions _static/demonstration_assets/shor_catalyst/fourier_adder_modulo_n_mcm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,029 changes: 1,029 additions & 0 deletions _static/demonstration_assets/shor_catalyst/qpe_full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,318 changes: 5,318 additions & 0 deletions _static/demonstration_assets/shor_catalyst/qpe_full_combined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,559 changes: 1,559 additions & 0 deletions _static/demonstration_assets/shor_catalyst/qpe_full_modified_power.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2,250 changes: 2,250 additions & 0 deletions _static/demonstration_assets/shor_catalyst/qpe_full_modified_power_with_qft.svg

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions demonstrations/tutorial_shor_catalyst.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"title": "JIT compiling Shor's algorithm with PennyLane and Catalyst",
"authors": [
{
"username": "glassnotes"
}
],
"dateOfPublication": "2025-03-01T00:00:00+00:00",
"dateOfLastModification": "2025-03-01T00:00:00+00:00",
"categories": [
"Quantum Computing"
],
"tags": [],
"previewImages": [
{
"type": "thumbnail",
"uri": "/_static/demo_thumbnails/regular_demo_thumbnails/thumbnail_variationally_quantum_linear_solver.png"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just grabbed the thumbnail of another demo for now; many we can use a picture of one of the circuits, or a stylized picture of "N = p q" and a circuit?

}
],
"seoDescription": "JIT compile Shor's algorithm from end-to-end with PennyLane and Catalyst.",
"doi": "",
"references": [
{
"id": "Shor1997",
"type": "article",
"title": "Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer",
"authors": "Peter W. Shor",
"year": "1997",
"journal": "SIAM Journal on Computing Vol. 26, Iss. 5",
"doi": "10.1137/S0097539795293172",
"url": "https://doi.org/10.1137/S0097539795293172"
},
{
"id": "PurpleDragonBook",
"type": "book",
"title": "Compilers: Principles, Techniques, And Tools",
"authors": "Alfred V Aho, Monica S Lam, Ravi Sethi, Jeffrey D Ullman",
"year": "2007",
"publisher": "Pearson",
"url": "https://www.pearson.com/en-us/subject-catalog/p/compilers-principles-techniques-and-tools/P200000003472/9780133002140"
},
{
"id": "Beauregard2003",
"type": "article",
"title": "Circuit for Shor's algorithm using 2n+3 qubits",
"authors": "Stephane Beauregard",
"year": "2003",
"journal": "Quantum Info. Comput.",
"doi": "10.5555/2011517.2011525",
"url": "https://dl.acm.org/doi/10.5555/2011517.2011525"
},
{
"id": "Draper2000",
"type": "preprint",
"title": "Addition on a Quantum Computer",
"authors": "Thomas G. Draper",
"year": "2000",
"journal": "",
"doi": "10.48550/arXiv.quant-ph/0008033",
"url": "https://doi.org/10.48550/arXiv.quant-ph/0008033"
}
],
"basedOnPapers": [
],
"referencedByPapers": [],
"relatedContent": [
{
"type": "demonstration",
"id": "tutorial_jax_transformations",
"weight": 1.0
},
{
"type": "demonstration",
"id": "tutorial_qjit_compile_grovers_algorithm_with_catalyst",
"weight": 1.0
},
{
"type": "demonstration",
"id": "tutorial_how_to_quantum_just_in_time_compile_vqe_catalyst",
"weight": 1.0
}
]
}
Loading