Skip to content

Support complex-Hermitian variables in L1 and SPD objective functions#1

Open
k-yoshimi wants to merge 1 commit into
mainfrom
complex-hermitian-support
Open

Support complex-Hermitian variables in L1 and SPD objective functions#1
k-yoshimi wants to merge 1 commit into
mainfrom
complex-hermitian-support

Conversation

@k-yoshimi

Copy link
Copy Markdown

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 complex128 state; only these two solve() 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

  • Real inputs produce identical results and dtypes to before.
  • No public API change; mu accepted types are unchanged.

Tests

Adds coverage for the complex L1 prox (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

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
k-yoshimi force-pushed the complex-hermitian-support branch from ca74aeb to 88abd30 Compare July 18, 2026 05:59
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.

1 participant