SCM-NV / nano-qmflows

Package containing several workflows to compute molecular properties for nanomaterials
Apache License 2.0
10 stars 10 forks source link

Define cutoff and xc parameters #259

Closed elkandro closed 4 years ago

elkandro commented 4 years ago

I need help to include some parameters like cutoff and xc functional in the input file for nano-qmflows. I have added a couple of lines to include these functions, However, I didn't make it. There is something wrong and I don't figure out. I have attached my input file and an error message that I got it. Would you please check my input file if I missed something. Thanks once again!! Best, Esam em25.rooted.o4365.txt input.yml.txt

felipeZ commented 4 years ago

@elkandro I have found that the issue is due to a dependency library that calls CP2K (see: SCM/PLAMS#92 ) I would try to solve it ASAP.

felipeZ commented 4 years ago

@elkandro I just pushed a fix for the problem that you have :), now you can give the following input:

 workflow:
  derivative_couplings

project_name:
  endo

# Step of the MD (Femtoseconds)
dt: 0.5

# Algorithm to compute the derivative couplings
algorithm:
  "3points"

# Track crossing between orbitals
tracking:
  False

# Occupied and Virtual orbitals to compute the couplings
active_space:
  [1, 1]

# Path to the file to store all the intermediate tensors
path_hdf5:
  "c60.hdf5"

# MD trajectory
path_traj_xyz:
  "c60.xyz"

# Path where all the temporal files are store
scratch_path:
  "/tmp/nanoqm"
# CP2K Configuration
cp2k_general_settings:
  potential: "GTH-PBE"
  basis: "DZVP-MOLOPT-SR-GTH"
  cell_parameters: [20.0,20.00, 20.0]
  cell_angles: [90.0, 90.0, 90.0]
  periodic: none

# Configuration to compute the molecular orbitals
  cp2k_settings_main:
     specific:
       cp2k:
        global:
            run_type:
              energy

        force_eval:
            dft:
                mgrid:
                    cutoff: 600
                    rel_cutoff: 60
                    ngrids: 4
                xc:
                    xc_functional b3lyp: {}
                scf:
                    eps_scf: 1e-06
                    max_scf: 0
                    scf_guess: "restart"
                    OT:
                        minimizer: "DIIS"
                        N_DIIS: 7
                        preconditioner: "full_single_inverse"
            subsys:
                cell:
                    periodic: "None"
                kind:
                    C:
                    basis_set: ["DZVP-MOLOPT-SR-GTH-q4", "AUX_FT CPFIT3"]
                    potential: "GTH-PBE-q4"

# Configuration to compute an initial guess of the wave function
  cp2k_settings_guess:
     specific:
       cp2k:
        global:
            run_type:
              energy

        force_eval:
            dft:
                mgrid:
                    cutoff: 600
                    rel_cutoff: 60
                    ngrids: 4
                xc:
                    xc_functional b3lyp: {}
                scf:
                    eps_scf: 1e-06
                    max_scf: 0
                    scf_guess: "restart"
                    OT:
                        minimizer: "DIIS"
                        N_DIIS: 7
                        preconditioner: "full_single_inverse"
            subsys:
                cell:
                    periodic: "None"
                kind:
                    C:
                        basis_set: ["DZVP-MOLOPT-SR-GTH-q4", "AUX_FT CPFIT3"]
                        potential: "GTH-PBE-q4"

It will generate a CP2K input like:

&FORCE_EVAL
  &DFT
    BASIS_SET_FILE_NAME  /home/Primer/Python/nano-qmflows/nanoqm/basis/BASIS_MOLOPT
    BASIS_SET_FILE_NAME  /home/Primer/Python/nano-qmflows/nanoqm/basis/BASIS_ADMM_MOLOPT
    BASIS_SET_FILE_NAME  /home/Primer/Python/nano-qmflows/nanoqm/basis/BASIS_ADMM
    CHARGE  0
    &MGRID
      CUTOFF  600
      NGRIDS  4
      REL_CUTOFF  60
    &END
    POTENTIAL_FILE_NAME  /home/Primer/Python/nano-qmflows/nanoqm/basis/GTH_POTENTIALS
    &PRINT
    &END
    &SCF
      &OT
        N_DIIS  7
        MINIMIZER  DIIS
        PRECONDITIONER  full_single_inverse
      &END
      EPS_SCF  1e-06
      MAX_SCF  0
      SCF_GUESS  restart
    &END
    &XC
      &XC_FUNCTIONAL B3LYP
      &END
    &END
  &END
  &SUBSYS
    &CELL
      ABC   [angstrom] 20.00 20.00 20.00
      PERIODIC  none
    &END
    &COORD 
 C 0.0 0.0 0.0
    &END
    &KIND  C
      BASIS_SET  DZVP-MOLOPT-SR-GTH-q4
      BASIS_SET  AUX_FT CPFIT3
      POTENTIAL  GTH-PBE-q4
    &END
  &END
&END

&GLOBAL
  PROJECT  point_0
  RUN_TYPE  energy
&END

Notice that,

  1. You can pass multiple values in the settings, for example the basis_set.
  2. You don't need to provide the path to the basis, it is automatically append to the CP2K input.
  3. I can provide templates for other functional like B3LYP, if you want :)
  4. The goal of the first guess calculations is to compute a guess wave function. So, we use the CP2K OT preconditioner, are you sure that you want to use such preconditioner for the main calculation?
  5. Have a look at the template file just to check how the templates are defined and in case that you may want to have other templates as I have stated in point 3 and also notice that We don't use OT for the main calculation.
elkandro commented 4 years ago

Thanks a lot!! Your notes are very helpful. Yes, you're right, I don't want to use OT in my calculations. Would you pleaese provide me templates for B3LYP? I have also tried to upgrade the nano-qmflows package and I got an error message. Please see the attached error file!! error file.txt

Thanks, Esam

felipeZ commented 4 years ago

@elkandro I will work on the template ;) Also, the error seems to be related to a version clash (I usually change the version when I fix a bug). Could you please try first to uninstall the library like:

pip uninstall nanoqm

Then install it again using the normal procedure. Let me know if it works for you

elkandro commented 4 years ago

Thanks.. I have already upgraded the nano-qmflows. I do another test and I receive another error message. Please see the attachment!! em25.rooted.o4387.txt input.yml.txt

Many thanks for your help, Esam

felipeZ commented 4 years ago

@elkandro Notice that in your input CP2K input you are requesting that max_scf: 0 therefore No Orbitals are computed or stored. So, you need to remove that section :) . Also the OT section in the main calculation is not valid, OT and added_mos do not work on the same calculation. Also, I have made an small improvement about checking the OT calculation that can affect your calculation, so please reinstall the library

elkandro commented 4 years ago

Dear @felipeZ I have already upgrade the nanoqm, but I cannot run any job under nanoQm. Please see the error messages for PBE0 and B3LYP. Many thanks!!

B3LYP.error.txt input.yml.txt PBE0.error.txt

felipeZ commented 4 years ago

@elkandro, sorry for the late reply! Have you try to use the PBE0 template for the calculation? You can do the following:

workflow:
  single_points
project_name: ethylene
compute_orbitals: True
active_space: [2, 2]
path_hdf5: "test/test_files/ethylene.hdf5"
path_traj_xyz: "test/test_files/ethylene.xyz"
scratch_path: "/tmp/namd"

cp2k_general_settings:
  basis:  "DZVP-MOLOPT-SR-GTH"
  potential: "GTH-PBE"
  cell_parameters: 5.0
  periodic: none
  executable: cp2k.popt

  cp2k_settings_main:
    specific:
      template: pbe0_main

  cp2k_settings_guess:
    specific:
      template:
        pbe0_guess

You can find the definitions for the templates here

elkandro commented 4 years ago

@felipeZ, I have done calculations for Pbe and pbe0. Right now, I am looking for B3LYP level. Until now, I don't figure out how to include this one, If there is any chance to create a new template file with including B3LYP or would you please check my previous input file, it still doesn't work. Many thanks for your time.

felipeZ commented 4 years ago

@elkandro I just introduced the B3LYP templates. You can found an example of how to use them here Let me know if it works for you!