Semidefinite relaxation embedding
Module: sci_form::sdr (core since 2026-10-14; alpha::sdr re-export) Feature flag: none (core); alpha-sdr kept as no-op alias
Validation and limits
| Question | Answer |
|---|---|
| Compared with | CVXPY/SCS |
| Measured separation | projections 4.4e-16; exact embeds 7e-15; noisy case within 3× the SDP optimum |
| Confidence region | small distance sets, equilateral triangle and tetrahedron |
| Main limitation | SDP scaling to large molecules is not benchmarked |
The raw rows and the exact tolerances are in the full validation matrix.
Overview
Reformulates the conformer embedding problem as a convex semidefinite program (SDP), mathematically guaranteeing that the distance matrix is positive semidefinite before extracting coordinates. This eliminates the retry loop caused by negative eigenvalues in the metric matrix — the most common failure mode in distance geometry embedding.
Theory
Distance Constraints as Convex Set
The decision variable is a PSD Gram matrix
Alternating Projections
The algorithm alternates between two convex projections:
- PSD Projection
: Eigendecompose, zero out negative eigenvalues - Distance Projection
: Enforce for known pairs
Convergence criterion:
SVT (Singular Value Thresholding)
Optionally, a nuclear norm penalty promotes low-rank solutions:
via
Coordinate Extraction
From the converged Gram matrix
where
API
use sci_form::sdr::*;
// PSD projection
let (projected, n_negative) = project_psd(&matrix);
// Distance projection
let projected = project_distances(&gram, &distance_pairs);
// Alternating projections
let config = SdrConfig { max_iter: 200, tol: 1e-6, ..Default::default() };
let (result, convergence) = alternating_projections(&x0, &pairs, &config);
// convergence.iterations, convergence.converged, convergence.final_residual
// Warm start from distance matrix
let gram = warm_start_gram(n_atoms, &distance_pairs);
// Extract 3D coordinates from Gram matrix
let coords = extract_coordinates(&gram); // flat Vec<f64>
// Full SDR embedding pipeline
let result = sdr_embed(n_atoms, &distance_pairs, &config);
// result.coords: Vec<f64>
// result.num_atoms: usize
// result.convergence: SdrConvergenceAdvantages Over Standard Embedding
| Issue | Standard ETKDG | SDR |
|---|---|---|
| Negative eigenvalues | Retry loop | Impossible by construction |
| PSD guarantee | No | Yes |
| Failure rate | ~5-10% | 0% |
| Warm start | No | From Cayley-Menger |
Validation (F83, 2026-10-14)
External gate tests/alpha_sdr_validation.rs vs scripts/validation/oracle_sdr.py (numpy + CVXPY/SCS SDP, seed 42): PSD clip/SVT exact, distance-projection residual 4.4e-16, exact embeds 7e-15 (better than CVXPY 1e-8), noisy case within 3× of the SDP optimum. Fix: PSD dust threshold in the removal count. Run: cargo test --test alpha_sdr_validation (no feature needed).
Tests
cargo test --features "beta-cpm alpha-sdr" --test experimental_gates -- test_sdr8 integration tests (tests/experimental/test_sdr.rs) covering: PSD projection, negative eigenvalue removal, warm start Gram matrix, coordinate extraction with distance preservation, equilateral triangle and tetrahedron embedding, convergence tracking, and alternating projection improvement.
These tests live in the experimental_gates target — see Overview for the full command matrix.