How to mix DFTB and normal XC calculation?

403 views
Skip to first unread message

ganli...@gmail.com

unread,
May 3, 2019, 8:11:51 AM5/3/19
to cp2k

 

Hi everyone in cp2k community,

I am very curious about if CP2K can EMBED or MIXED DFTB and normal XC calculation together. I noticed in the CP2K tests there was an example (regtest-embed/H2O_H2_pbe_mp2.inp) which EMBED pbe and mp2 sections together. So, I am set up a DFTB-MP2 embed calculation just like the example before. Unfortunately, I failed and got following message,

>>>>> 

application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0

[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=1

:

system msg for write_line failure : Bad file descriptor

<<<< 

what can I do next? I post my input file in the end. Any advice would be greatly appreciated!

 

Best regards

LinFeng

 

 

&GLOBAL                                                                                           

  PROJECT  h2o_h2_dftb

  PRINT_LEVEL HIGH

  RUN_TYPE ENERGY_FORCE

&END GLOBAL

 

&MULTIPLE_FORCE_EVALS

   FORCE_EVAL_ORDER 2 3 4 5

   MULTIPLE_SUBSYS T

  

&END MULTIPLE_FORCE_EVALS

 

&FORCE_EVAL

    METHOD EMBED

    &EMBED

       NGROUPS 1

       &MAPPING

          &FORCE_EVAL_EMBED

             &FRAGMENT 1

                1 3 

             &END

             &FRAGMENT 2

                4 5 

             &END

             &FRAGMENT 3

                1 5 

             &END

          &END

          &FORCE_EVAL 1

             &FRAGMENT 1

                1 3

                MAP 1

              &END

          &END

          &FORCE_EVAL 2

             &FRAGMENT 1

                1 2

                MAP 2

             &END

          &END

          &FORCE_EVAL 3

             &FRAGMENT 1

                1 5

                MAP 3

              &END

          &END

          &FORCE_EVAL 4

             &FRAGMENT 1

                1 2

                MAP 2

             &END

          &END

       &END

    &END EMBED

  &SUBSYS

    &CELL

      ABC [angstrom]  5.000   5.000  5.000

    &END CELL

    &KIND H

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q1

    &END KIND

    &KIND O

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q6

    &END KIND

 

    &COORD

  O      1.75  1.5  0.0  

  H      1.0   1.0  0.0  

  H      2.5   1.0  0.0   

  H      1.75  2.75  0.0  

  H      1.75  3.50 0.0   

    &END

  &END SUBSYS

&END FORCE_EVAL

 

!******************************************************************************

!FORCE_EVA section 1 Subsys 1

!******************************************************************************

&FORCE_EVAL

 

 

  METHOD Quickstep

 

  &SUBSYS

    &CELL

      ABC [angstrom]    5.000   5.000  5.000

    &END CELL

    &COORD

      O      1.75  1.5  0.0  

      H      1.0   1.0  0.0  

      H      2.5   1.0  0.0

    &END COORD

        &KIND H

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q1

    &END KIND

    &KIND O

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q6

    &END KIND

  &END SUBSYS

 

 

  &DFT

   

    &QS

   

      METHOD DFTB

     

      &DFTB

        SELF_CONSISTENT    TRUE

        DO_EWALD           TRUE

        DISPERSION         TRUE

        DIAGONAL_DFTB3     TRUE

        HB_SR_GAMMA        TRUE

       

        &PARAMETER

          PARAM_FILE_PATH  DFTB/3ob-3-1

          PARAM_FILE_NAME  3ob-3-1.parameter

         

          DISPERSION_TYPE  D3

          DISPERSION_RADIUS           15.

          COORDINATION_CUTOFF         1.e-4

          D3_SCALING                  1.0 1.0 1.5

          DISPERSION_PARAMETER_FILE   dftd3.dat

        &END PARAMETER

       

       

      &END DFTB

     

     

    &END QS

   

   

    &POISSON

      &EWALD

       EWALD_TYPE SPME

       GMAX 25

      &END EWALD

      POISSON_SOLVER ANALYTIC

      PERIODIC NONE

    &END POISSON

 

   

    &SCF

      MAX_SCF 100           !Maximum number of SCF iteration

 

      &OT

        PRECONDITIONER FULL_SINGLE_INVERSE

       

        MINIMIZER DIIS

       

      &END OT

     

    &END SCF

   

  &END DFT

 

 

  STRESS_TENSOR ANALYTICAL

 

&END FORCE_EVAL

 

 

 

 

 

 

!******************************************************************************

!FORCE_EVA section 2 Subsys 2

!******************************************************************************

&FORCE_EVAL

 

  METHOD Quickstep

 

  &SUBSYS    

 

    &CELL

      ABC [angstrom]    5.000   5.000  5.000     

    &END CELL

        &KIND H

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q1

    &END KIND

    &KIND O

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q6

    &END KIND

    &COORD  

      H      1.75  2.75  0.0  

      H      1.75  3.50 0.0

    &END COORD

 

  &END SUBSYS

 

 

  &DFT

 

    &QS

   

      CLUSTER_EMBED_SUBSYS .TRUE.

     

      METHOD DFTB

     

      &DFTB

        SELF_CONSISTENT    TRUE

        DO_EWALD           TRUE

        DISPERSION         TRUE

        DIAGONAL_DFTB3     TRUE

        HB_SR_GAMMA        TRUE

       

        !the default parameter files localed in data/DFTB/

        &PARAMETER

          PARAM_FILE_PATH  DFTB/3ob-3-1

          PARAM_FILE_NAME  3ob-3-1.parameter

         

          DISPERSION_TYPE  D3

          DISPERSION_RADIUS           15.

          COORDINATION_CUTOFF         1.e-4

          D3_SCALING                  1.0 1.0 1.5

          DISPERSION_PARAMETER_FILE   dftd3.dat

        &END PARAMETER

       

       

      &END DFTB

     

     

    &END QS

   

    &POISSON

      &EWALD

       EWALD_TYPE SPME

       GMAX 25

      &END EWALD

      POISSON_SOLVER ANALYTIC

      PERIODIC NONE

    &END POISSON

   

   

    &SCF

      SCF_GUESS ATOMIC      !initial guess for the wavefunction.

      MAX_SCF 100           !Maximum number of SCF iteration

 

      &OT

        PRECONDITIONER FULL_SINGLE_INVERSE

        MINIMIZER DIIS

      &END OT

     

    &END SCF

   

  &END DFT

 

  STRESS_TENSOR ANALYTICAL

 

 

&END FORCE_EVAL

 

 

 

!******************************************************************************

!FORCE_EVA section 3 Total system

!******************************************************************************

&FORCE_EVAL

 

 

  METHOD Quickstep

  

  &SUBSYS

 

    &CELL

     ABC [angstrom]    5.000   5.000  5.000

    &END CELL

   

    &COORD

      O      1.75  1.5  0.0  

      H      1.0   1.0  0.0  

      H      2.5   1.0  0.0   

      H      1.75  2.75  0.0  

      H      1.75  3.50 0.0

    &END COORD

   

    &KIND H

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q1

    &END KIND

    &KIND O

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q6

    &END KIND

  &END SUBSYS

  

  &DFT

 

   

    &QS

      REF_EMBED_SUBSYS .TRUE.

     

      !&OPT_EMBED

      !   REG_LAMBDA 0.00001

      !   N_ITER 3

      !   DENS_CONV_INT 0.5

      !   DENS_CONV_MAX 0.025

      !   OPTIMIZER QUASI_NEWTON

      !   GRID_OPT .FALSE.

      !&END OPT_EMBED

&OPT_DMFET

&END

     

      EPS_DEFAULT 1.0E-10   !Default value: 1.00000000E-010

     

      METHOD DFTB

     

      &DFTB

        SELF_CONSISTENT    TRUE

        DO_EWALD           TRUE

        DISPERSION         TRUE

        DIAGONAL_DFTB3     TRUE

        HB_SR_GAMMA        TRUE

        

        !the default parameter files localed in data/DFTB/

        &PARAMETER

          PARAM_FILE_PATH  DFTB/3ob-3-1

          PARAM_FILE_NAME  3ob-3-1.parameter

         

          DISPERSION_TYPE  D3

          DISPERSION_RADIUS           15.

          COORDINATION_CUTOFF         1.e-4

          D3_SCALING                  1.0 1.0 1.5

          DISPERSION_PARAMETER_FILE   dftd3.dat

        &END PARAMETER

       

       

      &END DFTB

     

     

    &END QS

   

    &POISSON

      &EWALD

       EWALD_TYPE SPME

       GMAX 25

      &END EWALD

      POISSON_SOLVER ANALYTIC

      PERIODIC NONE

    &END POISSON

   

   

    &SCF

      SCF_GUESS ATOMIC      !initial guess for the wavefunction.

      MAX_SCF 100           !Maximum number of SCF iteration

     

      &OT

        PRECONDITIONER FULL_SINGLE_INVERSE

        MINIMIZER DIIS

      &END OT

     

     

    &END SCF

   

  &END DFT

 

 

  STRESS_TENSOR ANALYTICAL

 

 

&END FORCE_EVAL

 

 

 

 

 

 

!******************************************************************************

!FORCE_EVA section 4 Higher level calculation on subsys 2

!******************************************************************************

 

&FORCE_EVAL

  METHOD Quickstep

  &DFT

    BASIS_SET_FILE_NAME  BASIS_RI_cc-TZ

    POTENTIAL_FILE_NAME   HF_POTENTIALS

    &MGRID

      CUTOFF  100

      REL_CUTOFF  20

    &END MGRID

    &POISSON

    &END POISSON

    &QS

      HIGH_LEVEL_EMBED_SUBSYS

      METHOD GPW

      EPS_DEFAULT 1.0E-15

      EPS_PGF_ORB 1.0E-30

    &END QS

 

    &SCF

      SCF_GUESS ATOMIC      !initial guess for the wavefunction.

      MAX_SCF 100           !Maximum number of SCF iteration

 

      &OT

        PRECONDITIONER FULL_SINGLE_INVERSE

        MINIMIZER DIIS

      &END OT

     

    &END SCF

   

    &XC

      &XC_FUNCTIONAL PBE

      &END XC_FUNCTIONAL

 

    &END XC

  &END DFT

  &SUBSYS

    &CELL

      ABC [angstrom]  5.000   5.000  5.000

    &END CELL

    &KIND H

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q1

    &END KIND

    &KIND O

      BASIS_SET  cc-TZ

      BASIS_SET RI_AUX  RI_TZ

      POTENTIAL  GTH-HF-q6

    &END KIND

    &COORD

  H      1.75  2.75  0.0  

  H      1.75  3.50 0.0   

    &END

  &END SUBSYS

&END FORCE_EVAL

Vladimir Rybkin

unread,
May 8, 2019, 4:25:25 AM5/8/19
to cp2k
Dear user,

a few points to mention:

1) this kind of embedding does not have a gradient, i.e. energy_force will not generate meaningful results, even if runs through. It's only for energies.

2) OPT_EMBED section in the 3rd FORCE_EVAL is not optional and must not be commented out

3) DFTB has not been tested, but must be straightforward to implement. Maybe it already works out of the box: should be tested bearing points 1) and 2) in mind. 

4) I will try it out one of these days.

Yours,

Vladimir

пятница, 3 мая 2019 г., 14:11:51 UTC+2 пользователь ganli...@gmail.com написал:

linfeng gan

unread,
May 9, 2019, 7:00:45 AM5/9/19
to cp2k

 

Hi Vladimir,

Thanks for your advices.

I had done some tests as you suggested. First, I run all the following tests only on run type ENERGY.

Second, I noted there two ways to run embedded calculations, DFET and DMFET which local in CP2K_INPUT / FORCE_EVAL / EMBED. So, I tried the DFET and DMFET embedded respective, but unfortunately, I failed them both.

 

In the DFET method, I was using,

FORCE_EVA section 1

!******************************************************************************

&FORCE_EVAL

 

    METHOD EMBED

 

!******************************************************************************

!FORCE_EVA section 4 Total system

!******************************************************************************

            &OPT_EMBED

               REG_LAMBDA 0.00001

               N_ITER 3

               DENS_CONV_INT 0.5

               DENS_CONV_MAX 0.025

               OPTIMIZER QUASI_NEWTON

               GRID_OPT .FALSE.

            &END OPT_EMBED

 

 

And in the DMFET method, I was using

 

!******************************************************************************

!FORCE_EVA section 1

!******************************************************************************

&FORCE_EVAL

 

    METHOD EMBED

 

    !Select DFET or DMFET. Default value: DFET

    &EMBED DMFET

       NGROUPS 1

 

 

!******************************************************************************

!FORCE_EVA section 4 Total system

!******************************************************************************

 

 

Both of the DFET and DMFET embedded runs, I got the same error massages in the output files.

 

application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0

[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=1

:

system msg for write_line failure : Bad file descriptor

 

 

in the DFET runs, I got following error massages,

--------  Optimize embedding potential info at step =     1 ------------

  Functional value         =        -4.7317737943

  Trust radius               =         0.5000000000

 ---------------------------------------------------

 

  Convergence check :

  Maximum density difference                =         1.0000000021

  Convergence limit for max. density diff.  =         0.0250000000

  Convergence in max. density diff.    =                   NO

  Integrated density difference             =                  NaN

  Conv. limit for integrated density diff.  =         0.5000000000

  Convergence in integrated density diff.    =                   NO

  Integrated squared density difference     =                  NaN

 

  Maximum density change in:

    subsystem  1, spin  1:        0.0000000000

    subsystem  2, spin  1:********************

 

 *******************************************************************************

 *   ___                                                                       *

 *  /   \                                                                      *

 * [ABORT]                                                                     *

 *  \___/               The pointer gto_basis_set is not associated            *

 *    |                                                                        *

 *  O/|                                                                        *

 * /| |                                                                        *

 * / \                                           aobasis/basis_set_types.F:791 *

 *******************************************************************************

 

 

 

and in the DMFET runs, I got following error massage in the h2o_h2_dftb_mp2_DMFET-r-1.out

--------  Optimize embedding potential info at step =    50 ------------

  Functional value         =                  NaN

  Real energy change         =                  NaN

  Step size                  =         0.5000000000

  Trust radius               =         0.5000000000

 ---------------------------------------------------

 

  Convergence check :

  Maximum density difference                = ********************

  Convergence limit for max. density diff.  =         0.0100000000

  Convergence in max. density diff.    =                   NO

  Integrated density difference             =                  NaN

  Conv. limit for integrated density diff.  =         0.1000000000

  Convergence in integrated density diff.    =                   NO

  Integrated squared density difference     =                  NaN

 

  Maximum density change in:

    subsystem  1, spin  1:        0.0000000000

    subsystem  2, spin  1:        0.0000000000

 

 *******************************************************************************

 *   ___                                                                       *

 *  /   \                                                                      *

 * [ABORT]                                                                     *

 *  \___/             Embedding potential optimization not converged.          *

 *    |                                                                        *

 *  O/|                                                                        *

 * /| |                                                                        *

 * / \                                                force_env_methods.F:1483 *

 *******************************************************************************

 

 

Do I miss something in the input files? Do you have any suggests?

 

Thanks again,

Linfeng



在 2019年5月8日星期三 UTC+8下午4:25:25,Vladimir Rybkin写道:
dftb_mp2_DFET.inp
dftb_mp2_DFET.out
dftb_mp2_DMFET.inp
dftb_mp2_DMFET.out
h2o_h2_dftb_mp2_DFET-r-1.out
h2o_h2_dftb_mp2_DMFET-r-1.out

Vladimir Rybkin

unread,
May 9, 2019, 11:31:51 AM5/9/19
to cp2k
Dear Linfeng, 

I will try to reproduce your results and correct the code if possible. Meanwhile:

1) don't use DMFET, it's not verified;
2) with MULTIPLE_FORCE_EVAL without embedding it must be possible to run out of the box (ONIOM style multi-level calculation).

Yours,

Vladimir

пятница, 3 мая 2019 г., 14:11:51 UTC+2 пользователь ganli...@gmail.com написал:

 

Hi everyone in cp2k community,

linfeng gan

unread,
May 9, 2019, 10:29:25 PM5/9/19
to cp2k

Hi Vladimir,

 

Thanks for the info and for the clarification on the using of ‘DMFET'.  I'm looking forward for your testing results.

 

Regards,

Linfeng



在 2019年5月9日星期四 UTC+8下午11:31:51,Vladimir Rybkin写道:

Vladimir Rybkin

unread,
May 14, 2019, 12:18:09 PM5/14/19
to cp2k
Dear Linfeng

DFET works with DFTB (technically, no warranty for the result). I believe there are some issues with your input. A few points:
1)  It is important to use the same grids for all subsystems. 
2) The first system is environment, the second (use &QS\CLUSTER_EMBED_SUBSYS .TRUE.)
 is the embedded cluster, the third is the total one (use &QS\REF_EMBED_SUBSYS .TRUE.) and the forth is the cluster at a better level of theory (use &QS\HIGH_LEVEL_EMBED_SUBSYS .TRUE.). 
3) If you want MP2 in DFTB, then use DFTB for the first three and MP2 for the last one. This means that the interaction between the subsystems is consistent.

Yours,

Vladimir


пятница, 10 мая 2019 г., 4:29:25 UTC+2 пользователь linfeng gan написал:

linfeng gan

unread,
May 15, 2019, 6:18:52 AM5/15/19
to cp2k

 

Hi Vladimir,

Thanks for your feedback. But there are still something confusing me. The input which I used was simply modified form “tests/QS/regtest-embed/H2O_H2_pbe_mp2.inp” in the CP2K test dir. Correct me if I understand the input keyword wrong.

 

In the input system, there are a water molecular and a hydrogen molecular.

 

(1)   Question one

The MULTIPLE_FORCE_EVALS section, I set

    FORCE_EVAL_ORDER 2 3 4 5

So, there should be 5 FORCE_EVAL sections in my input file. Am I correct?

 

(2)   Question two

!*******************************

!FORCE_EVA section 1

!

!mapping the fragments

!*******************************

 

The first FORCE_EVA section should be descripting how the other 4 FORCE_EVAL embed and how to mapping the fragments. The Am I correct?

 

(3)   Question three

!*******************************

!FORCE_EVA section 2

!

!Subsys 1 the H2O molecular

!*******************************

 

The second FORCE_EVA section should be descripting how to calculate the H2O molecular energy with DFTB.

 

(4)   Question 4

!*******************************

!FORCE_EVA section 3

!

!Subsys 2 the H2 molecular

!*******************************

   

    &DFT

        &QS

            CLUSTER_EMBED_SUBSYS .TRUE.

        &END QS

    &END DFT

   

 

The third FORCE_EVA section should be descripting how to calculate the H2 molecular energy with DFTB. This is the embedded cluster and the CLUSTER_EMBED_SUBSYS .TRUE. is set.

 

(5)   Question five

!*******************************

!FORCE_EVA section 4

!

!Total system including H2O and H2

!*******************************

    &DFT

        &QS

            REF_EMBED_SUBSYS .TRUE.

           

            &OPT_EMBED

               REG_LAMBDA 0.00001

               N_ITER 3

               DENS_CONV_INT 0.5

               DENS_CONV_MAX 0.025

               OPTIMIZER QUASI_NEWTON

               GRID_OPT .FALSE.

            &END OPT_EMBED

        &END QS

    &END DFT

 

The fourth FORCE_EVA section descripting how to calculate the total system, including H2O and H2 molecular, energy with DFTB. Because this is the total system, the REF_EMBED_SUBSYS .TRUE. is set.

 

(6)   Question six

!*******************************

!FORCE_EVA section 5

!

!Higher level calculation on subsys 2, the H2O

!*******************************

    &DFT

        &QS

            HIGH_LEVEL_EMBED_SUBSYS .TRUE.

        &END QS

    &END DFT

 

The fifth FORCE_EVA section descripting how to calculate the higher level system, in this case H2, energy with PBE. The HIGH_LEVEL_EMBED_SUBSYS .TRUE. should be set in this section.

 

 

To avoid the grid influence I set the same grids for all the subsystem as follow,

        &MGRID

          NGRIDS 5

          CUTOFF 600    

          REL_CUTOFF 60  

        &END MGRID

 

 

But I still got the same error,

*******************************************************************************

 *   ___                                                                       *

 *  /   \                                                                      *

 * [ABORT]                                                                     *

 *  \___/               The pointer gto_basis_set is not associated            *

 *    |                                                                        *

 *  O/|                                                                        *

 * /| |                                                                        *

 * / \                                           aobasis/basis_set_types.F:791 *

 *******************************************************************************

 

 

What should I do next? I post my input file in the end of this,

 

Regards,

Linfeng


&GLOBAL                                                                                          
    PROJECT  h2o_h2_dftb_pbe_DFET
    PRINT_LEVEL HIGH
    RUN_TYPE ENERGY


&END GLOBAL

&MULTIPLE_FORCE_EVALS
    FORCE_EVAL_ORDER 2 3 4 5
    MULTIPLE_SUBSYS T
&END MULTIPLE_FORCE_EVALS


!*******************************
!FORCE_EVA section 1
!
!mapping the fragments
!*******************************


&FORCE_EVAL

    METHOD EMBED
   
    !Select DFET or DMFET. Default value: DFET

    &EMBED DFET

      &COORD
          O      1.75  1.5  0.0  
          H      1.0   1.0  0.0  
          H      2.5   1.0  0.0   
          H      1.75  2.75  0.0  
          H      1.75  3.50 0.0   
      &END
     
    &END SUBSYS
   
&END FORCE_EVAL



!*******************************

!FORCE_EVA section 2
!
!Subsys 1 the H2O molecular
!*******************************


&FORCE_EVAL

    METHOD Quickstep
   
    &SUBSYS
        &CELL
            ABC [angstrom]    5.000   5.000  5.000
        &END CELL
       
        &COORD
            O      1.75  1.5  0.0  
            H      1.0   1.0  0.0  
            H      2.5   1.0  0.0
        &END COORD
       

    &END SUBSYS

    &DFT
        &QS
       
          METHOD DFTB
          &DFTB
            SELF_CONSISTENT    T

            &PARAMETER
              PARAM_FILE_PATH  DFTB/scc
              PARAM_FILE_NAME  scc_parameter
              UFF_FORCE_FIELD  ../uff_table


            &END PARAMETER
          &END DFTB
         
        &END QS
       
        &POISSON
            &EWALD
               EWALD_TYPE SPME
               GMAX 25
            &END EWALD
            POISSON_SOLVER ANALYTIC

        &END POISSON
       
        &MGRID
          NGRIDS 5
          CUTOFF 600    
          REL_CUTOFF 60  
        &END MGRID


       
       
        &SCF
            MAX_SCF 100           !Maximum number of SCF iteration
           
            &OT
                PRECONDITIONER FULL_SINGLE_INVERSE
                MINIMIZER DIIS
            &END OT
         
        &END SCF
     
    &END DFT
   
    STRESS_TENSOR ANALYTICAL
 
&END FORCE_EVAL




!*******************************

!FORCE_EVA section 3
!
!Subsys 2 the H2 molecular
!*******************************


&FORCE_EVAL

    METHOD Quickstep
   
    &SUBSYS    
   
      &CELL
          ABC [angstrom]    5.000   5.000  5.000     
      &END CELL
     
       
      &COORD  

          H      1.75  2.75  0.0  
          H      1.75  3.50 0.0
      &END COORD
   
    &END SUBSYS
   
    &DFT
        &QS
            CLUSTER_EMBED_SUBSYS .TRUE.
           
            METHOD DFTB
            &DFTB
              SELF_CONSISTENT    T

              &PARAMETER
                PARAM_FILE_PATH  DFTB/scc
                PARAM_FILE_NAME  scc_parameter
                UFF_FORCE_FIELD  ../uff_table


              &END PARAMETER
            &END DFTB
           
        &END QS
       
        &POISSON
            &EWALD
                EWALD_TYPE SPME
                GMAX 25
            &END EWALD
            POISSON_SOLVER ANALYTIC

        &END POISSON
       
        &MGRID
          NGRIDS 5
          CUTOFF 600    
          REL_CUTOFF 60  
        &END MGRID
       
        &SCF
            MAX_SCF 100        

           
            &OT
                PRECONDITIONER FULL_SINGLE_INVERSE
                MINIMIZER DIIS
            &END OT
         
        &END SCF
     
    &END DFT
   
    STRESS_TENSOR ANALYTICAL
 
 
&END FORCE_EVAL



!*******************************

!FORCE_EVA section 4
!
!Total system including H2O and H2
!*******************************


&FORCE_EVAL

    METHOD Quickstep
    
    &SUBSYS
        &CELL
           ABC [angstrom]    5.000   5.000  5.000
        &END CELL
       
       
        &COORD
            O      1.75  1.5  0.0  
            H      1.0   1.0  0.0  
            H      2.5   1.0  0.0   
            H      1.75  2.75  0.0  
            H      1.75  3.50 0.0
        &END COORD
       

    &END SUBSYS
  
    &DFT
        &QS
            REF_EMBED_SUBSYS .TRUE.
           

            &OPT_EMBED
               REG_LAMBDA 0.00001
               N_ITER 3
               DENS_CONV_INT 0.5
               DENS_CONV_MAX 0.025
               OPTIMIZER QUASI_NEWTON
               GRID_OPT .FALSE.
            &END OPT_EMBED
           

            !&OPT_DMFET
            !&END


         
            EPS_DEFAULT 1.0E-10   !Default value: 1.00000000E-010
         
            METHOD DFTB
            &DFTB
              SELF_CONSISTENT    T

              &PARAMETER
                PARAM_FILE_PATH  DFTB/scc
                PARAM_FILE_NAME  scc_parameter
                UFF_FORCE_FIELD  ../uff_table


              &END PARAMETER
            &END DFTB
         
        &END QS
       
        &POISSON
            &EWALD
               EWALD_TYPE SPME
               GMAX 25
            &END EWALD
            POISSON_SOLVER ANALYTIC

        &END POISSON
       
        &MGRID
          NGRIDS 5
          CUTOFF 600    
          REL_CUTOFF 60  
        &END MGRID
       
        &SCF
            MAX_SCF 100          

         
            &OT
                PRECONDITIONER FULL_SINGLE_INVERSE
                MINIMIZER DIIS
            &END OT
           
        &END SCF
   
    &END DFT
 
    STRESS_TENSOR ANALYTICAL
 
&END FORCE_EVAL




!*******************************

!FORCE_EVA section 5
!
!Higher level calculation on subsys 2, the H2O
!*******************************



&FORCE_EVAL
    METHOD Quickstep
   
    &DFT
        BASIS_SET_FILE_NAME   BASIS_RI_cc-TZ
        POTENTIAL_FILE_NAME   HF_POTENTIALS
 

        &QS
            HIGH_LEVEL_EMBED_SUBSYS .TRUE.


           
            METHOD GPW
            EPS_DEFAULT 1.0E-15
            EPS_PGF_ORB 1.0E-30
        &END QS
       
        &SCF

          MAX_SCF 100       

       
          &OT
            PRECONDITIONER FULL_SINGLE_INVERSE
            MINIMIZER DIIS
          &END OT
         
        &END SCF
       
        &XC
            &XC_FUNCTIONAL PBE
            &END XC_FUNCTIONAL
        &END XC
       

        &POISSON
            &EWALD
               EWALD_TYPE SPME
               GMAX 25
            &END EWALD
            POISSON_SOLVER ANALYTIC

        &END POISSON
       
        &MGRID
          NGRIDS 5
          CUTOFF 600    
          REL_CUTOFF 60  
        &END MGRID

Vladimir Rybkin

unread,
May 15, 2019, 7:51:27 AM5/15/19
to cp2k
Dear Linfeng

1) the first force_eval is the &EMBED one, the others are  actual subsystems.

2) >> The first FORCE_EVA section should be descripting how the other 4 FORCE_EVAL embed and how to mapping the fragments. The Am I correct?
Yes

3) to 6) Yes

The error is as follows: for DFTB there is no basis set. However, in OPT_EMBED you ask for GRID_OPT .FALSE. This is not obvious but: the embedding potential optimization is requested in the finite RI basis of the total system. This basis, however, is not specified in DFTB. So, to make a long story short, set GRID_OPT .TRUE. This is general, safe and fast (and the default).

Yours,

Vladimir 

среда, 15 мая 2019 г., 12:18:52 UTC+2 пользователь linfeng gan написал:

linfeng gan

unread,
May 16, 2019, 2:51:39 AM5/16/19
to cp2k

Dear Vladimir,

It worked after I set GRID_OPT to be TRUE.! Thank your Vladimir.

 

I still need some your help since I has not much experiences in the EMBED calculations. I found that the embedding DFTB and PDB calculations were very hard to converged even after 100 optimize steps for H2O-H2 system. For example, after 50 iterations, I got following error massage,

--------  Optimize embedding potential info at step =    50 ------------

  Functional value         =                  NaN

  Real energy change         =                  NaN

  Step size                  =         0.5000000000

  Trust radius               =         0.5000000000

 ---------------------------------------------------

 

  Convergence check :

  Maximum density difference                = ********************

  Convergence limit for max. density diff.  =         0.0250000000

  Convergence in max. density diff.    =                   NO

  Integrated density difference             =                  NaN

  Conv. limit for integrated density diff.  =         0.5000000000

  Convergence in integrated density diff.    =                   NO

  Integrated squared density difference     =                  NaN

 

  Maximum density change in:

    subsystem  1, spin  1:        0.0000000000

    subsystem  2, spin  1:        0.0000000000

 

 *******************************************************************************

 *   ___                                                                       *

 *  /   \                                                                      *

 * [ABORT]                                                                     *

 *  \___/             Embedding potential optimization not converged.          *

 *    |                                                                        *

 *  O/|                                                                        *

 * /| |                                                                        *

 * / \                                                force_env_methods.F:1483 *

 *******************************************************************************

 

As you can see, the “Integrated density difference” value was NaN and the embedding potential optimization was not converged. And I found that the embedding potential was also NaN too which wrote in the h2o_h2_dftb_pbe_DFET-embed_pot_*.cube files. Is these normal output for the embed calculation? Or how can I fix this?

 

 

 

Quickstep-

  EMBEDDING POTENTIAL at optimization step            1

    5    0.000000    0.000000    0.000000

   75    0.125982    0.000000    0.000000

   75    0.000000    0.125982    0.000000

   75    0.000000    0.000000    0.125982

    8    0.000000    3.307021    2.834589    0.000000

    1    0.000000    1.889726    1.889726    0.000000

    1    0.000000    4.724315    1.889726    0.000000

    1    0.000000    3.307021    5.196747    0.000000

    1    0.000000    3.307021    6.614041    0.000000

          NaN          NaN  0.00000E+00          NaN          NaN          NaN

  0.00000E+00          NaN  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00

          NaN  0.00000E+00  0.00000E+00          NaN  0.00000E+00          NaN

  0.00000E+00          NaN          NaN          NaN          NaN  0.00000E+00

          NaN  0.00000E+00  0.00000E+00  0.00000E+00          NaN          NaN

  0.00000E+00  0.00000E+00          NaN          NaN          NaN  0.00000E+00

  0.00000E+00          NaN          NaN  0.00000E+00          NaN  0.00000E+00

  0.00000E+00  0.00000E+00          NaN          NaN  0.00000E+00  0.00000E+00

          NaN  0.00000E+00  0.00000E+00          NaN          NaN  0.00000E+00

          NaN          NaN          NaN  0.00000E+00          NaN  0.00000E+00

          NaN  0.00000E+00  0.00000E+00          NaN          NaN  0.00000E+00

          NaN          NaN          NaN          NaN  0.00000E+00  0.00000E+00

  0.00000E+00          NaN          NaN

          NaN  0.00000E+00  0.00000E+00          NaN  0.00000E+00          NaN

 

 

Yours,

Linfeng



在 2019年5月15日星期三 UTC+8下午7:51:27,Vladimir Rybkin写道:

Vladimir Rybkin

unread,
May 16, 2019, 5:14:05 AM5/16/19
to cp2k
Dear Lifeng,

the code is experimental so it may happen. Could you please attach your full input?

Yours,

Vladimir

четверг, 16 мая 2019 г., 8:51:39 UTC+2 пользователь linfeng gan написал:

linfeng gan

unread,
May 16, 2019, 8:04:54 AM5/16/19
to cp2k

Thanks Vladimir,
enclosing is my full DFTB+PBE embed input file.

Thanks for your help.

Yours,
Linfeng

在 2019年5月16日星期四 UTC+8下午5:14:05,Vladimir Rybkin写道:
dftb_pbe.inp

Vladimir Rybkin

unread,
May 16, 2019, 8:15:01 AM5/16/19
to cp2k
Dear Lifeng,

with my (trunk) version of CP2K it runs smoothly through.  Try the newest distribution of the code.

Yours,

Vladimir

четверг, 16 мая 2019 г., 14:04:54 UTC+2 пользователь linfeng gan написал:

linfeng gan

unread,
May 17, 2019, 6:40:47 AM5/17/19
to cp2k
Thank your very much Vladimir. I will try the newest distribution.

Best regards,
Linfeng



在 2019年5月16日星期四 UTC+8下午8:15:01,Vladimir Rybkin写道:
Reply all
Reply to author
Forward
0 new messages