Skip to content

Make circuit validation feasibility-aware and energy-consistent for constrained/MAXIMIZE problems - #68

Merged
fgfuchs merged 5 commits into
mainfrom
copilot/fix-pr-67-issues
Aug 27, 2026
Merged

Make circuit validation feasibility-aware and energy-consistent for constrained/MAXIMIZE problems#68
fgfuchs merged 5 commits into
mainfrom
copilot/fix-pr-67-issues

Conversation

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

PR #67’s validation update still compared against objective_value() and relied on exception handling for infeasible states, which breaks MAXIMIZE semantics and misses problems that mark infeasibility via isFeasible(). This change makes validation consistent with circuit construction (energy) and explicit feasibility rules.

  • Phase expectation source

    • Use problem.energy(bitstring) for feasible states, matching canonical phase-separator semantics across MINIMIZE and MAXIMIZE objectives.
    • Remove exception-driven validity detection from validation flow.
  • Feasibility-aware state handling

    • Use problem.isFeasible(bitstring) to decide inclusion in validation.
    • Add omit_infeasible_states support that excludes infeasible basis states from phase-error checks.
    • Add guard for degenerate masks (no selected states).
  • Parameter clarity and compatibility

    • Introduce infeasible_energy as the explicit placeholder value for infeasible states.
    • Keep global_phase as a deprecated alias with warning + conflict check to avoid ambiguous inputs.
  • Validation regression coverage

    • Add targeted tests for constrained behavior: pass when infeasible states are omitted, fail when included with mismatched placeholder energy.
ok, report = check_phase_separator_exact_problem(
    problem,
    t=1.0,
    omit_infeasible_states=True,
    infeasible_energy=0.0,
)

Copilot AI and others added 3 commits August 27, 2026 08:04
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Copilot AI and others added 2 commits August 27, 2026 12:36
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>

@fgfuchs fgfuchs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

approved

@fgfuchs
fgfuchs marked this pull request as ready for review August 27, 2026 14:36
@fgfuchs
fgfuchs merged commit 08ae153 into main Aug 27, 2026
@fgfuchs
fgfuchs deleted the copilot/fix-pr-67-issues branch August 27, 2026 14:38
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.

2 participants