From ce87a620868e43c1742b6c385705753db86ffd4f Mon Sep 17 00:00:00 2001 From: Kevin Gasperich Date: Wed, 19 Feb 2020 12:47:22 -0600 Subject: [PATCH] starting complex determinants --- src/determinants/create_excitations.irp.f | 27 ++++++++++++++++++++ src/utils_complex/qp2-pbc-diff.txt | 30 +++++++++++++++++++---- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/src/determinants/create_excitations.irp.f b/src/determinants/create_excitations.irp.f index cec87901..f3b19afa 100644 --- a/src/determinants/create_excitations.irp.f +++ b/src/determinants/create_excitations.irp.f @@ -80,6 +80,33 @@ subroutine build_singly_excited_wavefunction(i_hole,i_particle,ispin,det_out,coe enddo end +subroutine build_singly_excited_wavefunction_complex(i_hole,i_particle,ispin,det_out,coef_out) + implicit none + BEGIN_DOC + ! Applies the single excitation operator : a^{dager}_(i_particle) a_(i_hole) of + ! spin = ispin to the current wave function (psi_det, psi_coef) + END_DOC + integer, intent(in) :: i_hole,i_particle,ispin + integer(bit_kind), intent(out) :: det_out(N_int,2,N_det) + complex*16, intent(out) :: coef_out(N_det,N_states) + + integer :: k + integer :: i_ok + double precision :: phase + do k=1,N_det + coef_out(k,:) = psi_coef(k,:) + det_out(:,:,k) = psi_det(:,:,k) + call do_single_excitation(det_out(1,1,k),i_hole,i_particle,ispin,i_ok) + if (i_ok == 1) then + call get_phase(psi_det(1,1,k), det_out(1,1,k),phase,N_int) + coef_out(k,:) = phase * coef_out(k,:) + else + coef_out(k,:) = (0.d0,0.d0) + det_out(:,:,k) = psi_det(:,:,k) + endif + enddo +end + logical function is_spin_flip_possible(key_in,i_flip,ispin) implicit none BEGIN_DOC diff --git a/src/utils_complex/qp2-pbc-diff.txt b/src/utils_complex/qp2-pbc-diff.txt index c0980e13..4e2cd568 100644 --- a/src/utils_complex/qp2-pbc-diff.txt +++ b/src/utils_complex/qp2-pbc-diff.txt @@ -1,10 +1,22 @@ +------------------------------------------------------------------------------------- +current: + +determinants: + TODO + create_excitations + do_single_excitation + use symmetry rules to simplify? + should this be general, or should we only allow singles that conserve momentum? + density_matrix + ... + + DONE + create_excitations + build_singly_excited_wavefunction{_complex} + -2e integrals printed from pyscf are in physicists' notation -mo energies from pyscf include ewald correction; in qp we just fold that into the nuclear repulsion -this may need to change for addition/removal of electrons (shift in enuc depends on number of electrons) - - +------------------------------------------------------------------------------------- for complex data, add extra dim (size 2) and treat as real in EZFIO.cfg @@ -34,6 +46,8 @@ translational symmetry: I + J = K + L kconserv(I,J,K)=L +------------------------------------------------------------------------------ + TODO: symmetry restructure arrays? @@ -71,6 +85,12 @@ later: NOTES: + 2e integrals printed from pyscf are in physicists' notation + + mo energies from pyscf include ewald correction; in qp we just fold that into the nuclear repulsion + this may need to change for addition/removal of electrons + (shift in enuc depends on number of electrons) + 3-index integrals = \sum_\mu (ik|\mu)(jl|\mu) store (ik|\mu) for I<=K