I am playing with complex matrices and vectors and I couldn’t find that much documentation about matrices-vector operations. I would like to make the operation: B = (V*)A(V), where A,B are TMatrix type and V is TVectorT vector.

I first define TMatrix/TVector conjugate as following

And then after that I was hoping to make the simple operation:

{
using TMatrixC = TMatrixT<TComplex>;
using TVectorC = TVectorT<TComplex>;
TMatrixC A = /*[...]*/;
TVectorC V = /*[...]*/;
TMatrixC B = Conjugate(V)*A*V;
}

This throw me an error because of the left handside multiplication.

This is not what I want to do, because my vectors are differents.
But for the records… this might be useful for someone else. Naming doesn’t sound obvious.

TMatrixT<Element>
[...]
Element Similarity (const TVectorT< Element > &v) const
Calculate scalar v * (*this) * v^T.
[..]

If you search for “matrix complex” you will see that there has been some interest for complex matrix algebra over the last 2 decades, but … implementing this feature in all elements of the linear package is a big task:

your algebra syntax is not correct ! An expression is always interpreted from left to right unless parentheses are placed. V * A * V will result first in calculating V * A.

We could have implemented to interpret this as V^T * A . Just to keep the syntax
clean and simple that is left out and the preferred way is, V * (A * V) which
will result in a dot product of two vectors.

As far as the naming of “Similarity” goes. The code contains also the well-known matrix similarity operations and this one is with a vector.

Pretty sure it doesn’t takes two decades to implement complex matrices… but I definitely need a robust/mature solution.

I definitely didn’t found any vector transpose function, so I assumed that multiplying a vector-matrix from the left was implicit. Additionally, I only know matrix similarities not vector-matrix.
Many thanks for the clarifications !