Add JuMP PEPS backend attributes#45
Conversation
cb9598f to
ca890fc
Compare
078e097 to
873f02b
Compare
873f02b to
ab04073
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/issue-38-spinglasspeps-backend #45 +/- ##
==========================================================================
+ Coverage 72.84% 73.44% +0.60%
==========================================================================
Files 6 6
Lines 475 546 +71
==========================================================================
+ Hits 346 401 +55
- Misses 129 145 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bernalde
left a comment
There was a problem hiding this comment.
GitHub rejected REQUEST_CHANGES because the authenticated account owns this pull request. The blocking comment below is blocking from a maintainer review perspective. I would not merge this until the blocking issue above is addressed.
Blocking issue found: the JuMP-facing PEPS backend selection is public, but the optional SpinGlass component stack still does not resolve with TenSolver and the actual PEPS optimizer success path is skipped in CI. I would not merge this until the blocking issue above is addressed.
Tests run locally:
- git diff --check origin/feature/issue-38-spinglasspeps-backend...HEAD
- julia --project=. -e "using Pkg; Pkg.instantiate()"
- julia --project=test -e "using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()"
- julia --project=test -e "using Test, Random, LinearAlgebra, TenSolver; include("test/utils.jl"); include("test/jump.jl")"
- julia --project=. -e "using Pkg; Pkg.test()"
- julia --project=docs/ -e "using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()"
- julia --project=docs/ docs/make.jl local
- julia --project=/tmp/tensolver-pr45-opt -e "using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.add(["SpinGlassNetworks", "SpinGlassEngine", "SpinGlassTensors"])" failed with the known Parsers/CSV/InlineStrings resolver conflict
- local fake-PEPS JuMP integration probe passed, showing the missing success-path test can be covered without optional packages
| function _optimizer_backend(get) | ||
| backend = _optimizer_symbol(get("backend"), "backend") | ||
| backend === :dmrg && return :dmrg | ||
| backend === :peps && return _optimizer_peps_backend(get) |
There was a problem hiding this comment.
Blocking: This exposes backend = :peps through the JuMP optimizer, but the optional SpinGlass component stack still cannot be installed together with TenSolver and CI skips the only real PEPS optimizer solve when those packages are absent. I reproduced the resolver failure in a fresh environment: adding SpinGlassNetworks, SpinGlassEngine, and SpinGlassTensors conflicts through SpinGlassNetworks -> CSV/Parsers and TenSolver/QUBOTools -> InlineStrings/Parsers. That leaves this new public attribute path without a runnable registered install path or CI coverage of the success branch. Please either keep the PEPS JuMP attributes and public docs internal until the optional stack resolves, or fix the dependency/compat strategy and add CI coverage. At minimum, add a fake-extension integration test that defines TenSolver._solve_ising(::PEPSBackend, ...) and drives JuMP.optimize! through this branch so the SampleSet and metadata path is covered without the optional packages.
There was a problem hiding this comment.
Addressed in f674a37: added a fake AbstractStructuredTopology JuMP test that drives backend = :peps through JuMP.optimize!, then checks objective/primal values plus QUBOTools solution metadata and reads in test/jump.jl. The optional real SpinGlass install path remains a follow-up once that dependency stack resolves.
|
|
||
| samples = Vector{QUBOTools.Sample{T,Int}}(undef, num_reads) | ||
| for i in 1:num_reads | ||
| x = states[mod1(i, length(states))] |
There was a problem hiding this comment.
Nonblocking: This cycles retained PEPS states evenly and ignores psi.probabilities, while sample(::PEPSSolution) samples by those weights and num_reads is exposed as a sampling count. The resulting SampleSet read counts can misrepresent the PEPS distribution for downstream QUBOTools consumers. Consider generating samples with sample(psi) for num_reads, or converting probabilities into reads counts while preserving the full retained-state data under metadata[\"peps\"].
There was a problem hiding this comment.
Addressed in f674a37: _qubo_samples(::PEPSSolution, ...) now maps psi.probabilities to deterministic QUBOTools reads counts instead of cycling states. test/jump.jl covers the weighted read counts.
|
Pushed commit:
Main changes:
Tests run:
Comments intentionally not addressed:
Remaining risks/follow-up:
|
bernalde
left a comment
There was a problem hiding this comment.
Final focused review of f674a37: no blocking or nonblocking issues found.
GitHub would not let this account submit APPROVE because it owns the pull request: "Review Can not approve your own pull request".
The new fake PEPS JuMP integration test now exercises backend = :peps through JuMP.optimize!, validates objective/primal values, and checks QUBOTools metadata/read counts without requiring the unresolved optional SpinGlass package stack. The PEPS SampleSet adaptation now derives deterministic read counts from psi.probabilities instead of cycling states evenly.
Evidence inspected:
- Current PR head is f674a37.
- GitHub checks are green for Julia lts/1/pre across Ubuntu, Windows, and macOS.
- Documentation build and documenter/deploy are green.
- Local focused tests already run on this head:
git diff --check f72bb06..f674a37, focusedtest/jump.jlon Julia 1.11.5 and Julia 1.12.6, and a targeted_peps_read_countsprobe; all passed, with the expected broken optional SpinGlass solve.
Merge recommendation: merge-ready from this focused review pass. The real SpinGlassPEPS dependency resolver issue remains an external follow-up before relying on the real optional backend in CI.
Summary
:dmrg/"dmrg"selection.PEPSBackend, adaptsPEPSSolutionstates into QUBOTools samples, and attaches PEPS metadata to the returned SampleSet.Tests run
julia +1.12 --project=. -e 'using Pkg; Pkg.test()'- passed. The optional SpinGlassPEPS extension solve is reported as a skipped/broken test when SpinGlass component packages are not installed.julia --project=docs/ docs/make.jl local- passed.git diff --check- passed.Notes
include("test/jump.jl")run under the root package project is not a valid targeted command because JuMP is a test-only dependency in this repository; the JuMP coverage was run throughPkg.test().Closes #39