@@ -43,6 +43,9 @@ struct ASCISettings {
4343 size_t max_refine_iter = 6 ;
4444 double refine_energy_tol = 1e-6 ;
4545
46+ int n_imp_orbs = -1 ;
47+ bool no_constraint_search = false ;
48+
4649 bool grow_with_rot = false ;
4750 size_t rot_size_start = 1000 ;
4851
@@ -66,6 +69,16 @@ asci_contrib_container<wfn_t<N>> asci_contributions_standard(
6669 std::vector<uint32_t > occ_alpha, vir_alpha;
6770 std::vector<uint32_t > occ_beta, vir_beta;
6871 asci_pairs.reserve (asci_settings.pair_size_max );
72+
73+ // For considering only doubles among the impurity
74+ // orbitals, if applicable.
75+ size_t n_imp_orbs = asci_settings.n_imp_orbs >= 0 ? asci_settings.n_imp_orbs : norb;
76+ std::vector<uint32_t > occ_alpha_as, vir_alpha_as;
77+ std::vector<uint32_t > occ_beta_as, vir_beta_as;
78+ std::vector<uint32_t > as_orbs ( n_imp_orbs );
79+ for ( int ii = 0 ; ii < as_orbs.size (); ii++ )
80+ as_orbs[ii] = ii;
81+
6982 for (size_t i = 0 ; i < ncdets; ++i) {
7083 // Alias state data
7184 auto state = *(cdets_begin + i);
@@ -100,23 +113,26 @@ asci_contrib_container<wfn_t<N>> asci_contributions_standard(
100113 eps_beta.data (), Td_pq, norb, G_red, norb, V_red, norb, h_el_tol,
101114 h_diag, E_ASCI, ham_gen, asci_pairs);
102115
103- if (not asci_settings.just_singles ) {
116+ if (!asci_settings.just_singles ) {
117+ // Potentially consider only doubles from impurity orbitals
118+ bitset_to_occ_vir_as (norb, state_alpha, occ_alpha_as, vir_alpha_as, as_orbs);
119+ bitset_to_occ_vir_as (norb, state_beta, occ_beta_as, vir_beta_as, as_orbs);
104120 // Doubles - AAAA
105121 append_ss_doubles_asci_contributions<N / 2 , 0 >(
106- coeff, state, state_alpha, occ_alpha, vir_alpha, occ_beta ,
122+ coeff, state, state_alpha, occ_alpha_as, vir_alpha_as, occ_beta_as ,
107123 eps_alpha.data (), G_pqrs, norb, h_el_tol, h_diag, E_ASCI, ham_gen,
108124 asci_pairs);
109125
110126 // Doubles - BBBB
111127 append_ss_doubles_asci_contributions<N / 2 , N / 2 >(
112- coeff, state, state_beta, occ_beta, vir_beta, occ_alpha ,
128+ coeff, state, state_beta, occ_beta_as, vir_beta_as, occ_alpha_as ,
113129 eps_beta.data (), G_pqrs, norb, h_el_tol, h_diag, E_ASCI, ham_gen,
114130 asci_pairs);
115131
116132 // Doubles - AABB
117133 append_os_doubles_asci_contributions (
118- coeff, state, state_alpha, state_beta, occ_alpha, occ_beta, vir_alpha ,
119- vir_beta , eps_alpha.data (), eps_beta.data (), V_pqrs, norb, h_el_tol,
134+ coeff, state, state_alpha, state_beta, occ_alpha_as, occ_beta_as, vir_alpha_as ,
135+ vir_beta_as , eps_alpha.data (), eps_beta.data (), V_pqrs, norb, h_el_tol,
120136 h_diag, E_ASCI, ham_gen, asci_pairs);
121137 }
122138
@@ -450,7 +466,7 @@ std::vector<wfn_t<N>> asci_search(
450466 // Expand Search Space with Connected ASCI Contributions
451467 auto pairs_st = clock_type::now ();
452468 asci_contrib_container<wfn_t <N>> asci_pairs;
453- if (world_size == 1 )
469+ if (world_size == 1 || asci_settings. no_constraint_search )
454470 asci_pairs = asci_contributions_standard (
455471 asci_settings, cdets_begin, cdets_end, E_ASCI, C, norb, Tu_pq, Td_pq,
456472 G_red, V_red, G_pqrs, V_pqrs, ham_gen);
0 commit comments