-
Notifications
You must be signed in to change notification settings - Fork 11
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
FanPT (Perturbation Theory for Parameterized Projected Schrodinger Equation) #62
Comments
Initial implementation of FanPT in PyCI #70This initial implementation is based on the original FanPT code written by Ramon's Group to the pilot code Fanpy. Here is a brief description of the code: pyci/fanci/fanpt_wrapper.pyContains the FanPT solver (solve_fanpt) function and additional functions. pyci/fanpt/base_fanpt_container.pyDefines general FanPT class (FANPTContainer). It is used by derived classes FANPTContainerEParam and FANPTContainerEFree. pyci/fanpt/fanpt_cont_e_param.pyDefine a FANPTContainerEParam class, which contains the data and methods required for a FanPT calculation using energy as a parameter. pyci/fanpt/fanpt_cont_e_free.pyDefine a FANPTContainerEFree class containing the data and methods required for an energy-free FanPT calculation. It is derived from FANPTContainerEParam. pyci/fanpt/fanpt_constant_terms.pyDefine the FANPTConstantTerms class, which contains the constant terms of the FanPY system of equations and methods. pyci/fanpt/fanpt_updater.pyContains the FANPTUpdater class, which is used by the FanPT solver to update FanCI parameters and energy. pyci/test/test_fanpt.pyIncludes two tests for FanPT solver, using Energy Free and Energy as Parameter flavors. There's room for improvement in code design and file organization, especially in matching the PyCI interface for seamless integration. |
@msricher and @marco-2023 can you look at this and see what the next step should be? I have a feeling some of the data classes may be better off as named tuples. |
I've looked at it and I think this is fine the way it is. The next step might be making sure that pCCD+S can now be reliably solved, so that I can do a better test of the stochastic optimization? |
Ok, sounds good. Thanks for looking at it @msricher . I agree with your next step. @carlosevmoura , we'll do a formal code review on it (I haven't seen the pull request but I'm way behind). That will usually lead to some changes. But then we will have a functional version. I anticipate a refactor at some point of a lot of FanCI stuff, but I am too overwhelmed to think about that for now. |
We are implementing FanPT. The basic idea is in the recent paper.
Recall that the FanCI equations are
where$\mathcal{P}$ is the projection space (user-specified), $\mathbf{c}$ are the wavefunction parameters, and the nonlinear FanCI equations are usually overdetermined and solved in a least-squares sense. The set of determinants $\mathbf{n} \in \mathcal{S}$ is defined as the space of determinants that are linked to determinants in $\mathcal{P}$ by the Hamiltonian, typically just single- and double-replacements of the occupied orbitals.
We write the Hamiltonian as a zeroth-order part (for which the FANCI equations have been solved) and a first-order part,
Going through some math, we get the equation
The key ingredients are the Hamiltonian matrix elements. The right hand side is easy to evaluate in terms of transition-2DMs, which appear on the right-hand-side,
$$
\text{RHS} = \text{Tr}[\hat{H}'(\lambda_{0}){pqrs} \Gamma{pqrs}(\lambda_{0})]
$$
My tendency would be to implement this as some functions that build the linear equations to solve, and then solve them. I realize that the (old) implementation is somewhat more general, but we may also want to focus on a specific one or two flavors if it makes the code a lot simpler/faster. Ramon, what do you think the best flavors are? (It will depend on how much computational complexity and code complexity we add by writing a general treatment.)
The text was updated successfully, but these errors were encountered: