anchor.diff:  !            - 1.0 * P( p3 p4 h2 h1 => p3 p4 h1 h2 ) 
   !            + 1.0 * P( p3 p4 h2 h1 => p4 p3 h1 h2 ) ] 
   !          * Sum ( p5 h6 ) * t ( p5 p3 h6 h2 ) * v ( h6 p4 h1 p5 ) done
  -            do d = nOcc+1,nmo
  +            do c = nOcc+1,nmo
                 do k = MOZero,nOcc
  -                if ((k == i) .or. (k == j)) then
  -                    cycle
  -                elseif ((d == a) .or. (d == b)) then
  -                    cycle
  -                endif
  -
  -                in1 = in1 + 1.0d0 * t2old(a,d,k,j) * AMO(b,k,i,d)
  -
  -                in1 = in1 - 1.0d0 * t2old(a,d,k,i) * AMO(b,k,j,d)
  -                in1 = in1 - 1.0d0 * t2old(d,b,j,k) * AMO(a,k,i,d)
  -
  -                in1 = in1 + 1.0d0 * t2old(d,b,i,k) * AMO(a,k,j,d)
  +                in1 = in1 - 1.0d0 * t2old(a,c,i,k) * AMO(k,b,j,c)
  +                in1 = in1 + 1.0d0 * t2old(b,c,i,k) * AMO(k,a,j,c)
  +                in1 = in1 + 1.0d0 * t2old(a,c,j,k) * AMO(k,b,i,c)
  +                in1 = in1 - 1.0d0 * t2old(b,c,j,k) * AMO(k,a,i,c)
                 enddo
               enddo
   
  -!           [ + 0.5 ] * Sum ( p5 p6 ) * t ( p5 p6 h1 h2 ) * v ( p3 p4 p5 p6 ) done
  -            do c = nOcc+1,nmo
  -              do d = nOcc+1,nmo
  -                if ((c == a) .or. (c == b)) then
  -                    cycle
  -                elseif ((d == a) .or. (d == b)) then
  -                    cycle
  -                endif
  -                in1 = in1 + 0.5d0 * t2old(c,d,i,j) * AMO(a,b,c,d)
  -              enddo
  -            enddo
  -
  -
   !            write(*,*) "t2   ",p3,p4,h1,h2,AMO(p3,p4,h1,h2),AMO(h1,h2,p3,p4)
   !            Dijab = (Eps_SO(p3) + Eps_SO(p4) - Eps_SO(h1) - Eps_SO(h2))
  -            t2(a,b,i,j) = in1
  +            t2(a,b,i,j) =  1.0d0*in1/Dijab
   
             enddo
           enddo
  
positive.code:     t2old = 0.0d0
      Dijab = 1.0d0
  
    do iT2=1,150 ! T amplitude loop
      Elccd  = 0.0d0
      t2old  = 0.5*(t2+t2old) ! uses mixing
      !T2 equations
      do i=MOZero,nOcc
        do j=MOZero,nOcc    
          do a=nOcc+1,nmo
            do b=nOcc+1,nmo
  
  !           [ + 1.0 ] * v ( p3 p4 h1 h2 )
              in1 = 1.0d0 * AMO(a,b,i,j)
              !write(*,*) i,j,a,b,in1
  
  !           [ - 1.0 + 1.0 * P( p4 p3 h1 h2 => p3 p4 h1 h2 ) ] * Sum ( p5 ) * f ( p4 p5 ) * t ( p5 p3 h1 h2 ) done
              do d = nOcc+1,nmo
                if ((d == a) .or. (d == b)) then
                    cycle 
                endif
                in1 = in1 + 1.0d0 * F_SO(b,d) * t2old(a,d,i,j)
                in1 = in1 + 1.0d0 * F_SO(a,d) * t2old(d,b,i,j)
              enddo
  
  !           [ - 1.0 + 1.0 * P( p3 p4 h1 h2 => p3 p4 h2 h1 ) ] * Sum ( h5 ) * f ( h5 h1 ) * t ( p3 p4 h5 h2 ) done
              do k = MOZero,nOcc
                if ((k == i) .or. (k == j)) then
                    cycle
                endif
                in1 = in1 - 1.0d0 * F_SO(k,j) * t2old(a,b,i,k)
                in1 = in1 - 1.0d0 * F_SO(k,i) * t2old(a,b,k,j)
              enddo
  
  !           [ + 0.5 ] * Sum ( h5 h6 ) * t ( p3 p4 h5 h6 ) * v ( h5 h6 h1 h2 ) done
              do k = MOZero,nOcc
                do l = MOZero,nOcc
                  if ((k == i) .or. (k == j)) then
                      cycle
                  elseif ((l == i) .or. (l == j)) then
                      cycle
                  endif
                  in1 = in1 + 0.5d0 * t2old(a,b,k,l) * AMO(i,j,k,l)
                enddo
              enddo
  
  
negative.code: !    E_2SS = 0.0d0
  
      do i=MOZero,nOcc
        do j=MOZero,i-1
          do a=nOcc+1,nmo
            do b=nOcc+1,a-1
              Elccd = Elccd + 1.0d0*t2(a,b,i,j)*AMO(i,j,a,b)
            enddo
          enddo
        enddo
  