Internal functions
SumOfSquares.Certificate.Symmetry.orthogonal_transformation_to
— Functionorthogonal_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'
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.
SumOfSquares.Certificate.Symmetry._rotate_complex
— Function_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.
PolyJuMP.QCQP._subs_ensure_moi_order
— Function_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.