anchor.diff:        key_tmp(2,2) = xor(key1(2,2,i),key2(2,2))
         degree_alpha = popcnt(key_tmp(1,1)) + popcnt(key_tmp(2,1)) 
         degree_beta  = popcnt(key_tmp(1,2)) + popcnt(key_tmp(2,2)) 
  -      if(degree_alpha .gt.3 .or. degree_beta .gt.3 )cycle !! no double excitations of same spin
  -        degree(l) = ishft(d,-1)
  -        idx(l) = i
  +      if(degree_alpha .ge.3 .or. degree_beta .ge.3 )cycle !! no double excitations of same spin
  +      degree(l) = ishft(d,-1)
  +      idx(l) = i
           l = l+1
       enddo
       
  
positive.code:         degree_alpha += popcnt(key_tmp(m,1)) 
          degree_beta  += popcnt(key_tmp(m,2)) 
        enddo
        if(degree_alpha .gt.3 .or. degree_beta .gt.3 )cycle !! no double excitations of same spin
          degree(l) = ishft(d,-1)
          idx(l) = i
          l = l+1
      enddo
      
    endif
  
negative.code:           popcnt(xor( key1(1,2,i), key2(1,2)))
        key_tmp(1,1) = xor(key1(1,1,i),key2(1,1))
        key_tmp(1,2) = xor(key1(1,2,i),key2(1,2))
        if(popcnt(key_tmp(1,1)) .ge.3 .or. popcnt(key_tmp(1,2)) .ge.3 )cycle !! no double excitations of same spin
        if (d > 4)cycle
        if (d ==4)then  
         if(popcnt(xor(key_tmp(1,1),key_tmp(1,2))) == 0)then
  