src/LSLib/DensOp.cc
// Input                sys	: A spin system
// Output               Sigma	: An operator representing the
//			          spin system sys at equilibrium
Input                sys       : A spin system
Output               Sigma     : An operator representing the
spin system sys at equilibrium
Input sys : A spin system Output Sigma : An operator representing the spin system sys at equilibrium
gen_op SigmaEq(const spin_sys& sys)
  {
  gen_op Op;
  if(sys.homonuclear()) Op = Fz(sys);
  else
    {
    double gamma0, gammai;
    gamma0 = sys.gamma(0);
    Op = Iz(sys,0);
    for(int i=1; i<sys.spins(); i++)
      {
      gammai = sys.gamma(i);
      Op += (gammai/gamma0)*Iz(sys,i);
      }
    }
  return Op;
  }
gen_op SigmaEq ( const spin_sys & sys ) { gen_op Op ; if ( sys . homonuclear ( ) ) Op = Fz ( sys ) ; else { double gamma0 , gammai ; gamma0 = sys . gamma ( 0 ) ; Op = Iz ( sys , 0 ) ; for ( int i = 1 ; i < sys . spins ( ) ; i ++ ) { gammai = sys . gamma ( i ) ; Op += ( gammai / gamma0 ) * Iz ( sys , i ) ; } } return Op ; }
Input                sys       : A spin system
Output               Sigma     : An operator representing the
spin system sys at equilibrium
Input sys : A spin system Output Sigma : An operator representing the spin system sys at equilibrium
//  spin_op Z = Fz(sys); //  Op = gen_op(Z.matrix()); //  Op = gen_op(Z.matrix(), sys.get_basis());