SparseSharedProjQCQP#

class SparseSharedProjQCQP(A0, s0, c0, A1, A2, s1, Plist, Pstruct=None, B_j=None, s_2j=None, c_2j=None, verbose=0)[source]#

Bases: _SharedProjQCQP

Sparse QCQP with projector-structured and optional general quadratic constraints.

This class specializes the generic _SharedProjQCQP implementation for the case where ALL quadratic matrices (A0, A1, A2, each projector block, and any B_j) are sparse. It supports:

  1. A family of “shared” (projection-structured) constraints defined through sparse projector matrices with shared sparsity structure.

  2. An optional list of additional (general) quadratic equality constraints parameterized by matrices B_j, vectors s_2j, and scalars c_2j.

Primal problem (maximization form):

maximize_x - x^† A0 x + 2 Re(x^† s0) + c0 subject to Re( - x^† A1 P_j A2 x + 2 x^† A2^† P_j^† s1 ) = 0 (shared)

Re( - x^† A2^† B_j A2 x + 2 x^† A2^† s_2j + c_2j ) = 0 (general)

Dual feasibility relies (heuristically) on at least one projector direction such that A0 + λ A1 P_j A2 becomes PSD for sufficiently large λ. This is not programmatically verified; users are responsible for supplying a suitable projector set (the second multiplier is chosen for this role).

Parameters:
  • A0 (sp.csc_array) – Objective quadratic matrix (Hermitian expected).

  • s0 (ArrayLike) – Objective linear vector (complex allowed).

  • c0 (float) – Objective constant term.

  • A1 (sp.csc_array) – Left quadratic factor in projector constraints.

  • A2 (sp.csc_array) – Right quadratic factor used in both projector and general constraints.

  • s1 (ArrayLike) – Linear term coupled with projector constraints.

  • Plist (list[ArrayLike]) – list of 2D arrays representing the projector matrices P_j.

  • B_j (list[sp.csc_array] | None) – (Optional) list of general constraint middle matrices (between A2^† and A2).

  • s_2j (list[ArrayLike] | None) – (Optional) list of linear term vectors for general constraints.

  • c_2j (ArrayLike | None) – (Optional) array of constant terms for general constraints.

  • verbose (int, default 0) – Verbosity level (≥1 prints preprocessing info).

  • Pstruct (ndarray[tuple[int, ...], dtype[complexfloating]] | sparray | None)

A0, A1, A2

Stored sparse matrices

Type:

scipy.sparse.csc_array

B_j#

General constraint matrices (empty if none supplied).

Type:

list[scipy.sparse.csc_array]

s0, s1, s_2j

Complex vectors for objective / constraints.

Type:

ComplexArray, ComplexArray, list[ComplexArray]

c0#

Objective constant.

Type:

float

c_2j#

Real constants for general constraints (length matches B_j).

Type:

FloatNDArray

Proj#

dolphindes Projectors object representing all projector matrices P_j.

Type:

dolphindes.util.Projectors

n_gen_constr#

Number of general constraints (len(B_j)).

Type:

int

precomputed_As#

Symmetrized matrices [Sym(A1 P_j A2)] for projectors followed by [Sym(A2^† B_j A2)] for general constraints (if any).

Type:

list[sp.csc_array]

Fs#

Columns are A2^† P_j^† s1 (projector-only part used in derivatives).

Type:

ComplexArray

Acho#

Symbolic/numeric CHOLMOD factorization handle (updated per solve).

Type:

sksparse.cholmod.Factor | None

current_dual#

Cached optimal dual value after solve_current_dual_problem().

Type:

float | None

current_lags#

Cached Lagrange multipliers (projector first, then general).

Type:

FloatNDArray | None

current_grad#

Gradient of dual at current_lags (if computed).

Type:

FloatNDArray | None

current_hess#

Hessian of dual at current_lags (only when no general constraints).

Type:

FloatNDArray | None

current_xstar#

Primal maximizer associated with current_lags.

Type:

ComplexArray | None

use_precomp#

Whether precomputation of constraint matrices/vectors is enabled.

Type:

bool

verbose#

Stored verbosity level.

Type:

int

Performance Notes
-----------------
- CHOLMOD symbolic analysis is performed once (via _initialize_Acho) based on

an example A(lags); subsequent factorizations reuse the sparsity pattern.

- Precomputation accelerates repeated evaluations for moderate constraint counts.

See also

DenseSharedProjQCQP

Dense analogue using LAPACK factorization.

_SharedProjQCQP

Base abstract class with core logic.

Methods Summary

compute_precomputed_values()

Precompute constraint data then initialize symbolic factorization.

is_dual_feasible(lags)

Check PSD feasibility of A(lags) via attempted Cholesky factorization.

Methods Documentation

compute_precomputed_values()[source]#

Precompute constraint data then initialize symbolic factorization.

Return type:

None

is_dual_feasible(lags)[source]#

Check PSD feasibility of A(lags) via attempted Cholesky factorization.

Parameters:

lags (FloatNDArray) – Full Lagrange multiplier vector.

Returns:

True if factorization succeeds (A is PSD), False otherwise.

Return type:

bool