1&QS
2  METHOD GPW
3  EPS_DEFAULT 1.0E-12
4  EXTRAPOLATION ASPC
5  EXTRAPOLATION_ORDER 3
6  &CDFT
7    TYPE_OF_CONSTRAINT BECKE
8    @IF ( ${BECKE_ATOMIC_CHARGES} == TRUE )
9      ! Defaults to false
10      ATOMIC_CHARGES  TRUE
11    @ENDIF
12    STRENGTH        0.0 0.0
13    ! Target values from the constraints
14    ! For charge density constraints, the target equals sum_i coeff_i * N_i
15    ! where N_i is the number of VALENCE electrons on i
16    ! For magnetization density constraints, the sum_i coeff_i * M_i
17    ! where M_i = N_i(alpha)-N_i(beta)
18    TARGET          0.0 0.0
19    @IF ( ${BECKE_FRAGMENT} == TRUE )
20      ! Apply two spin constraints
21      &ATOM_GROUP
22        ATOMS           1
23        COEFF           1
24        FRAGMENT_CONSTRAINT
25        CONSTRAINT_TYPE MAGNETIZATION
26      &END ATOM_GROUP
27      &ATOM_GROUP
28        ATOMS           2
29        COEFF           1
30        FRAGMENT_CONSTRAINT
31        CONSTRAINT_TYPE MAGNETIZATION
32      &END ATOM_GROUP
33      FRAGMENT_A_FILE_NAME He+-noconstraint-ELECTRON_DENSITY-1_0.cube
34      FRAGMENT_A_SPIN_FILE He+-noconstraint-SPIN_DENSITY-1_0.cube
35      FRAGMENT_B_FILE_NAME H-noconstraint-ELECTRON_DENSITY-1_0.cube
36      FRAGMENT_B_SPIN_FILE H-noconstraint-SPIN_DENSITY-1_0.cube
37      ! Constrain fragment spin densities in such way that
38      ! A has one alpha electron, B one beta electron
39      FLIP_FRAGMENT_A FALSE
40      FLIP_FRAGMENT_B TRUE
41    @ENDIF
42    @IF ( ${BECKE_FRAGMENT} == FALSE )
43      ! Apply a spin constraint in addition to the charge difference constraint
44      &ATOM_GROUP
45        ATOMS          1
46        COEFF          1
47        CONSTRAINT_TYPE MAGNETIZATION
48      &END
49      &ATOM_GROUP
50        ATOMS           1..2
51        COEFF           1 -1
52        CONSTRAINT_TYPE CHARGE
53      &END ATOM_GROUP
54    @ENDIF
55    &OUTER_SCF ON
56      EPS_SCF 1.0e-0
57      TYPE CDFT_CONSTRAINT
58      OPTIMIZER BROYDEN
59      BISECT_TRUST_COUNT 8
60      EXTRAPOLATION_ORDER 2
61      MAX_SCF  ${MAX_SCF}
62      STEP_SIZE -0.001
63      &CDFT_OPT
64        BROYDEN_TYPE BT1
65      &END CDFT_OPT
66    &END
67    &BECKE_CONSTRAINT
68      @IF ( ${BECKE_ADJUST_SIZE} == TRUE )
69        ! Defaults to false
70        ADJUST_SIZE     TRUE
71        ATOMIC_RADII 0.460 0.320
72      @ENDIF
73      @IF ( ${BECKE_CUTOFF_ELEMENT} == TRUE )
74        CUTOFF_TYPE     ELEMENT
75        ELEMENT_CUTOFF  2.0 2.0
76      @ENDIF
77      @IF ( ${BECKE_GLOBAL_CUTOFF} == TRUE )
78        CUTOFF_TYPE     GLOBAL
79        GLOBAL_CUTOFF   2.0
80      @ENDIF
81      @IF ( ${BECKE_IN_MEMORY} == TRUE )
82        ! Defaults to false
83        IN_MEMORY       TRUE
84      @ENDIF
85      @IF ( ${BECKE_CAVITY_CONFINE} == TRUE )
86        ! Defaults to FALSE
87        CAVITY_CONFINE  TRUE
88        EPS_CAVITY      1.0E-6
89        CAVITY_SHAPE    ${BECKE_CAVITY_SHAPE}
90        ! For shape single
91        CAVITY_RADIUS   1.3
92        CAVITY_USE_BOHR        FALSE
93      @ENDIF
94      @IF ( ${BECKE_SHOULD_SKIP} == TRUE )
95        ! Defaults to false
96        SHOULD_SKIP     TRUE
97      @ENDIF
98      @IF ( ${BECKE_CAVITY_PRINT} == TRUE )
99        ! Defaults to false
100        CAVITY_PRINT    TRUE
101      @ENDIF
102    &END BECKE_CONSTRAINT
103    &PROGRAM_RUN_INFO ON
104      &EACH
105        QS_SCF 1
106      &END EACH
107      COMMON_ITERATION_LEVELS 2
108      ADD_LAST NUMERIC
109      FILENAME ./${PROJECT_NAME}
110    &END PROGRAM_RUN_INFO
111  &END CDFT
112&END QS
113