Coverage for eminus/xc/lda_c_chachiyo_mod.py: 100.00%
10 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 11:47 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 11:47 +0000
1# SPDX-FileCopyrightText: 2021 The eminus developers
2# SPDX-License-Identifier: Apache-2.0
3"""Modified Chachiyo LDA correlation.
5Reference: Comput. Theor. Chem. 1172, 112669.
6"""
8from .lda_c_chachiyo import lda_c_chachiyo, lda_c_chachiyo_spin
11def lda_c_chachiyo_mod(n, **kwargs):
12 """Modified Chachiyo parametrization of the correlation functional (spin-paired).
14 Corresponds to the functional with the label LDA_C_CHACHIYO_MOD and ID 307 in Libxc.
16 Reference: Comput. Theor. Chem. 1172, 112669.
18 Args:
19 n: Real-space electronic density.
21 Keyword Args:
22 **kwargs: Throwaway arguments.
24 Returns:
25 Modified Chachiyo correlation energy density and potential.
26 """
27 # Same as lda_c_chachiyo
28 return lda_c_chachiyo(n, **kwargs)
31def chachiyo_scaling_mod(zeta):
32 """Weighting factor between the paramagnetic and the ferromagnetic case.
34 Reference: Comput. Theor. Chem. 1172, 112669.
36 Args:
37 zeta: Relative spin polarization.
39 Returns:
40 Weighting factor and its derivative.
41 """
42 gzeta = ((1 + zeta) ** (2 / 3) + (1 - zeta) ** (2 / 3)) / 2
43 fzeta = 2 * (1 - gzeta**3)
45 dfdzeta = -2 * gzeta**2 * (1 / (1 + zeta) ** (1 / 3) - 1 / (1 - zeta) ** (1 / 3))
46 return fzeta, dfdzeta
49def lda_c_chachiyo_mod_spin(n, zeta, **kwargs):
50 """Modified Chachiyo parametrization of the correlation functional (spin-polarized).
52 Corresponds to the functional with the label LDA_C_CHACHIYO_MOD and ID 307 in Libxc.
54 Reference: Comput. Theor. Chem. 1172, 112669.
56 Args:
57 n: Real-space electronic density.
58 zeta: Relative spin polarization.
60 Keyword Args:
61 **kwargs: Throwaway arguments.
63 Returns:
64 Modified Chachiyo correlation energy density and potential.
65 """
66 return lda_c_chachiyo_spin(n, zeta, weight_function=chachiyo_scaling_mod, **kwargs)