#ifndef GRID_MATH_TA_H #define GRID_MATH_TA_H namespace Grid { /////////////////////////////////////////////// // Ta function for scalar, vector, matrix /////////////////////////////////////////////// /* inline ComplexF Ta( const ComplexF &arg){ return arg;} inline ComplexD Ta( const ComplexD &arg){ return arg;} inline RealF Ta( const RealF &arg){ return arg;} inline RealD Ta( const RealD &arg){ return arg;} */ template inline iScalar Ta(const iScalar&r) { iScalar ret; ret._internal = Ta(r._internal); return ret; } template inline iVector Ta(const iVector&r) { iVector ret; for(int i=0;i inline iMatrix Ta(const iMatrix &arg) { iMatrix ret; double factor = (1.0/(double)N); ret= (arg - adj(arg))*0.5; ret=ret - (trace(ret)*factor); return ret; } /////////////////////////////////////////////// // ProjectOnGroup function for scalar, vector, matrix // Projects on orthogonal, unitary group /////////////////////////////////////////////// template inline iScalar ProjectOnGroup(const iScalar&r) { iScalar ret; ret._internal = ProjectOnGroup(r._internal); return ret; } template inline iVector ProjectOnGroup(const iVector&r) { iVector ret; for(int i=0;i::TensorLevel == 0 >::type * =nullptr> inline iMatrix ProjectOnGroup(const iMatrix &arg) { // need a check for the group type? iMatrix ret(arg); vtype nrm; vtype inner; for(int c1=0;c1