Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 22 of 27

Optimize with positive-semidefinite matrix constraints

Use trace geometry and matrix-value d primal–dual certificates.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

Choose a symmetric matrix X=[[1,z],[z,9]] that is positive semidefinite, abbreviated PSD. The condition means vᵀXv≥0 for every real vector v. In this two-by-two case, nonnegative diagonal entries and determinant 9−z²≥0 give −3≤z≤3. Thus maximizing z has optimum three, attained by the rank-one matrix (1,3)(1,3)ᵀ. A matrix inequality has encoded a coupled constraint on its entries, not separate nonnegativity of each entry.

Predict

Predict whether a PSD matrix may have negative off-diagonal entries. The same example permits z=−3, so yes. Predict whether the product of two PSD matrices is always symmetric PSD. It need not be symmetric unless the matrices commute. Nevertheless, their trace inner product is nonnegative, and this weaker fact is exactly what SDP weak duality needs. Using an unjustified product-order claim would obscure the correct certificate.

Experiment

Minimize trace(CX) with C=diag(1,4), X PSD and trace X=1. Consider several diagonal feasible matrices and a dual scalar price.

Matrix XObjectiveFeasible?
diag(1,0)1Yes
diag(1/2,1/2)5/2Yes
diag(0,1)4Yes

The dual choice y=1 has slack S=C−yI=diag(0,3), which is PSD. Thus trace(CX)≥y·trace X=1 for every feasible X, and the first row attains that bound. Check trace(SX)=0 there. This proves optimality for all feasible matrices, including those with nonzero off-diagonal entries, not just the three displayed candidates.

Understand

The symmetric PSD cone is convex: a nonnegative combination of PSD quadratic forms remains nonnegative. It is closed because a limit preserves vᵀXv≥0 for every v. With trace inner product ⟨S,X⟩=trace(SX), the cone is self-dual. If X=RRᵀ, then trace(SX)=trace(RᵀSR), a sum of nonnegative quadratic forms for PSD S. Conversely, testing against every rank-one X=vvᵀ recovers vᵀSv≥0, hence PSD of symmetric S.

An equality-form SDP minimizes trace(CX) subject to trace(AᵢX)=bᵢ and X PSD, with symmetric data. Use L=trace(CX)+Σyᵢ(bᵢ−trace(AᵢX)). If S=C−ΣyᵢAᵢ is PSD, the infimum over PSD X is bᵀy, attained at X=0 for that unconstrained Lagrangian minimization. If S has a negative quadratic direction, scaling its rank-one matrix makes the infimum negative infinity. The dual therefore maximizes bᵀy subject to S PSD. For feasible pairs, the gap is trace(SX)≥0; zero gap certifies both optima. Strong duality and attainment require qualification, such as appropriate strict feasibility and finiteness, rather than holding automatically for every SDP.

Apply

Quadratic vector problems can be lifted by writing X=xxᵀ, since xᵀCx=trace(CX). The lifted matrix is PSD and rank one. Dropping the rank condition enlarges the feasible set, creating an SDP relaxation and a lower bound for minimization. A higher-rank optimum may have no vector producing it exactly. Rounding or extracting a vector requires an additional feasibility and objective check in the original model. The convex relaxation is useful precisely because it can be easier, not because the omitted rank restriction was redundant.

The interior of the PSD cone consists of positive-definite matrices, where −log det X is a barrier. Singular PSD optima lie on its boundary. A numerical eigenvalue slightly below zero must be assessed relative to scaling and tolerances; an unchecked nearly PSD matrix is not an exact certificate. Small two-by-two examples permit determinant checks, while higher-dimensional cases require full spectral or factorization reasoning.

Continue

Keep matrix symmetry, PSD feasibility, trace constraints and the gap visible in an SDP report. Continue to Projected and proximal methods for algorithms that enforce simple convex geometry directly. These methods complement interior-point techniques; choosing between them depends on structure and workload, not a claim that one algorithm universally solves every convex model most efficiently.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

A symmetric matrix[[1,z],[z,4]] is PSD. What is the largest feasible z?

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

Minimize trace(CX) with C=diag(2,5), X PSD and trace X=1. What is the optimum?

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

Prove trace(SX)≥0 for symmetric PSD S,X, even though SX need not be symmetric.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Derive the dual of min trace(CX) subject to trace(AᵢX)=bᵢ and X PSD.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For feasible primal X and dual y, prove the gap is trace(SX) and explain zero-gap optimality.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Explain why dropping X=xxᵀ rank-one structure can create an SDP relaxation rather than an equivalent reformulation.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.