Skip to content

Add Q-matrix preprocessing permutation#33

Open
bernalde wants to merge 2 commits into
mainfrom
fix/issue-12-q-matrix-permutation
Open

Add Q-matrix preprocessing permutation#33
bernalde wants to merge 2 commits into
mainfrom
fix/issue-12-q-matrix-permutation

Conversation

@bernalde
Copy link
Copy Markdown
Member

@bernalde bernalde commented May 15, 2026

Summary

  • Add deterministic Q-matrix preprocessing that uses a reverse Cuthill-McKee-style ordering to place coupled variables closer in the MPS tensor order.
  • Preserve caller-facing variable order by unpermuting Solution samples and probability checks.
  • Wire the existing preprocess optimizer attribute through the QUBODrivers/JuMP solve path.
  • Add an exact one-variable solve path for reduced QUBOs where ITensor DMRG is not applicable.

Tests run

  • julia +1.12 --project=. -e 'using Pkg; Pkg.test()' - passed.
  • julia +1.12 --project=docs/ docs/make.jl - passed.
  • julia +1.10 -e 'import Pkg; Pkg.activate(; temp=true); Pkg.develop(path=pwd()); Pkg.test("TenSolver"; coverage=true, julia_args=["--check-bounds=yes", "--compiled-modules=yes", "--depwarn=yes"], force_latest_compatible_version=false, allow_reresolve=true)' - passed.

Notes about tests not run

  • julia --project=. -e 'using Pkg; Pkg.test()' was attempted first, but the default local Julia is 1.11.5 while the checked-out manifest was resolved with Julia 1.12.6, causing Pkg to fail before package code loaded with a missing OpenSSL_jll source error. The suite was rerun successfully with julia +1.12.
  • julia +1.10 --project=. -e 'import Pkg; Pkg.test(; coverage=true, julia_args=["--check-bounds=yes", "--compiled-modules=yes", "--depwarn=yes"], force_latest_compatible_version=false, allow_reresolve=true)' hit the same local manifest mismatch. The Julia 1.10 test was rerun from a temporary environment that develops this checkout, matching CI's resolved QUBODrivers v0.3.4 path without mutating tracked manifests.

Closes #12

Copy link
Copy Markdown
Member Author

@bernalde bernalde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found. I inspected the PR diff, surrounding solver/Solution/JuMP code, tests, docs, README, and CI workflows. The implementation keeps caller-facing bit order stable while using the permuted tensor order internally, and the one-variable fallback is consistent with the existing API surface.
Tests run locally:

  • julia +1.12 --project=. -e 'using Pkg; Pkg.test()' passed.
  • julia +1.12 --project=docs/ docs/make.jl passed.
  • julia +1.12 --project=test -e 'push!(LOAD_PATH, pwd()); using Test, TenSolver, JuMP, LinearAlgebra; ...' targeted preprocessing/JuMP/one-variable smoke passed.

@bernalde bernalde requested a review from iagoleal May 15, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preprocessing: Implement Q-matrix permutation

1 participant