src/HSLib/GenOp.cc
/* Since GAMMA operators take the brunt of the work in most MR simulations, it
   is essential that they are in proper working order. As such, I have included
   some means to test various essential aspects of them. In particular, two
   basic aspects are the ability to handle their diagonalization and multiple
   representation (OpRep) tracking. Some of these tests simply parallel the
   functionality provided in class matrix.
 
     Function    Arguments                         Result 
 --------------- --------- ------------------------------------------------ 
 TestEigenSystem    int    Diagonalize the operator & check its eigensystem
 TestReps           int    Check operator equivalance over representations    */
Since GAMMA operators take the brunt of the work in most MR simulations, it
is essential that they are in proper working order. As such, I have included
some means to test various essential aspects of them. In particular, two
basic aspects are the ability to handle their diagonalization and multiple
representation (OpRep) tracking. Some of these tests simply parallel the
functionality provided in class matrix.

Function    Arguments                         Result

TestEigenSystem    int    Diagonalize the operator & check its eigensystem
TestReps           int    Check operator equivalance over representations
Since GAMMA operators take the brunt of the work in most MR simulations it is essential that they are in proper working order . As such I have included some means to test various essential aspects of them . In particular two basic aspects are the ability to handle their diagonalization and multiple representation ( OpRep ) tracking . Some of these tests simply parallel the functionality provided in class matrix . Function Arguments Result TestEigenSystem int Diagonalize the operator & check its eigensystem TestReps int Check operator equivalance over representations
double gen_op::TestEigenSystem(int pf)
  {
  set_DBR();					
  matrix mxDBR = get_matrix();			
  set_EBR();					
  matrix mxEBR = get_matrix();			
  basis  bsEBR = get_basis();			
  double bsdev = norm(bsEBR.TestBasis(pf));	
  matrix mx = bsEBR.convert_back(mxEBR);	
  matrix delmx = mx - mxDBR;			
  double mxdev = norm(delmx.maxZ());		
  if(pf)
    {
    std::cout << "\n\t\tLargest Deviation From Op - S*D*Sm1: " << mxdev;
    }
  return gmax(bsdev, mxdev);
  }
double gen_op :: TestEigenSystem ( int pf ) { set_DBR ( ) ; matrix mxDBR = get_matrix ( ) ; set_EBR ( ) ; matrix mxEBR = get_matrix ( ) ; basis bsEBR = get_basis ( ) ; double bsdev = norm ( bsEBR . TestBasis ( pf ) ) ; matrix mx = bsEBR . convert_back ( mxEBR ) ; matrix delmx = mx - mxDBR ; double mxdev = norm ( delmx . maxZ ( ) ) ; if ( pf ) { std :: cout << " \n \t \t " << mxdev ; } return gmax ( bsdev , mxdev ) ; }
Since GAMMA operators take the brunt of the work in most MR simulations, it
is essential that they are in proper working order.
Since GAMMA operators take the brunt of the work in most MR simulations it is essential that they are in proper working order .
// Put Op in default basis // Get DBR OpRep matrix // Put Op in eigenbasis // Get EBR OpRep matrix // Get EBR OpRep basis // Do basis tests U*inv(U)=1 // Put EBR OpRep back into DBR // Difference between them // Max difference between them