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

NonSingletCI Class, AP1roGSDGeneralizedSen-o Wfn #92

Open
wants to merge 191 commits into
base: master
Choose a base branch
from

Conversation

q-pratz-chem
Copy link
Collaborator

@q-pratz-chem q-pratz-chem commented Jan 9, 2025

Overview

This PR introduces the following key features and fixes:


1. NonSingletCI Class

A new NonSingletCI class derived from the GenCIWfn class is added to construct wavefunctions comprising configurations with unequal alpha and beta spin orbitals. Key highlights include:

  • Error Fix: Resolves incorrect indexing of k in updating nword in genciwfn.cpp, addressing an issue reported in PR #82 Update genciwfn.cpp #91.
  • Overwritten Methods:
    • fill_hartreefock_det: Constructs a single-bitstring representation of all spin orbitals (occupied, virtual, alpha, and beta).
      • Example: For 6 basis functions (12 spin orbitals) and 4 electrons, the Hartree-Fock bitstring is 000011000011, where the left (right) half represents beta (alpha) spin orbitals.
      • Note: Bitstrings are typically read from right to left, as the least significant bit is on the right. In the GenCI wavefunction, the bitstring is indexed as [2n-1, 2n-2, ..., 2, 1, 0], where n is the number of spatial orbitals. The spin orbitals are ordered from 0 to 2n-1 as [φ(α,0), ..., φ(α,n-1), φ(β,n+0), ..., φ(β,2n-1)].
    • add_excited_det: Adds configurations based on a specified excitation order and reference configuration.
      • Current Features: Supports two excitation types: paired doubles and non-spin-preserving singles. This aligns with the geminal function under implementation, generating combinations of non-spin-preserving singles and paired doubles to create new configurations.
  • Sparse Matrix Support: Introduces a new add_row function in sparseop.cpp tailored for NonSingletCI to include matrix elements and a new `update' function.

2. Geminal Wavefunction (AP1roGSDGeneralizedSen-o)

Implements a new geminal wavefunction consisting of:

  • AP1roG (pCCD): Paired doubles.
  • Singles ('Sen-o'): Excites a single electron from doubly occupied spin-orbital pairs under the non-spin-preserving condition ('Generalized').

Implementation Details:

  • C++ Implementation:
    • Added in the ap1rogen.cpp file, based on the NonSingletCI class.
    • Introduces a new storage structure DetExcParamIndx for efficient management of bitstring representations (determinants) and their associated parameter indices (singles and doubles).
  • Ryser’s Algorithm:
    • Used for calculating permanents to implement overlaps and derivatives efficiently.
  • Testing Progress:
    • Basic testing is in progress using Pytest.
    • Note: The diff_ridders function from derivcheck.py (which requires installation via pip install derivcheck) currently fails due to an assertion error when comparing numerical and analytical derivatives.

This PR lays the groundwork for future development and testing, particularly in the context of advanced geminal wavefunctions and their application.

msricher and others added 30 commits August 22, 2024 12:02
@q-pratz-chem q-pratz-chem requested a review from msricher January 9, 2025 18:57
… and two_ao; update the add_row function by using this generalized hamiltonian
… are listed first; now initializing a nonsingletciwfn with FullCI wfn filled with excitation order 0 - ensuring HF, 1,2,3 and 4; Introduced sign_excite and sign_swap function to calculate the sign resulting from the ordering of the annihilation and creation operators used to generate the excited configurations; set first element of overlap to 1 corresponding to HF; if excitation_inds = -1 meaning empty then set the single and double permanents to zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants