Summary
minimize and maximize throw on single-variable (1x1) QUBO inputs because the underlying ITensor DMRG solver does not support system sizes of 1.
Reproduction
On main (Julia 1.10):
using TenSolver
minimize(reshape([-2.0], 1, 1))
Result:
ERROR: `dmrg` currently does not support system sizes of 1. You can diagonalize
the MPO tensor directly with tools like `LinearAlgebra.eigen`, `KrylovKit.eigsolve`, etc.
Expected behavior
A one-variable QUBO is trivial to solve exactly: evaluate the objective at x = 0 and x = 1 and return the minimizer (or report degeneracy when the two are equal). minimize/maximize should return the correct energy and a Solution consistent with the multi-variable path, rather than crashing.
Notes
This edge case currently has ad hoc, slightly divergent fixes duplicated across several open PRs (#32, #33, #34, #41). It should be fixed once, on its own, so the other PRs can drop their copies and avoid merge conflicts.
Summary
minimizeandmaximizethrow on single-variable (1x1) QUBO inputs because the underlying ITensor DMRG solver does not support system sizes of 1.Reproduction
On
main(Julia 1.10):Result:
Expected behavior
A one-variable QUBO is trivial to solve exactly: evaluate the objective at
x = 0andx = 1and return the minimizer (or report degeneracy when the two are equal).minimize/maximizeshould return the correct energy and aSolutionconsistent with the multi-variable path, rather than crashing.Notes
This edge case currently has ad hoc, slightly divergent fixes duplicated across several open PRs (#32, #33, #34, #41). It should be fixed once, on its own, so the other PRs can drop their copies and avoid merge conflicts.