Advanced maths

Williamson symplectic decomposition calculator for a positive definite matrix

Diagonalize a real positive-definite even-order matrix by a symplectic congruence and inspect its paired symplectic eigenvalues.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Diagonalize a real positive-definite even-order matrix by a symplectic congruence and inspect its paired symplectic eigenvalues.

THE FORMULASᵀ A S = diag(D,D), Sᵀ J S = J, J = [[0,I],[-I,0]]

A worked example

For A=diag(1,4,9,16) in q1,q2,p1,p2 order, the symplectic eigenvalues are 3 and 8. Their product is 24 and det(A)=576.

Good to know

Real SPD order2,4 or6 with bounded condition number. Symmetric square root plus real skew-symmetric canonical blocks, positive paired symplectic eigenvalues and explicit S convention. Verify S^T J S=J and S^T A S=diag(D,D); reject unresolved near-singular data. No PSD extension.

Symplectic congruence imposes a structure

Ordinary symmetric diagonalization uses an orthogonal basis and returns the usual eigenvalues. Williamson decomposition instead preserves a specified nondegenerate skew form. Its coordinate transformation is symplectic, and the positive diagonal values occur twice, once for each coordinate in a canonical conjugate pair. These are different invariants of the same matrix.

The pairing reflects the chosen order of coordinates. This page uses all q coordinates followed by all p coordinates, so the canonical skew matrix has identity blocks off the diagonal. An alternating q1,p1,q2,p2 ordering requires a corresponding permutation of both the input and the skew form. Mixing conventions can produce a seemingly incorrect residual despite a valid decomposition in another ordering.

Williamson symplectic decomposition for a positive definite matrix1, 49, 163, 83, 8q1,q2,p1,p2 convention
Scroll across to see the full diagram.
For A=diag(1,4,9,16) in q1,q2,p1,p2 order, the symplectic eigenvalues are 3 and 8. Their product is 24 and det(A)=576.

Compare this with the Quadratic form inertia calculator with congruence transformation. Construct a symplectic congruence to repeated positive diagonal symplectic eigenvalues, preserving the canonical skew form. Ordinary inertia congruence only identifies signs and need not be symplectic.

Why positive definiteness is required

The initial domain consists of real symmetric positive-definite matrices of even order. Positivity gives a well-defined symmetric square root and strictly positive symplectic eigenvalues. A merely positive-semidefinite matrix may have zero modes and requires additional hypotheses and conventions that are intentionally outside the supported decomposition.

Symmetry and positivity should be checked before attempting the canonical construction. A tiny positive eigenvalue can also make a nominally valid matrix numerically unresolved. In that case, an error should identify the conditioning restriction rather than silently add a diagonal regularizer. Such a regularizer changes the input matrix and hence changes the symplectic invariants being requested.

A square-root and skew-matrix route

A useful construction forms the real skew-symmetric matrix obtained by surrounding J with the symmetric square root of A. Its canonical two-dimensional blocks have positive magnitudes equal to the symplectic eigenvalues. Appropriate scaling of those blocks then constructs a transformation satisfying both the symplectic and congruence identities.

Repeated symplectic eigenvalues do not make the invariant values ambiguous, but they do permit multiple valid canonical bases. Column signs and permutations of conjugate pairs also create equivalent outputs. Compare decompositions through their reconstructed matrix and canonical skew form, not by demanding element-by-element equality between two independently produced transformation matrices.

The diagonal four-dimensional example

For the default input, the q block is diag(1,4) and the p block is diag(9,16). Each pair has symplectic value equal to the square root of the product of its two diagonal coefficients. The resulting values are square root of nine and square root of sixty-four: three and eight.

One valid symplectic scaling has diagonal entries square root of three, square root of two, one over square root of three and one over square root of two. It transforms A to diag(3,8,3,8). The determinant check is independent: the square of the product of the symplectic values is 24 squared, which equals the input determinant 576.

Inspecting the two residuals

The first essential residual measures how closely S transpose J S matches J. It tests whether the returned coordinate change preserves the canonical skew form. The second measures how closely S transpose A S matches the paired positive diagonal matrix. Passing only one of these conditions is insufficient to establish a Williamson decomposition.

Residual magnitudes should be interpreted relative to the norms and conditioning of the input and transformation. A small backward residual is not automatically a small forward error in every entry of S. Also check positivity of the returned values and the expected paired spectrum of the associated Hamiltonian matrix, while recognizing that basis vectors may vary substantially in nearly repeated subspaces.

What changes under coordinate transformations

A symplectic congruence changes the ordinary shape and usual matrix eigenvalues while preserving the symplectic eigenvalue multiset. That is why this decomposition can organize quadratic structures in canonical coordinates. An arbitrary invertible congruence preserves inertia instead, which for a positive-definite matrix contains only the count of positive directions.

Do not interpret ordinary orthogonal diagonalization or an inertia-normalizing transformation as an interchangeable answer. They preserve different structures. If the application uses another canonical skew matrix, transform its coordinates explicitly before using the result. The convention is part of the mathematical input, not an optional cosmetic ordering of labels.

Reading the bounded result responsibly

The educational solver supports small even orders and a condition-number cap so the skew-block construction can be validated. It does not extend the theorem to singular inputs, indefinite quadratic forms or arbitrary complex covariance conventions. A rejected near-singular problem remains unresolved within that numerical domain rather than being classified as impossible in all generalized settings.

Use the returned S, positive values and residuals together. Determinant agreement alone cannot distinguish a correct symplectic transformation from an unrelated diagonalization with a coincidentally matching product. A useful independent check reconstructs the original A from the stated congruence convention and confirms that the same S preserves J to the declared numerical tolerance.

A few questions, answered

Are these the ordinary eigenvalues?

No. Symplectic eigenvalues are invariants under symplectic congruence and generally differ from ordinary eigenvalues.

Why must the matrix order be even?

A nondegenerate canonical skew form pairs coordinates, requiring an even-dimensional space.

Can two valid S matrices differ?

Yes. Signs, pair permutations and repeated invariant subspaces can yield different valid transformations.

Is positive semidefinite input accepted?

No. The initial supported domain requires resolved strict positive definiteness.

Find your calculator

Start typing to explore the library.