Add output objective semantics to Instance and ParametricInstance - #1167
Draft
termoshtt wants to merge 19 commits into
Draft
Add output objective semantics to Instance and ParametricInstance#1167termoshtt wants to merge 19 commits into
termoshtt wants to merge 19 commits into
Conversation
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.
Summary
OutputObjectivetoInstanceandParametricInstanceso the active solver formulation can differ from the objective reported byevaluate()andevaluate_samples(). Parameter materialization and state reconstruction preserve that output meaning; v1 serialization rejects models that it cannot represent losslessly.to_qubo()/to_hubo()as in-place Preparation followed by format extraction. Whole-problemas_minimization_problem()/as_maximization_problem()conversions keep their original meaning.Optimality.Unspecifiedwhen it does not prove optimality for the reported objective.Behavior change
QUBO/HUBO conversion now keeps the prepared minimization energy as the active
Instance, while evaluated results retain the input instance's output semantics:This intentionally corrects the Python SDK v2 behavior, which restored the active sense but evaluated the final penalized energy. Returned QUBO/HUBO coefficients retain their existing meaning. The equivalent editable workflow is
prepare(InstanceClass.qubo(), PreparationPolicy.for_qubo(...))followed byas_qubo_format(); HUBO has matching helpers.