Lazy representation of x^T A x

Hello,

I have a complicated code (nested calls to subroutines) that computes an expression of the form x^T A x, where A is not necessarily PSD. Is it possible to construct a lazy representation of A, in the same spirit as LinearMaps?

Wait, I misunderstood your question.

You’re saying you have f(x) = …compute xᵀAx …, and you want to construct A?

If A is not symmetric, then this is impossible, since f(x) can’t distinguish between A and Aᵀ.

2 Likes

Yes, I would like some way to represent A, without an explicit expression for A.

Can’t you modify your code to compute Ax for an arbitrary x? Or at least y^T A x for arbitrary (x,y)?

1 Like

That’s true, I haven’t thought about this. Basically, I have a set of routines to compute analytically the pressure on an infinitely thin plate due to vortex elements in the surrounding fluid. We know that this function can be written as x^T A x + b^T x + c where x denotes the strength of each vortex element, A, b, c depends on the location of the vortex elements and the location on the plate

The dimension of x is of order 20

The code involves multiples linear and affine transformations of the original variables or intermediate variables. Creating the factorization into the original variables is painful, and also requires to store all the intermediate linear operators and offset terms.

My goal is to use this factorization to create a sparse representation of x with little sacrifice on the pressure field (quadratic compressed sensing). Here is the algorithm I want to use for the compressed sensing https://arxiv.org/pdf/1301.7002.pdf

Would a truncated singular value decomposition be of help here?

1 Like

For completeness, I was confused for a second why symmetry helps but then realised one can use (x-y)’A*(x-y) - x’A*x - y’A*y = -2x’A*y.

3 Likes