src/HSLib/GenOp.cc
// Input		Op   : General operator (this)
// Return		z    : Complex number, trace of Op
// Note			     : Performed in WBR of Op
Input          Op   : General operator (this)
Return         z    : Complex number, trace of Op
Note                        : Performed in WBR of Op
Input Op : General operator ( this ) Return z : Complex number trace of Op Note : Performed in WBR of Op
complex gen_op::trace(const gen_op &Op1) const
  {
  if(!WBR || !Op1.WBR) return complex0;		
  if(!OpCheck(Op1,1)) GenOpfatality(3,"trace"); 
  const genoprep* REP;				
  REP = Op1.FindRep(WBR->RepBs);		
  if(REP) return (WBR->RepMx).trace(REP->RepMx);
  REP = FindRep(Op1.WBR->RepBs);		
  if(REP) return (Op1.WBR->RepMx).trace(REP->RepMx);
  set_DBR();					
  Op1.set_DBR();				
  return (DBR->RepMx).trace(Op1.DBR->RepMx);	
  }
complex gen_op :: trace ( const gen_op & Op1 ) const { if ( ! WBR || ! Op1 . WBR ) return complex0 ; if ( ! OpCheck ( Op1 , 1 ) ) GenOpfatality ( 3 , " " ) ; const genoprep * REP ; REP = Op1 . FindRep ( WBR -> RepBs ) ; if ( REP ) return ( WBR -> RepMx ) . trace ( REP -> RepMx ) ; REP = FindRep ( Op1 . WBR -> RepBs ) ; if ( REP ) return ( Op1 . WBR -> RepMx ) . trace ( REP -> RepMx ) ; set_DBR ( ) ; Op1 . set_DBR ( ) ; return ( DBR -> RepMx ) . trace ( Op1 . DBR -> RepMx ) ; }
Input          Op   : General operator (this)
Return         z    : Complex number, trace of Op
Note                        : Performed in WBR of Op
Input Op : General operator ( this ) Return z : Complex number trace of Op Note : Performed in WBR of Op
// Input		Op   : General operator (this) // 			Op1  : General operator // Return		z    : Complex, trace of (Op*Op1) // Note			     : Performed in WBR of Op // Zero if Op or Op1 NULL // Check Op-Op1 compatibility // An operator representation // Seek Op1 rep. in Op's WBR // If exists, output Tr{Op*Op1} // Seep Op rep. in Op1's WBR // If exists, output Tr{Op*Op1} /*
if(REP)
{
std::cout << "\n\tFound Matching Op-Op for Trace....";
status(1);
Op1.status(1);
std::cout << "\n\t\tTr(Op1*Op2) = " << (WBR->RepMx).trace(REP->RepMx);
std::cout << "\n\t\tTr(Op2*Op1) = " << (REP->RepMx).trace(WBR->RepMx);
// sosi - we should now look for any matching representation between Op & Op1
//        before doing any calculations......
}
std::cout << "\n\tMust Generate New Base For Trace....";
std::cout.flush();
status(1);
Op1.status(1);
*/ // Put Op into its DBR // Put Op1 into its DBR // Now we take the trace...