anchor.diff:  
       end subroutine set_reference_det
   
  -
   end module reference_determinant
  
positive.code: 
  !--- Attempt to find a reasonable reference determinant ---
  
      subroutine set_reference_det(occ_list, override_input)
  
          ! Set the list of occupied orbitals in the reference determinant to be
          ! the spin-orbitals with the lowest kinetic energy which satisfy the
  
negative.code:         ! definition of 'best' is system dependent (see code below).
  
          ! In/Out:
          !   occ_list: allocatable integer array.  Contains a 'best guess' at
          !       a suitable reference determinant (nel elements; list of occupied
          !       orbitals in determinant) on output.  Note that this is not ordered.
          !       Unchanged if already allocated unless override_input is set.
          ! In:
          !   override_input: if true, overwrite occ_list with the best guess of
          !       a reference determinant even if occ_list is allocated on input.
          !   ref_sym (optional): if supplied, attempt to find the reference
          !       determinant with the lowest sum of single-particle energies with
          !       this symmetry index.  Ignored if less than sym0 or greater than
          !       sym_max.
  
          use const, only: i0, p
          use checking, only: check_allocate
          use errors, only: stop_all
  
          use basis, only: bit_lookup, basis_fns, nbasis, basis_length
          use determinants, only: encode_det
          use hubbard_real, only: connected_orbs
          use symmetry, only: symmetry_orb_list
          use system, only: nalpha, nbeta, nel, system_type, hub_k, hub_real, read_in, ueg, nsites, &
                            heisenberg, J_coupling, sym0, sym_max
  
          integer, intent(inout), allocatable :: occ_list(:)
          logical, intent(in) :: override_input
          integer, intent(in), optional :: ref_sym
  
          integer :: i, j, ierr, spins_set, connections, iel, icore, jcore, ivirt, jvirt
          integer :: bit_element, bit_pos, tmp_occ_list(nel), curr_occ_list(nel), sym
          integer(i0) :: f(basis_length)
          real(p) :: eigv_sum, sp_eigv_sum
          logical :: set
  
          ! Leave the reference determinant unchanged if it's already been
  