Skip to content

Commit

Permalink
add exchange gradients and density broyden
Browse files Browse the repository at this point in the history
  • Loading branch information
pitsteinbach96 authored and thfroitzheim committed Aug 6, 2024
1 parent 1665c59 commit 4ce7c8b
Show file tree
Hide file tree
Showing 16 changed files with 947 additions and 15 deletions.
33 changes: 33 additions & 0 deletions src/tblite/exchange.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module tblite_exchange
use mctc_env, only : wp
use tblite_mulliken_kfock, only : mulliken_kfock_type, new_mulliken_exchange
use mctc_io, only : structure_type
use tblite_param_exchange, only : exchange_record
use tblite_exchange_type, only : exchange_type
use tblite_basis_type, only : basis_type
implicit none
private
public :: new_exchange

contains
subroutine new_exchange(self, mol, hardness, par, bas)
!> Instance of the multipole container
class(exchange_type), allocatable ,intent(inout) :: self
!> Molecular structure data
type(structure_type), intent(in) :: mol
real(wp), intent(in) :: hardness(:)
type(exchange_record) :: par
type(basis_type) :: bas

if (par%mulliken) then
block
type(mulliken_kfock_type), allocatable :: tmp
allocate(tmp)
call new_mulliken_exchange(tmp, mol, hardness, .false., .false., par%frscale, &
& par%omega, par%lrscale, par%average, par%expsmooth, bas)
call move_alloc(tmp, self)
end block
end if
end subroutine

end module tblite_exchange
34 changes: 34 additions & 0 deletions src/tblite/exchange/cache.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module tblite_exchange_cache
use mctc_env, only : wp, dp
use mctc_io, only : structure_type
use tblite_coulomb_ewald, only : get_alpha
use tblite_wignerseitz, only : wignerseitz_cell, new_wignerseitz_cell
implicit none
private

public :: exchange_cache


type :: exchange_cache
real(dp), allocatable :: curr_D(:, :)
real(dp), allocatable :: ref_D(:, :)
real(dp), allocatable :: prev_F(:, :)
real(dp), allocatable :: gamma_(:,:)
contains
procedure :: update
end type exchange_cache


contains


subroutine update(self, mol)
!> Instance of the electrostatic container
class(exchange_cache), intent(inout) :: self
!> Molecular structure data
type(structure_type), intent(in) :: mol


end subroutine update

end module tblite_exchange_cache
21 changes: 21 additions & 0 deletions src/tblite/exchange/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file is part of tblite.
# SPDX-Identifier: LGPL-3.0-or-later
#
# tblite is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# tblite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with tblite. If not, see <https://www.gnu.org/licenses/>.

srcs += files(
'cache.f90',
'mulliken_kfock.f90',
'type.f90'
)
Loading

0 comments on commit 4ce7c8b

Please sign in to comment.