Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #90 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 4 13 +9
Lines 660 998 +338
==========================================
+ Hits 660 998 +338
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
shangtai
left a comment
There was a problem hiding this comment.
Thanks for the PR.
I have left some comments especially for the documentations part.
| 1. Prepare the weighted Dicke superposition | ||
| :math:`\sum_{k=0}^{\ell} w_k \ket{D^m_k}` on the error register, where | ||
| :math:`w` is the principal eigenvector of the tridiagonal matrix | ||
| :math:`A^{(m, \ell, 0)}` of paper Eq. 70. |
There was a problem hiding this comment.
| :math:`A^{(m, \ell, 0)}` of paper Eq. 70. | |
| :math:`A^{(m, \ell, 0)}` of Eq. 70 in the paper. |
| decoder-success branches. | ||
| 5. Apply :math:`H^{\otimes n}` on the solution register. | ||
| 6. Measure both registers; **post-select** shots whose error register | ||
| reads :math:`\ket{0^m}` (paper Fig. 4 caption: "postselect on |
There was a problem hiding this comment.
should we mention Fig. 4, or section 10.3 on Imperfect decoding?
| diagnostics. | ||
|
|
||
| **Where DQI helps.** DQI gives a provable polynomial speedup on the Optimal | ||
| Polynomial Intersection (OPI) family (Section 6 of arXiv:2408.08292) and |
There was a problem hiding this comment.
should we include a link to the paper here?
|
|
||
| **Phase 1 scope.** Currently implemented: :class:`MaxXORSAT` problem class, | ||
| optimal weight vector, weighted Dicke-state preparation, DQI circuit, the | ||
| brute-force lookup-table decoder, and end-to-end :class:`DQISolver`. |
There was a problem hiding this comment.
| brute-force lookup-table decoder, and end-to-end :class:`DQISolver`. | |
| brute-force lookup-table (LUT) decoder, and end-to-end :class:`DQISolver`. |
| - Practical only for ``m + n <= 16`` on a state-vector simulator. | ||
| - The brute-force amplitude-encoded Dicke prep materialises a dense | ||
| :math:`2^m \times 2^m` unitary and is hard-capped at ``m = 12``. | ||
| Replacing this with a count-register + Bartschi-Eidenbenz construction |
There was a problem hiding this comment.
should we include a reference here?
There was a problem hiding this comment.
Do you think we can simplify the code using qibo.models.encodings.dicke_state?
|
|
||
| .. math:: | ||
|
|
||
| A_{k, k+1} = A_{k+1, k} = \sqrt{(k + 1)(m - k)}, |
There was a problem hiding this comment.
our convention is slightly different from the paper, our k+1 is their k. Should we leave a remark?
|
|
||
|
|
||
| def test_lut_is_exact_false_when_collisions(): | ||
| """The reviewer's example: m=3, n=2, ell=2 with B=[[1,0],[0,1],[1,1]] |
There was a problem hiding this comment.
| """The reviewer's example: m=3, n=2, ell=2 with B=[[1,0],[0,1],[1,1]] | |
| """For this test, m=3, n=2, ell=2 with B=[[1,0],[0,1],[1,1]] |
| """DQI's post-selected output puts more weight on the brute-force optimum | ||
| than uniform sampling would. | ||
|
|
||
| The original buggy implementation passed a "best of N shots" test |
There was a problem hiding this comment.
Are these comments from debugging?
|
|
||
|
|
||
| def test_colliding_lut_marks_inexact(): | ||
| """Reviewer's example: m=3, n=2, ell=2, B=[[1,0],[0,1],[1,1]] has 7 |
There was a problem hiding this comment.
comment from interacting with Reviewer agent?
Summary
Adds a Phase 1 implementation of Decoded Quantum Interferometry (DQI), the non-variational quantum optimisation algorithm of Jordan et al., Optimization by Decoded Quantum Interferometry, arXiv:2408.08292 (v5), Nature 646:831–836 (2025).
DQI takes a max-LIN / max-XOR-SAT instance over GF(2) and produces samples concentrated on near-optimal solutions. This is a fundamentally different paradigm from the QAOA/XQAOA path that the rest of
qibooptis built on, so it lives in a siblingsrc/qiboopt/dqi/module rather than as a method onQUBO.What's added
New package
src/qiboopt/dqi/with:MaxXORSAT(max_xorsat.py) — problem class wrapping(B, s)with helpers for evaluating Hamming distance to the target.optimal_weights(weights.py) — principal eigenvector of the tridiagonal matrix from Theorem 3.4 / Eq. 70 of the paper.weighted_dicke_amplitudes/dicke_circuit(dicke.py) — brute-force amplitude-encoded weighted Dicke superposition on the error register.dqi_circuit(circuit.py) — fullm + nqubit DQI circuit following §8.1.2: weighted Dicke prep →Z^{s_i}phasing → CNOT network forB^T y→ in-circuit syndrome decoder → Hadamard transform on the solution register.SyndromeDecoder/LUTDecoder/get_decoder(decoders/) — pluggable decoder API, with a brute-force lookup-table decoder as the Phase 1 implementation.DQISolver(solver.py) — end-to-end solver with error-register post-selection on|0^m⟩, plusis_dqi_exactanddecoder_success_probabilitydiagnostics that make LUT-collision behaviour observable.doc/source/api-reference/dqi.rst, registered in the API index.scipy ^1.13added as a direct dependency (used by the tridiagonal eigenproblem inweights.py).qiboopt.dqire-exported from the top-level package.Tests added for circuit construction, decoders, Dicke prep,
MaxXORSAT, the weight vector, and end-to-end solver behaviour.Phase 1 limitations (called out in the docs)
m + n ≤ 16on a state-vector simulator.2^m × 2^munitary and is hard-capped atm = 12. Replacing this with a count-register + Bärtschi–Eidenbenz construction is left to a future phase.solve_dqientry point onQUBO; most QUBOs are not faithfully expressible as max-LIN, and we don't want to imply a generic-dense speedup.Out of scope for this PR