anchor.diff:                  i = occ_list(int(genrand_real2()*nel)+1)
                   ! Conserve symmetry (spatial and spin) in selecting a.
                   ims = (basis_fns(i)%Ms+3)/2
  -                isym = basis_fns(i)%sym
  +                isym = cross_product_pg_sym(basis_fns(i)%sym, op_sym)
                   if (symunocc(ims, isym) /= 0) then
                       ! Found i.  Now find a...
                           ! It's cheaper to draw additional random numbers than
  
positive.code: 
          ! Conserve symmetry (spatial and spin) in selecting a.
          ims = (basis_fns(i)%Ms+3)/2
          isym = basis_fns(i)%sym
          ind = int(nbasis_sym_spin(ims,isym)*genrand_real2())+1
          if (nbasis_sym_spin(ims,isym) == 0) then
              ! No orbitals with the correct symmetry.
  
negative.code:         if (genrand_real2() < pattempt_single) then
  
              ! 2a. Select orbital to excite from and orbital to excit into.
              call choose_ia_mol(gamma_sym, cdet%f, cdet%occ_list, cdet%symunocc, connection%from_orb(1), &
                                 connection%to_orb(1), allowed_excitation)
              connection%nexcit = 1
  
              if (allowed_excitation) then
                  ! 3a. Probability of generating this excitation.
                  pgen = pattempt_single*calc_pgen_single_mol(gamma_sym, cdet%occ_list, cdet%symunocc, connection%to_orb(1))
  
                  ! 4a. Parity of permutation required to line up determinants.
                  call find_excitation_permutation1(cdet%f, connection)
  