howto:cdft
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
howto:cdft [2018/11/01 08:57] – [CDFT in summary] nholmber | howto:cdft [2018/11/01 09:20] – [Defining CDFT SCF parameters] nholmber | ||
---|---|---|---|
Line 83: | Line 83: | ||
Settings for the CDFT SCF loop are controlled by the input section [[inp> | Settings for the CDFT SCF loop are controlled by the input section [[inp> | ||
- | <note important> | + | <note important> |
<code cp2k> | <code cp2k> | ||
&QS | &QS | ||
... | ... | ||
- | & | ||
- | ... | ||
- | &END BECKE_CONSTRAINT | ||
! CDFT loop settings | ! CDFT loop settings | ||
+ | ! Please note that prior to CP2K version 7.0, | ||
+ | ! Becke constraints were separate from the CDFT section | ||
&CDFT | &CDFT | ||
TYPE_OF_CONSTRAINT BECKE | TYPE_OF_CONSTRAINT BECKE | ||
+ | ! Compute CDFT charges? | ||
+ | ATOMIC_CHARGES | ||
+ | ! Constraint strength and target values | ||
+ | ! Give one value per constraint | ||
+ | STRENGTH | ||
+ | TARGET | ||
+ | ! Constraint definitions, | ||
+ | & | ||
+ | ATOMS 1 | ||
+ | COEFF 1 | ||
+ | CONSTRAINT_TYPE CHARGE | ||
+ | &END ATOM_GROUP | ||
+ | ! No constraint applied but calculate charges | ||
+ | & | ||
+ | ATOMS 2 | ||
+ | &END DUMMY_ATOMS | ||
+ | ! CDFT convergence and optimizer settings | ||
& | & | ||
- | TYPE BECKE_CONSTRAINT | + | TYPE CDFT_CONSTRAINT |
EXTRAPOLATION_ORDER 2 | EXTRAPOLATION_ORDER 2 | ||
MAX_SCF 10 | MAX_SCF 10 | ||
! Convergence threshold | ! Convergence threshold | ||
EPS_SCF 1.0E-3 | EPS_SCF 1.0E-3 | ||
- | ! Optimizer selection: | + | ! Optimizer selection: |
+ | ! Now Newton' | ||
OPTIMIZER NEWTON_LS | OPTIMIZER NEWTON_LS | ||
- | ! Optimizer step size | + | ! Optimizer |
STEP_SIZE -1.0 | STEP_SIZE -1.0 | ||
! Note that the section CDFT_OPT exists in CP2K version >= 6.1 | ! Note that the section CDFT_OPT exists in CP2K version >= 6.1 | ||
Line 111: | Line 128: | ||
CONTINUE_LS | CONTINUE_LS | ||
FACTOR_LS 0.5 | FACTOR_LS 0.5 | ||
- | ! Finite difference settings for calculation of Jacobian matrix | + | ! Finite difference settings for Jacobian matrix |
JACOBIAN_STEP 1.0E-2 | JACOBIAN_STEP 1.0E-2 | ||
JACOBIAN_FREQ 1 1 | JACOBIAN_FREQ 1 1 | ||
Line 117: | Line 134: | ||
JACOBIAN_RESTART FALSE | JACOBIAN_RESTART FALSE | ||
&END CDFT_OPT | &END CDFT_OPT | ||
- | & | + | &END |
+ | ! Settigs specific to Becke constraints | ||
+ | & | ||
+ | ... | ||
+ | &END BECKE_CONSTRAINT | ||
+ | ! Print information about CDFT calculation | ||
+ | & | ||
+ | &EACH | ||
+ | QS_SCF 1 | ||
+ | &END EACH | ||
+ | COMMON_ITERATION_LEVELS 2 | ||
+ | ADD_LAST NUMERIC | ||
+ | FILENAME ./${NAME} | ||
+ | &END PROGRAM_RUN_INFO | ||
&END CDFT | &END CDFT | ||
&END QS | &END QS | ||
</ | </ | ||
- | The structure of this input section is quite straightforward. The keyword [[inp> | + | The structure of this input section is quite straightforward |
+ | - Constraint definitions (type, which atoms to include, constraint target, etc) | ||
+ | - CDFT SCF loop settings (solver, convergence criterion, etc) | ||
+ | - Constraint weight function specific settings (Becke/ | ||
+ | |||
+ | In the above example, a Becke constraint is selected using the keyword [[inp> | ||
+ | |||
+ | {{ howto: | ||
+ | **Figure 3.** Using a fragment based CDFT constraint. The system is first divided into two fragments with atomic positions fixed in the same configuration as in the full system. The electron and spin densities of the fragment systems are then saved to cube files and subsequently used as input files for the CDFT calculation, | ||
+ | |||
+ | The OUTER_SCF section within the CDFT section defines settings for the CDFT SCF loop. The keyword [[inp> | ||
Above, for instance, the Jacobian is explicitly calculated every CDFT SCF iteration and MD step by perturbing each constraint Lagragian using a first order forward difference stencil with a step size of $10^{-2}$. The Newton step size is optimized with backtracking line search using the update formula $\alpha_n = 0.5*\alpha_{n-1}$ for a maximum of 5 steps as long as the CDFT constraint error decreases. | Above, for instance, the Jacobian is explicitly calculated every CDFT SCF iteration and MD step by perturbing each constraint Lagragian using a first order forward difference stencil with a step size of $10^{-2}$. The Newton step size is optimized with backtracking line search using the update formula $\alpha_n = 0.5*\alpha_{n-1}$ for a maximum of 5 steps as long as the CDFT constraint error decreases. |
howto/cdft.txt · Last modified: 2024/01/03 13:20 by oschuett