[petsc-users] HermitianTranspose version of MatCreateTranspose.

Barry Smith bsmith at mcs.anl.gov
Wed Mar 18 16:10:47 CDT 2015


> On Mar 18, 2015, at 3:41 PM, Andrew Spott <ansp6066 at colorado.edu> wrote:
> 
> So, I’ve got a MatCreateHermitianTranspose function that has close to the same functionality as the MatCreatTranspose version.  So I’m getting ready to send a pull request.
> 
  Great

> A few questions:
> 
> What branch should I add my changes to?

master

> 
> Should I create tests for this?

most definitely

>  Where should I put them?

src/mat/examples/tests

> 
> On Monday, Feb 23, 2015 at 9:02 PM, Barry Smith <bsmith at mcs.anl.gov>, wrote:
> 
> We've had a small amount of debate over the years on how to handle the Hermitian transpose and non-Hermitian transpose that never got fully resolved. 
> 
> Approach 1) Each (complex) matrix has a full set of transpose and Hermitian transpose operations (MatTranspose(), MatHermitianTranspose(), MatMultTranspose()), MatMultHermitianTranspose(), MatSolveTranspose(), MatSolveHermitianTranspose(), MatMatMultTranspose(), MatMatMultHermitianTranspose(), MatTranposeMatMult(), MatHermitianTransposeMatMult().......) plus there are two vector "inner" products; VecDot() and VecTDot(). 
> 
> Approach 2) Consider a (complex) vector (and hence the associated matrix operators on it) to live in the usual Hermitian inner product space or the non-Hermitian "inner product space". Then one only needs a single VecDot() and MatTranspose(), MatMultTranspose() ... that just "does the right thing" based on what space the user has declared the vectors/matrices to be in. 
> 
> Approach 2) seems nicer since it only requires 1/2 the functions :-) and so long as the two vector "spaces" never interact directly (for example what would be the meaning of the "inner" product of a vector in the usual Hermitian inner product space with a vector from the non-Hermitian "inner product space"?) certain seems simpler. Approach 1) might be simpler for some people who like to always see exactly what they are doing. 
> 
> I personally wish I had started with Approach 2 (but I did not), but there could be some flaw with it I am not seeing. 
> 
> Barry 
> 
> 
> 
> 
> 
> 
> 
> > On Feb 23, 2015, at 6:50 PM, Andrew Spott <ansp6066 at colorado.edu> wrote: 
> > 
> > I’m definitely willing to submit it as a pull request. 
> > 
> > Also, while I’m at it, I’m going to write a “duplicate” function for transpose and hermitian_transpose. Just because this seems 1) easy ( MatHermitianTranspose can return a new copy, as well as MatTranspose), and 2) necessary to use these for EPS. 
> > 
> > Also, is “transpose” a good enough MatType? Or does a new one need to be written? 
> > 
> > -Andrew 
> > 
> > 
> > 
> > On Mon, Feb 23, 2015 at 3:12 PM, Jed Brown <jed at jedbrown.org> wrote: 
> > 
> > <signature.asc> 
> > 
> 



More information about the petsc-users mailing list