Octopus
xc_lrc.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!! Copyright (C) 2025 N. Tancogne-Dejean
3!!
4!! This program is free software; you can redistribute it and/or modify
5!! it under the terms of the GNU General Public License as published by
6!! the Free Software Foundation; either version 2, or (at your option)
7!! any later version.
8!!
9!! This program is distributed in the hope that it will be useful,
10!! but WITHOUT ANY WARRANTY; without even the implied warranty of
11!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12!! GNU General Public License for more details.
13!!
14!! You should have received a copy of the GNU General Public License
15!! along with this program; if not, write to the Free Software
16!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17!! 02110-1301, USA.
18!!
19
20#include "global.h"
21
22module xc_lrc_oct_m
23 use debug_oct_m
24 use global_oct_m
27 use parser_oct_m
29
30 implicit none
31
32 private
33 public :: &
34 xc_lrc_t, &
36
41 type xc_lrc_t
42 private
43 real(real64), public :: alpha
44 real(real64), public :: proca_a_zero
45 real(real64), public :: proca_a_one
46 end type xc_lrc_t
47
48contains
49
50 subroutine xc_lrc_init(this, namespace, dim, periodic_dim)
51 type(xc_lrc_t), intent(out) :: this
52 type(namespace_t), intent(in) :: namespace
53 integer, intent(in) :: dim, periodic_dim
54
55 push_sub(xc_lrc_init)
56
57 !%Variable XCKernelLRCAlpha
58 !%Type float
59 !%Default 0.0
60 !%Section Hamiltonian::XC
61 !%Description
62 !% Set to a non-zero value to add a long-range correction for solids to the kernel.
63 !% This is the <math>\alpha</math> parameter defined in S. Botti <i>et al.</i>, <i>Phys. Rev. B</i>
64 !% 69, 155112 (2004). The <math>\Gamma = \Gamma` = 0</math> term <math>-\alpha/q^2</math> is taken
65 !% into account by introducing an additional pole to the polarizability (see R. Stubner
66 !% <i>et al.</i>, <i>Phys. Rev. B</i> 70, 245119 (2004)). The rest of the terms are included by
67 !% multiplying the Hartree term by <math>1 - \alpha / 4 \pi</math>. The use of non-zero
68 !% <math>\alpha</math> in combination with <tt>HamiltonianVariation</tt> = <tt>V_ext_only</tt>
69 !% corresponds to account of only the <math>\Gamma = \Gamma` = 0</math> term.
70 !% Applicable only to isotropic systems. (Experimental)
71 !%End
72
73 call parse_variable(namespace, 'XCKernelLRCAlpha', m_zero, this%alpha)
74 if (abs(this%alpha) > m_epsilon) then
75 call messages_experimental("Long-range correction to kernel", namespace=namespace)
76
77 if (periodic_dim < dim) then
78 message(1) = 'The use of the LRC kernel for non-periodic dimensions makes no sense.'
79 call messages_warning(1, namespace=namespace)
80 end if
81
82 !%Variable XCProcaResonantTerm
83 !%Type float
84 !%Default 0.0
85 !%Section Hamiltonian :: XC
86 !%Description
87 !% This variable is the a_0 parameter in the Proca equation
88 !% Set to a nonzero value to give to the Maxwell equation a linear term correction as suggested in
89 !% J. K. Dewhurst <i>et al.</i>, <i>Phys. Rev. B</i> 111, L060302 (2025).
90 !%End
91 call parse_variable(namespace, 'XCProcaResonantTerm', m_zero, this%proca_a_zero)
92
93 !%Variable XCProcaDamping
94 !%Type float
95 !%Default 0.0
96 !%Section Hamiltonian :: XC
97 !%Description
98 !% This variable is the a_1 parameter in the Proca equation
99 !% Set to a nonzero value to give to the Maxwell equation a first-order derivative term correction as suggested in
100 !% J. K. Dewhurst <i>et al.</i>, <i>Phys. Rev. B</i> 111, L060302 (2025).
101 !%End
102 call parse_variable(namespace, 'XCProcaDamping', m_zero, this%proca_a_one)
103 if (abs(this%proca_a_zero) > m_epsilon .or. abs(this%proca_a_one) > m_epsilon) then
104 call messages_experimental("Proca equation", namespace=namespace)
105 end if
106 end if
107
108 pop_sub(xc_lrc_init)
109 end subroutine xc_lrc_init
110
111end module xc_lrc_oct_m
112
113!! Local Variables:
114!! mode: f90
115!! coding: utf-8
116!! End:
real(real64), parameter, public m_zero
Definition: global.F90:191
real(real64), parameter, public m_epsilon
Definition: global.F90:207
subroutine, public messages_warning(no_lines, all_nodes, namespace)
Definition: messages.F90:525
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:162
subroutine, public messages_experimental(name, namespace)
Definition: messages.F90:1063
subroutine, public xc_lrc_init(this, namespace, dim, periodic_dim)
Definition: xc_lrc.F90:146
Parameters for the long–range–corrected (LRC) XC kernel (and optional Proca terms).
Definition: xc_lrc.F90:136