Fix factor-2 error in Hermitian PSD constraint dual recovery#3388
Open
PTNobel wants to merge 1 commit into
Open
Fix factor-2 error in Hermitian PSD constraint dual recovery#3388PTNobel wants to merge 1 commit into
PTNobel wants to merge 1 commit into
Conversation
A Hermitian PSD constraint X >> 0 is canonicalized to the real dilation [[Re(X), -Im(X)], [Im(X), Re(X)]] >> 0. The dilation doubles the inner product: <Y_big, X_big> = 2*Re(<Y, X>) for Y recovered from the blocks of Y_big. Complex2Real.invert() recovered the complex dual as dual[:n,:n] + 1j*dual[n:,:n] without compensating, so Hermitian PSD duals were half their correct value: for minimize Re(trace(C @ X)) s.t. X >> A the KKT conditions give Y == C, but con.dual_value returned C/2 and violated strong duality (Re(<Y, A>) was half the optimal value). The real symmetric analog already returned the correct dual. Multiply the recovered dual by 2. Other complex dual recoveries in complex2real.py (Equality/Zero and purely imaginary constraints) split into separate real constraints rather than a dilation, so they have no such factor and are unchanged. No existing tests encoded the halved value. The regression test checks the dual equals C and that strong duality holds; the fix was also verified against finite-difference sensitivity to Hermitian perturbations of A. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Benchmarks that have stayed the same: |
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.
Description
A Hermitian PSD constraint X >> 0 is canonicalized to the real
dilation [[Re(X), -Im(X)], [Im(X), Re(X)]] >> 0. The dilation doubles
the inner product: <Y_big, X_big> = 2Re(<Y, X>) for Y recovered from
the blocks of Y_big. Complex2Real.invert() recovered the complex dual
as dual[:n,:n] + 1jdual[n:,:n] without compensating, so Hermitian PSD
duals were half their correct value: for
minimize Re(trace(C @ X)) s.t. X >> A the KKT conditions give Y == C,
but con.dual_value returned C/2 and violated strong duality
(Re(<Y, A>) was half the optimal value). The real symmetric analog
already returned the correct dual.
Multiply the recovered dual by 2. Other complex dual recoveries in
complex2real.py (Equality/Zero and purely imaginary constraints) split
into separate real constraints rather than a dilation, so they have no
such factor and are unchanged. No existing tests encoded the halved
value.
The regression test checks the dual equals C and that strong duality
holds; the fix was also verified against finite-difference sensitivity
to Hermitian perturbations of A.
Found by an automated bug-hunting audit of master; each finding was reproduced against an independent oracle before fixing.
Type of change
Contribution checklist