Support complex-Hermitian variables in L1 and SPD objective functions#1
Open
k-yoshimi wants to merge 1 commit into
Open
Support complex-Hermitian variables in L1 and SPD objective functions#1k-yoshimi wants to merge 1 commit into
k-yoshimi wants to merge 1 commit into
Conversation
Enable complex-valued (Hermitian) variables in the two proximal operators that were previously restricted to real input, so that matrix-valued problems with complex off-diagonal (e.g. spin-orbit-coupled spectra) can be solved. The ADMM optimizer already carries complex128 state. - L1Regularizer: the proximal operator now uses the magnitude soft-threshold (shrink |x| by the threshold, keep the phase). The real path is unchanged bit-for-bit for all real dtypes. - SemiPositiveDefinitePenalty: retain the imaginary part and project each block onto the Hermitian PSD cone. The Hermitian-constrained centre is the weighted paired average; eigenvalue clipping is the exact projection for the per-block-uniform (scalar) penalty used by the optimizer, and a documented feasible approximation otherwise. Centre and magnitude scalings are made overflow-safe for large finite operands. - Add tests for the complex L1 prox, complex Hermitian PSD projection, real-path bit-exactness (incl. boundaries and low precision), and large-finite / infinite input handling. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TMeDqXABvd876kMmVY7K34
k-yoshimi
force-pushed
the
complex-hermitian-support
branch
from
July 18, 2026 05:59
ca74aeb to
88abd30
Compare
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
Enables complex-valued (Hermitian) variables in the two proximal operators that were previously restricted to real input, so matrix-valued problems with complex off-diagonal blocks (e.g. spin–orbit-coupled spectral matrices) can be solved. The ADMM optimizer already carries
complex128state; only these twosolve()operators forced the imaginary part to zero.Changes
L1Regularizer: the proximal operator now uses the magnitude soft-threshold (shrink|x|by the threshold, keep the phase). The real path is unchanged bit-for-bit for every real dtype (float16/32/64, integer).SemiPositiveDefinitePenalty: retains the imaginary part and projects each block onto the (real-symmetric or complex-Hermitian) PSD cone. The Hermitian-constrained centre is the weighted paired average-(h_ij + conj(h_ji))/(d_ij + d_ji); eigenvalue clipping is the exact projection for the per-block-uniform (scalar) penalty used by the optimizer, and a documented feasible approximation otherwise. Centre and magnitude scalings are made overflow-safe for large finite operands.Backward compatibility
muaccepted types are unchanged.Tests
Adds coverage for the complex
L1prox (closed form + objective optimality), the complex-Hermitian PSD projection (exactness vs an independent eigenvalue-clipped reference, Hermiticity, PSD), real-path bit-exactness incl. threshold boundaries and low precision, and large-finite / infinite-input handling. Full suite passes (38 tests).🤖 Generated with Claude Code
https://claude.ai/code/session_01TMeDqXABvd876kMmVY7K34