exercises:2015_pitt:ls
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| exercises:2015_pitt:ls [2015/03/05 11:31] – created vondele | exercises:2015_pitt:ls [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Linear scaling calculations ====== | + | ====== Linear |
| + | |||
| + | In this exercise we will compare linear | ||
| + | |||
| + | In CP2K, Linear scaling (LS) methods are relatively new. Whereas LS is generally efficient with methods that require a minimal basis, the cross-over between LS and OT might require 10000s of atoms for DFT, dense 3D systems with DZVP-MOLOPT basis sets. | ||
| + | |||
| + | ===== 1. Task: Scaling Behavior ===== | ||
| + | |||
| + | Calculate the energy of the 2D-polymer for various different system sizes, by using '' | ||
| + | |||
| + | The number of seconds required of each SCF cycle is printed as part of the regular output. | ||
| + | |||
| + | For the normal SCF it's the 4th column in the following table: | ||
| + | < | ||
| + | Step | ||
| + | ------------------------------------------------------------------------------ | ||
| + | 1 P_Mix/Diag. 0.40E+00 | ||
| + | 2 P_Mix/Diag. 0.40E+00 | ||
| + | 3 DIIS/ | ||
| + | 4 DIIS/ | ||
| + | 5 DIIS/ | ||
| + | </ | ||
| + | |||
| + | For the linear scaling SCF it's the last column in lines like these: | ||
| + | < | ||
| + | | ||
| + | ... | ||
| + | | ||
| + | ... | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ===== 2. Task: Filter Threshold ===== | ||
| + | |||
| + | Calculate the energy of the single unit-cell with the linear scaling method at different filter thresholds, by changing '' | ||
| + | |||
| + | ===== 3. Task: LS algorithm ===== | ||
| + | |||
| + | Finally, compare the efficiency of three different algorithms (using NREP 2x2). The following three options can be tried: | ||
| + | |||
| + | sign matrix iterations [[doi> | ||
| + | < | ||
| + | ! linear scaling SCF | ||
| + | & | ||
| + | ! SIGN_MATRIX, | ||
| + | PURIFICATION_METHOD SIGN_MATRIX | ||
| + | ! threshold used to determine sparsity and thus speed and accuracy | ||
| + | EPS_FILTER 1E-7 | ||
| + | ! convergence for the SCF | ||
| + | EPS_SCF | ||
| + | ! chemical potential, an energy from within in the HOMO-LUMO gap | ||
| + | MU | ||
| + | S_PRECONDITIONER ATOMIC | ||
| + | &END | ||
| + | </ | ||
| + | |||
| + | trs4 iterations [[doi> | ||
| + | < | ||
| + | ! linear scaling SCF | ||
| + | & | ||
| + | ! TRS4, does not need an estimate for the chemical potential | ||
| + | PURIFICATION_METHOD TRS4 | ||
| + | ! threshold used to determine sparsity and thus speed and accuracy | ||
| + | EPS_FILTER 1E-7 | ||
| + | ! convergence for the SCF | ||
| + | EPS_SCF | ||
| + | ! chemical potential, an energy from within in the HOMO-LUMO gap | ||
| + | MU | ||
| + | S_PRECONDITIONER ATOMIC | ||
| + | &END | ||
| + | </ | ||
| + | |||
| + | curvy steps [[doi> | ||
| + | < | ||
| + | ! linear scaling SCF | ||
| + | & | ||
| + | ! TRS4, does not need an estimate for the chemical potential | ||
| + | PURIFICATION_METHOD TRS4 | ||
| + | ! threshold used to determine sparsity and thus speed and accuracy | ||
| + | EPS_FILTER 1E-7 | ||
| + | ! convergence for the SCF | ||
| + | EPS_SCF | ||
| + | ! chemical potential, an energy from within in the HOMO-LUMO gap | ||
| + | MU | ||
| + | S_PRECONDITIONER NONE | ||
| + | & | ||
| + | &END CURVY_STEPS | ||
| + | &END | ||
| + | </ | ||
| + | |||
| + | In making your judgement, consider the fact that the rate of convergence might not be the same for all algorithms. | ||
| + | |||
| + | From a practical point of view, the curvy_steps algorithm seems very robust in converging the SCF of electronically difficult systems, while the sign matrix algorithm is only worthwhile considering if the chemical potential is known (or fixed). | ||
| + | |||
| + | ===== Input File ===== | ||
| + | <code - 2d_polymer.inp> | ||
| + | ! Number of unit cell replications, | ||
| + | @SET NREPX 1 | ||
| + | @SET NREPY 1 | ||
| + | |||
| + | & | ||
| + | PROJECT 2d_polymer | ||
| + | RUN_TYPE ENERGY | ||
| + | &END GLOBAL | ||
| + | |||
| + | & | ||
| + | &DFT | ||
| + | ! linear scaling SCF | ||
| + | & | ||
| + | ! TRS4, does not need an estimate for the chemical potential | ||
| + | PURIFICATION_METHOD TRS4 | ||
| + | ! threshold used to determine sparsity and thus speed and accuracy | ||
| + | EPS_FILTER 1E-5 | ||
| + | ! convergence for the SCF | ||
| + | EPS_SCF | ||
| + | ! chemical potential, an energy from within in the HOMO-LUMO gap | ||
| + | MU -0.15 | ||
| + | S_PRECONDITIONER ATOMIC | ||
| + | &END | ||
| + | |||
| + | ! traditional SCF, diagonalization by default | ||
| + | &SCF | ||
| + | &END | ||
| + | |||
| + | &QS | ||
| + | LS_SCF | ||
| + | |||
| + | ! ============================================================================================= | ||
| + | ! === Description of Hamiltonian (Density Functional Tight Binding + Smooth Particle Meshed Ewald) === | ||
| + | METHOD DFTB | ||
| + | &DFTB | ||
| + | HB_SR_GAMMA | ||
| + | SELF_CONSISTENT | ||
| + | DO_EWALD | ||
| + | DISPERSION | ||
| + | & | ||
| + | ! these parameters are in cp2k/data | ||
| + | PARAM_FILE_PATH | ||
| + | PARAM_FILE_NAME | ||
| + | UFF_FORCE_FIELD | ||
| + | &END PARAMETER | ||
| + | &END DFTB | ||
| + | &END QS | ||
| + | |||
| + | & | ||
| + | & | ||
| + | | ||
| + | ! scale the number of points with the system size, roughly 1pt/A. | ||
| + | GMAX 40*${NREPX} 40*${NREPY} 40 | ||
| + | | ||
| + | &END EWALD | ||
| + | &END POISSON | ||
| + | ! ==============================End of Hamiltonian Description ================================ | ||
| + | ! ============================================================================================= | ||
| + | &END DFT | ||
| + | |||
| + | |||
| + | & | ||
| + | &CELL | ||
| + | ! a 2D system, z-direction is non-periodic | ||
| + | ABC 23.577999 40.8383 30 | ||
| + | MULTIPLE_UNIT_CELL ${NREPX} ${NREPY} 1 | ||
| + | &END CELL | ||
| + | & | ||
| + | MULTIPLE_UNIT_CELL ${NREPX} ${NREPY} 1 | ||
| + | &END | ||
| + | & | ||
| + | @INCLUDE ' | ||
| + | &END COORD | ||
| + | &END SUBSYS | ||
| + | &END FORCE_EVAL | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== Additional Files ===== | ||
| + | |||
| + | Download the following files into your project directory: | ||
| + | * {{http:// | ||
| + | |||
| + | You can unpack them with the following commands: | ||
| + | < | ||
| + | $ gunzip 2d_polymer.coord.gz | ||
| + | </ | ||
exercises/2015_pitt/ls.1425555093.txt.gz · Last modified: (external edit)
