- changed status to open
Provide support for conjugate transpose (adjoint) matrices
Description
Blaze provides support for complex numbers and transpose matrices, but is missing the feature to compute the conjugate transpose of a complex matrix (also called adjoint matrix, Hermetian conjugate matrix, or transjugate). Conceptually, the ctrans
operation should work like this:
using blaze::StaticMatrix;
typedef std::complex<double> cplx;
// Creating the matrix
// ( (1,0) (-2,-1) )
// ( (1,1) ( 0, 1) )
StaticMatrix<cplx,2UL,2UL> A( cplx(1.0,0.0), cplx(-2.0,-1.0),
cplx(1.0,1.0), cplx( 0.0, 1.0) );
// Computing the conjugate transpose matrix
// ( ( 1,0) (1,-1) )
// ( (-2,1) (0,-1) )
StaticMatrix<cplx,2UL,2UL> B;
B = ctrans( A );
Tasks
- provide the
ctrans
operation for scalars, including complex numbers - provide the
ctrans
operation for dense and sparse vectors - provide the
ctrans
operation for dense and sparse matrices - provide a full documentation of the operation
- ensure compatibility to all existing vector and matrix classes
- ensure compatibility to all existing vector and matrix expressions
- guarantee maximum performance for the operation
- extend existing test cases to also cover the
ctrans
operation
Comments (4)
-
reporter -
reporter - edited description
Instead of calling the function to compute the conjugate transpose of a matrix
adjoint
, the function namectrans
should be used. There are two reasons for this:- From a terminology point of view, there is only an adjoint matrix, but no adjoint vector, although it is also possible to compute the conjugate transpose of a vector. Thus adjoint would (from a terminology point of view) limit the operation to matrices.
- In mathematics the term adjoint matrix is also used for adjugate matrices. Therefore an
adjoint
function could cause misunderstandings.
The choice of
ctrans
is inspired by MATLAB. MATLAB provides a function calledtranspose
to compute the non-conjugate transpose of a matrix and actranspose
function to compute the conjugate transpose of a matrix. Since Blaze provides the functiontrans
for computing the non-conjugate transpose of a matrix, the function to compute the conjugate transpose of a matrix should be calledctrans
. -
reporter - changed status to resolved
The feature has been implemented, tested, optimized (including vectorization and parallelization) and documented as required. The following examples give an impression of the final feature:
using blaze::StaticVector; typedef std::complex<double> cplx; // Creating the vector // ( (-2,-1) ( 1, 1) ) StaticVector<cplx,2UL,rowVector> a( cplx(-2.0,-1.0), cplx(1.0,1.0) ); // Computing the conjugate transpose of the vector // ( (-2, 1) ) // ( ( 1,-1) ) StaticVector<cplx,2UL,columnVector> b; b = ctrans( a );
using blaze::StaticMatrix; typedef std::complex<double> cplx; // Creating the matrix // ( (1,0) (-2,-1) ) // ( (1,1) ( 0, 1) ) StaticMatrix<cplx,2UL,2UL> A( cplx(1.0,0.0), cplx(-2.0,-1.0), cplx(1.0,1.0), cplx( 0.0, 1.0) ); // Computing the conjugate transpose of the matrix // ( ( 1,0) (1,-1) ) // ( (-2,1) (0,-1) ) StaticMatrix<cplx,2UL,2UL> B; B = ctrans( A );
The feature is immediately available via cloning the Blaze repository. It will be officially released in Blaze 2.5.
-
reporter -
assigned issue to
-
assigned issue to
- Log in to comment