Internal functions

SumOfSquares.Certificate.Symmetry.orthogonal_transformation_toFunction
orthogonal_transformation_to(A, B, Ais, Bis)

Return an orthogonal transformation U such that A = U' * B * U and Ai[k] = U' * Bi[k] * U for all (Ai, Bi) in zip(Ais, Bis)

Given Schur decompositions A = Z_A * S_A * Z_A' B = Z_B * S_B * Z_B' Since P' * S_A * P = D' * S_B * D, we have A = Z_A * P * Z_B' * B * Z_B * P' * Z_A'

source
SumOfSquares.Certificate.Symmetry._reorder!Function
_reorder!(F::LinearAlgebra.Schur{T}) where {T}

Given a Schur decomposition of a, reorder it so that its eigenvalues are in in increasing order.

Note that if T<:Real, F.Schur is quasi upper triangular. By (quasi), we mean that there may be nonzero entries in S[i+1,i] representing complex conjugates. In that case, the complex conjugate are permuted together. If T<:Complex, then S is triangular.

source
SumOfSquares.Certificate.Symmetry._rotate_complexFunction
_rotate_complex(A::AbstractMatrix{T}, B::AbstractMatrix{T}; tol = Base.rtoldefault(real(T))) where {T}

Given (quasi) upper triangular matrix A and B that have the eigenvalues in the same order except the complex pairs which may need to be (signed) permuted, returns an othogonal matrix P such that P' * A * P and B have matching low triangular part. The upper triangular part will be dealt with by _sign_diag.

By (quasi), we mean that if S is a Matrix{<:Real}, then there may be nonzero entries in S[i+1,i] representing complex conjugates. If S is a Matrix{<:Complex}, then S is upper triangular so there is nothing to do.

source
PolyJuMP.QCQP._subs_ensure_moi_orderFunction
_subs_ensure_moi_order(p::PolyJuMP.ScalarPolynomialFunction, old, new)

Substitutes old MP.variables(p.polynomial) with new vars, while re-sorting the MOI p.variables to get them in the correct order after substitution.

source