Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CIS, CISD and other options for GAS-ACI calculations #355

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion forte/register_forte_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ def register_driver_options(options):
options.add_double("MS", None, "Projection of spin onto the z axis")

options.add_str(
"ACTIVE_REF_TYPE", "CAS", ["HF", "CAS", "GAS", "GAS_SINGLE", "CIS", "CID", "CISD", "DOCI"],
"ACTIVE_REF_TYPE", "CAS", ["HF", "CAS", "GAS", "GAS_SINGLE", "CIS", "CID", "CISD", "DOCI","GAS_CIS", "GAS_CISD", "GAS_CID"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need "GAS_CIS", "GAS_CISD", "GAS_CID" when we already have "CIS", "CID", "CISD"? Can't the user just use these last ones and the code automatically understands if one is using GAS or not? Unless these are supposed to be both valid for GAS (e.g. "CIS" and "GAS_CIS" are both valid and give different results in a GAS computation) then this is potentially a confusing redundancy. Also, I would suggest using "GAS_SINGLE_DET" instead of "GAS_SINGLE".

"Initial guess for active space wave functions"
)

options.add_int("GAS_REF_COUNT", 6, "The number of GAS used to build the active space reference (can be used for initial guess for ACI)")

options.add_bool("WRITE_RDM", False, "Save RDMs to ref_rdms.json for external computations")

Expand Down
23 changes: 11 additions & 12 deletions forte/sci/aci.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ void AdaptiveCI::startup() {

gas_iteration_ = false;
if (options_->get_str("ACTIVE_REF_TYPE") == "GAS_SINGLE" or
options_->get_str("ACTIVE_REF_TYPE") == "GAS") {
options_->get_str("ACTIVE_REF_TYPE") == "GAS" or
options_->get_str("ACTIVE_REF_TYPE") == "GAS_CIS" or
options_->get_str("ACTIVE_REF_TYPE") == "GAS_CISD" or
options_->get_str("ACTIVE_REF_TYPE") == "GAS_CID") {
gas_iteration_ = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This connects to the point above. The use of GAS should be triggered by the user passing a GAS space, not by choosing an additional keyword.

}

Expand Down Expand Up @@ -569,19 +572,15 @@ void AdaptiveCI::pre_iter_preparation() {
gas_single_criterion_ = ref.gas_single_criterion();
gas_double_criterion_ = ref.gas_double_criterion();
gas_electrons_ = ref.gas_electrons();
rel_gas_mos.clear();
for (size_t gas_count = 0; gas_count < 6; gas_count++) {
std::string space = "GAS" + std::to_string(gas_count + 1);
std::vector<size_t> relative_mo;
auto gas_mo = mo_space_info_->absolute_mo(space);
for (size_t i = 0, imax = gas_mo.size(); i < imax; ++i) {
relative_mo.push_back(re_ab_mo[gas_mo[i]]);
}
if (!relative_mo.empty()) {
gas_num_ = gas_num_ + 1;
}

relative_gas_mo_.push_back(relative_mo);
auto abs_mos = mo_space_info_->absolute_mo(space);
if (abs_mos.size() == 0)
continue;
rel_gas_mos.push_back(mo_space_info_->pos_in_space(space, "ACTIVE"));
}
gas_num_ = rel_gas_mos.size();
}
if ((options_->get_bool("SCI_CORE_EX")) and (root_ > 0)) {

Expand Down Expand Up @@ -950,7 +949,7 @@ void AdaptiveCI::print_gas_wfn(DeterminantHashVec& space, std::shared_ptr<psi::M
std::vector<int> occ_b;
std::vector<int> vir_a;
std::vector<int> vir_b;
for (const auto& p : relative_gas_mo_[gas_count]) {
for (const auto& p : rel_gas_mos[gas_count]) {
if (det.get_alfa_bit(p)) {
occ_a.push_back(p);
} else {
Expand Down
2 changes: 1 addition & 1 deletion forte/sci/aci.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class AdaptiveCI : public SelectedCIMethod {
std::vector<std::vector<int>> gas_electrons_;

/// Relative mo in the entire active space for each GAS;
std::vector<std::vector<size_t>> relative_gas_mo_;
std::vector<std::vector<size_t>> rel_gas_mos;
};

} // namespace forte
Expand Down
395 changes: 246 additions & 149 deletions forte/sci/gasaci_build_F.cc

Large diffs are not rendered by default.

Loading