Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear operators acting on symmetric matrices #101

Open
andreasvarga opened this issue Oct 15, 2019 · 8 comments
Open

Linear operators acting on symmetric matrices #101

andreasvarga opened this issue Oct 15, 2019 · 8 comments
Labels

Comments

@andreasvarga
Copy link

I implemented several linear operators related to solve control problems. An example is the Lyapunov operator L: X -> AX+XA', where A is a squre matrix. This operator acts usually on symmetric/hermitian matrices X and is a special case of the more general Sylvester operator S: X -> AX+XB, with A and B square matrices (not necessarily of the same size). The definition of L as a linear operator is possible regardless X is symmetric/hermitian or not and Matrix(L) is the usual Kronecker-expansion based matrix. However, the definition of the inverse operator inv(L) : Y -> X involves the solution of a Lyapunov equation AX+XA' + Y = 0, where for a symmetric/hermitian Y the resulting X is also symmetric/hermitian. The solvers of Lyapunov equations usually exploit the symmetry of the solutions, by computing, for example, only the upper triangular part of X (the lower triangular part results via symmetry). It is possible to define inv(L) ignoring the symmetry in the input data. Unfortunately, in this case, some functions in the LinearOperators collection will fail, as for example Matrix(inv(L)), which will not generate the inverse operator matrix due to the restriction on the symmetry of the specialized solvers. To cope with this aspect, I was forced to use the more general solvers for Sylvester equations to compute the full solution X, with the associated efficiency losses.

I wonder if the problem of restrining the domain of input data to form the products as L * vec(X) can be addressed somehow, by assuming certain structural constraints on X (e.g., symetric, or hermitian or even diagonal).

Many thanks in advance for your time considering this question.

Note: The implemented linear operators belong to the recently developed (not yet registered) package MatrixEquation.jl.

@dpo
Copy link
Member

dpo commented Oct 15, 2019

If I understand your question correctly, symmetry of the solution of your Lyapunov equation doesn't really depend on the operator, but rather on how you model the equation. Couldn't you formulate the problem by only considering tril(X) as your set of unknowns?

If I misunderstood, could you give a short example illustrating the issue you're having?

@andreasvarga
Copy link
Author

andreasvarga commented Oct 15, 2019 via email

@dpo
Copy link
Member

dpo commented Oct 15, 2019

So it's the default implementation of Matrix(op::AbstractLinearOperator) that is causing you trouble. An easy solution might be to define your own operator type, say LyapunovOperator <: AbstractLinearOperator, and define the product operations accordingly. Then you can implement your own Matrix(op::LyapunovOperator) = op * Matrix(1.0I, size(op)...) (or whichever way works for you)?! Does that make sense?

@andreasvarga
Copy link
Author

andreasvarga commented Oct 16, 2019 via email

@dpo
Copy link
Member

dpo commented Oct 16, 2019

I think I found a less elegant way to manage the issue, by assuming that only the upper triangular part of X is packed in the vector x

Yes, that's what I meant in my first reply.

I'm open to adding a function for estimating the 1-norm of an operator but it cannot be based on LAPACK because we can't assume that operators are explicit matrices.

@andreasvarga
Copy link
Author

andreasvarga commented Oct 16, 2019 via email

@dpo
Copy link
Member

dpo commented Oct 16, 2019

I see. It's reverse communication. That's an idea but it would be better in the long run to rewrite it in Julia, and have all four versions (and much more) for the price of one. It's simple enough: http://www.netlib.org/lapack/explore-html/d3/d0a/dlacn2_8f_source.html

@dpo dpo added the question label Oct 23, 2019
@andreasvarga
Copy link
Author

Just an update: I formulated for my package an issue which is related to the above discussion. Simply said, I was not able to ensure the condition Matrix(T)' = Matrix(T') for an operator T which maps the upper triangular part of a symmetric matrix X to the upper triangular part of Y := AX+XA'. Your comment on this issue would be highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants