Skip to content

Commit f5ec839

Browse files
glassnotesOlivia Di Matteojosh146dime10justinpickering
authored
Demo about implementing Shor's algorithm with Catalyst (#1010)
**Title:** JIT compiling Shor's algorithm with PennyLane and Catalyst **Summary:** Over the past year, PennyLane has been integrated with Catalyst, allowing for quantum just-in-time compilation of classical and quantum code together. This demo leverages that integration to implement a version of Shor's factoring algorithm that is just-in-time compiled from end-to-end, classical control structure and all. **Relevant references:** See within **Possible Drawbacks:** As it stands, it's quite long (especially for the amount of actual output); I am not sure about the ending. **Related GitHub Issues:** N/A ---- If you are writing a demonstration, please answer these questions to facilitate the marketing process. * GOALS — Why are we working on this now? Highlight PennyLane and Catalyst integration, and expose challenges (and opportunities) in scaling up quantum compilation pipelines. * AUDIENCE — Who is this for? Primarily people researchers and developers focused on quantum compilation. * KEYWORDS — What words should be included in the marketing post? quantum compilation; quantum circuits; quantum algorithms; Shor's algorithm * Which of the following types of documentation is most similar to your file? (more details [here](https://www.notion.so/xanaduai/Different-kinds-of-documentation-69200645fe59442991c71f9e7d8a77f8)) - [ ] Tutorial - [X] Demo - [ ] How-to [sc-75726] --------- Co-authored-by: Olivia Di Matteo <[email protected]> Co-authored-by: Josh Izaac <[email protected]> Co-authored-by: David Ittah <[email protected]> Co-authored-by: justinpickering <[email protected]> Co-authored-by: Justin Pickering <[email protected]> Co-authored-by: Alvaro Ballon <[email protected]>
1 parent 39545bc commit f5ec839

34 files changed

+87389
-0
lines changed

_static/demonstration_assets/shor_catalyst/c-ua-basis-states-optimization.svg

+3,618
Loading

_static/demonstration_assets/shor_catalyst/c-ua.svg

+2,512
Loading

_static/demonstration_assets/shor_catalyst/compilation-stack.svg

+2,052
Loading
Loading

_static/demonstration_assets/shor_catalyst/doubly-controlled-adder-simplified-states.svg

+3,037
Loading

_static/demonstration_assets/shor_catalyst/doubly-controlled-adder-simplified.svg

+2,716
Loading

_static/demonstration_assets/shor_catalyst/doubly-controlled-adder-with-control-not-on-qft.svg

+2,839
Loading

_static/demonstration_assets/shor_catalyst/doubly-controlled-adder-with-control.svg

+2,775
Loading

_static/demonstration_assets/shor_catalyst/doubly-controlled-adder.svg

+2,627
Loading

_static/demonstration_assets/shor_catalyst/fourier_adder.svg

+2,694
Loading

_static/demonstration_assets/shor_catalyst/fourier_adder_adjoint.svg

+2,058
Loading

_static/demonstration_assets/shor_catalyst/fourier_adder_explanation-1.svg

+4,291
Loading

_static/demonstration_assets/shor_catalyst/fourier_adder_explanation-2.svg

+5,885
Loading

_static/demonstration_assets/shor_catalyst/fourier_adder_explanation-3.svg

+4,583
Loading

_static/demonstration_assets/shor_catalyst/fourier_adder_explanation-4.svg

+3,813
Loading

_static/demonstration_assets/shor_catalyst/fourier_adder_explanation.svg

+4,241
Loading

_static/demonstration_assets/shor_catalyst/fourier_adder_modulo_n.svg

+3,798
Loading

_static/demonstration_assets/shor_catalyst/fourier_adder_modulo_n_streamlined.svg

+3,951
Loading

_static/demonstration_assets/shor_catalyst/qpe_full.svg

+1,029
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_combined.svg

+5,318
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_combined_multi_est_wires.svg

+3,577
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_modified_power.svg

+1,559
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_modified_power_with_qft-2.svg

+2,306
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_modified_power_with_qft-3.svg

+2,352
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_modified_power_with_qft-4.svg

+2,360
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_modified_power_with_qft-5.svg

+2,522
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_modified_power_with_qft-6.svg

+2,685
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_modified_power_with_qft-7.svg

+2,407
Loading

_static/demonstration_assets/shor_catalyst/qpe_full_modified_power_with_qft.svg

+2,250
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"title": "Quantum just-in-time compiling Shor's algorithm with Catalyst",
3+
"authors": [
4+
{
5+
"username": "glassnotes"
6+
}
7+
],
8+
"dateOfPublication": "2025-04-04T09:00:00+00:00",
9+
"dateOfLastModification": "2025-04-04T09:00:00+00:00",
10+
"categories": [
11+
"Algorithms",
12+
"Quantum Computing",
13+
"Devices and Performance"
14+
],
15+
"tags": [],
16+
"previewImages": [
17+
{
18+
"type": "thumbnail",
19+
"uri": "/_static/demo_thumbnails/regular_demo_thumbnails/thumbnail_shor_algorithm_catalyst_pennylane.png"
20+
},
21+
{
22+
"type": "large_thumbnail",
23+
"uri": "/_static/demo_thumbnails/large_demo_thumbnails/thumbnail_large_shor_algorithm_catalyst_pennylane.png"
24+
}
25+
],
26+
"seoDescription": "Just-in-time compile Shor's algorithm from end-to-end with PennyLane and Catalyst.",
27+
"doi": "",
28+
"references": [
29+
{
30+
"id": "Shor1997",
31+
"type": "article",
32+
"title": "Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer",
33+
"authors": "Peter W. Shor",
34+
"year": "1997",
35+
"journal": "SIAM Journal on Computing Vol. 26, Iss. 5",
36+
"doi": "10.1137/S0097539795293172",
37+
"url": "https://doi.org/10.1137/S0097539795293172"
38+
},
39+
{
40+
"id": "PurpleDragonBook",
41+
"type": "book",
42+
"title": "Compilers: Principles, Techniques, And Tools",
43+
"authors": "Alfred V Aho, Monica S Lam, Ravi Sethi, Jeffrey D Ullman",
44+
"year": "2007",
45+
"publisher": "Pearson",
46+
"url": "https://www.pearson.com/en-us/subject-catalog/p/compilers-principles-techniques-and-tools/P200000003472/9780133002140"
47+
},
48+
{
49+
"id": "JAXJIT",
50+
"type": "webpage",
51+
"title": "Just-in-time compilation",
52+
"authors": "The JAX Authors",
53+
"year": "2024",
54+
"publisher": "",
55+
"url": "https://docs.jax.dev/en/latest/jit-compilation.html"
56+
},
57+
{
58+
"id": "Beauregard2003",
59+
"type": "article",
60+
"title": "Circuit for Shor's algorithm using 2n+3 qubits",
61+
"authors": "Stephane Beauregard",
62+
"year": "2003",
63+
"journal": "Quantum Info. Comput.",
64+
"doi": "10.5555/2011517.2011525",
65+
"url": "https://dl.acm.org/doi/10.5555/2011517.2011525"
66+
},
67+
{
68+
"id": "Draper2000",
69+
"type": "preprint",
70+
"title": "Addition on a Quantum Computer",
71+
"authors": "Thomas G. Draper",
72+
"year": "2000",
73+
"journal": "",
74+
"doi": "10.48550/arXiv.quant-ph/0008033",
75+
"url": "https://doi.org/10.48550/arXiv.quant-ph/0008033"
76+
}
77+
],
78+
"basedOnPapers": [
79+
],
80+
"referencedByPapers": [],
81+
"relatedContent": [
82+
{
83+
"type": "demonstration",
84+
"id": "tutorial_jax_transformations",
85+
"weight": 1.0
86+
},
87+
{
88+
"type": "demonstration",
89+
"id": "tutorial_qjit_compile_grovers_algorithm_with_catalyst",
90+
"weight": 1.0
91+
},
92+
{
93+
"type": "demonstration",
94+
"id": "tutorial_how_to_quantum_just_in_time_compile_vqe_catalyst",
95+
"weight": 1.0
96+
}
97+
]
98+
}

0 commit comments

Comments
 (0)