Add Harrow-Hassidim-Lloyd (HHL) algorithm#177
Conversation
|
Hi @axif0, thanks for the contribution here as well. Mentioned in the other PR - updating from main should fix the readthedocs issue, but you likely need to run |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #177 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 32 34 +2
Lines 1358 1535 +177
Branches 174 200 +26
==========================================
+ Hits 1358 1535 +177 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| @@ -0,0 +1,7 @@ | |||
| The Harrow-Hassidim-Lloyd (HHL) algorithm is a quantum algorithm for solving systems of linear equations of the form Ax = b. Given an N×N Hermitian matrix A and a unit vector b, the algorithm produces a quantum state |x⟩ whose amplitudes encode the solution vector x = A⁻¹b. The HHL algorithm is one of the fundamental quantum algorithms expected to provide an exponential speedup over classical methods: for sparse, well-conditioned matrices, HHL runs in O(log(N) κ²) time versus O(Nκ) classically, where κ is the condition number of A. Applications include machine learning, computational finance, solving differential equations, and quantum chemistry. | |||
There was a problem hiding this comment.
Maybe would tone down the comment about exponential speedup - I think for HHL it definitely depends on the state preparation, as well as readout.
There was a problem hiding this comment.
Thanks for the update, Can you add the same caveat to the intro of the notebook as well? The place where you mentioned " It can provide an exponential speedup over classical methods for certain classes of problems." without the same caveat.
…component explanations, and fix unicode characters.
|
@sesmart, @yitchen-tim hello, Is there anything else for improvement? |
…rics and success probabilities within the example notebook.
|
I replaced the opaque Also ~
|
…iles and remove blank lines from `test_hhl.py`.
|
Updated and cleaned up a small local lint warning where Is there anything else to be done? |
|
@sesmart thank you so much for the marge. And for the conversation. |
Issue #, if available:
#1194
Description of changes:
Added HHL algorithm implementation and a demonstration notebook. This includes the circuit construction logic, result processing, and examples solving 2x2 linear systems with fidelity checks against classical solutions.
Testing done:
Validated on LocalSimulator with high fidelity results in the provided notebook.
Merge Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.