Repository navigation
SPDSolver: continuous correlated solver for p-bit / Ising models. - #138
Merged
Merged
Conversation
The solver maps the discrete Ising parameters (J, h) to a symmetric positive-definite (SPD) representation before sampling. The SPD structure provides a valid continuous correlated state space, allowing proposals to be generated collectively rather than by updating p-bits independently. And tests.
gcattan
reviewed
Sep 16, 2026
gcattan
left a comment
Collaborator
There was a problem hiding this comment.
I trust you on the math.
A couple of things regarding the architectural contract.
| return eigenvectors @ (np.sqrt(eigenvalues) * z) | ||
|
|
||
|
|
||
| class SPDSolver: |
Collaborator
There was a problem hiding this comment.
This should inherite from Solver and keep Backend/Solver separation.
| raise TypeError(f"{name}.solve(circuit) must return an (I, m) tuple") | ||
| return out[0], out[1] | ||
|
|
||
| def solve(self, circuit): |
Collaborator
There was a problem hiding this comment.
annealing function is not supported.
| self.energies_ = all_E | ||
| self.acceptance_rate_ = accepted / self.Nt | ||
| self.final_distance_ = riem_dist(X, target) | ||
| return all_I, all_m |
Collaborator
There was a problem hiding this comment.
Only when return_filtered. If not, then the return should be I, m, E
Improved based on review and added diagnostic switch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SPDSolver: continuous correlated solver for p-bit / Ising models.
This is the first continous solver in p-kit.
The solver maps the discrete Ising parameters (J, h) to a symmetric positive-definite (SPD) representation before sampling. The SPD structure provides a valid continuous correlated state space, allowing proposals to be generated collectively rather than by updating p-bits independently.
A continuous solver may provide better results, but the problem must first be mapped successfully to a continuous space. This is the first and main obstacle. Therefore, the J,h -> SPD mapping is validated before use. If the mapping quality is below the configured threshold, SPDSolver can fall back to another solver. Use fall_back_solver= in this case.
SPDSolver is particularly useful for correlated sampling, optimization, and future analog implementations where continuous SPD dynamics may be implemented directly into hardware.
For problems requiring very accurate sampling of the target Boltzmann distribution, especially as problem size grows, GibbsSolver may still provide better distribution fidelity.
And tests.