anchor.diff:    implicit none
   
     integer(bit_kind), intent(in) :: mask(N_int, 2), gen(N_int, 2)
  -  integer(1),intent(in) :: phasemask(N_int*bit_kind_size, 2)
  +  integer(1),intent(in) :: phasemask(2,N_int*bit_kind_size)
     logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2)
     integer(bit_kind) :: det(N_int, 2)
     double precision, intent(in) :: coefs(N_states)
  
positive.code:         end if
        end do
      else
        do i = 1,2
        do j = 1,2
          puti = p(i, 1)
          putj = p(j, 2)
          
          if(banned(puti,putj,bant)) cycle
          p1 = p(turn2(i), 1)
          p2 = p(turn2(j), 2)
          h1 = h(1,1)
          h2 = h(1,2)
          
          hij = integral8(p1, p2, h1, h2) * get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2)
          mat(:, puti, putj) += coefs * hij
        end do
        end do
      end if
  
  
negative.code:     do ni=1,N_int
        do i=0,bit_kind_size-1
          if(BTEST(det(ni, s), i)) change = .not. change
            if(change) phasemask(s, (ni-1)*bit_kind_size + i + 1) = 1_1
        end do
      end do
    end do
  