├── 0_structure_preparation ├── 1_c3n4 │ ├── CN1x1.xyz │ ├── README.md │ ├── c3n4-qd.xyz │ └── c3n4.xyz └── 3_BA2_PbI4 │ ├── 2102937.cif │ ├── README.md │ ├── supercell.vasp │ ├── unit_cell.vasp │ └── vasp_xyz.py ├── 10_supercell ├── 3_BA2_PbI4 │ ├── BASIS_ADMM │ ├── BASIS_ADMM_MOLOPT │ ├── BASIS_MOLOPT │ ├── GTH_POTENTIALS │ ├── POTENTIAL │ ├── b3lyp.inp │ ├── dftd3.dat │ ├── pbe-tddft.inp │ ├── pbe.inp │ └── supercell.xyz └── README.md ├── 1_energy └── 1_c3n4 │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── c3n4.xyz │ ├── energy.inp │ ├── output.tar.bz2 │ └── submit.slm ├── 2_convergence_analysis ├── 1_c3n4 │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── c3n4.xyz │ ├── dftd3.dat │ ├── energy.inp │ ├── output.tar.bz2 │ └── submit.slm ├── 3_BA2_PbI4 │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── conv_anal.sh │ ├── dftd3.dat │ ├── energy.inp │ └── unit_cell.xyz └── README.md ├── 3_geometry_optimization ├── 1_c3n4 │ ├── 1_wavelet │ │ ├── BASIS_MOLOPT │ │ ├── POTENTIAL │ │ ├── c3n4.xyz │ │ ├── dftd3.dat │ │ ├── geo_opt.in │ │ ├── output.tar.bz2 │ │ └── submit.slm │ └── 2_pbc │ │ ├── BASIS_MOLOPT │ │ ├── POTENTIAL │ │ ├── c3n4.xyz │ │ ├── dftd3.dat │ │ ├── geo_opt.in │ │ ├── output.tar.bz2 │ │ └── submit.slm ├── 3_BA2_PbI4 │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── dftd3.dat │ ├── geo_opt.inp │ ├── optimized_BA2_PbI4.xyz │ └── unit_cell.xyz └── README.md ├── 4_cell_optimization ├── 3_BA2_PbI4 │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── cell_opt.inp │ ├── dftd3.dat │ └── unit_cell.xyz └── README.md ├── 5_tddft ├── 1_c3n4 │ ├── BASIS_MOLOPT │ ├── C3N4-QD-RESTART.tdwfn │ ├── C3N4-QD-RESTART.wfn │ ├── C3N4-QD-RESTART.wfn.bak-1 │ ├── C3N4-QD-k1-1.pdos │ ├── C3N4-QD-k2-1.pdos │ ├── C3N4-QD-k3-1.pdos │ ├── POTENTIAL │ ├── c3n4.xyz │ ├── dftd3.dat │ ├── slurm-6572145.out │ ├── submit.slm │ ├── tddft.in │ └── tddft.log ├── 2_adamantane │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── c10h16-RESTART.tdwfn │ ├── c10h16-RESTART.tdwfn.bak-1 │ ├── c10h16-RESTART.wfn │ ├── c10h16-k1-1.pdos │ ├── c10h16-k2-1.pdos │ ├── clean.sh │ ├── coord.xyz │ ├── cp2k_input_template.inp │ ├── out.log │ ├── slurm-6486786.out │ └── submit.slm ├── 3_BA2_PbI4 │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── dftd3.dat │ ├── optimized_unit_cell.xyz │ └── tddft.inp └── README.md ├── 6_hybrid_functionals ├── 3_BA2_PbI4 │ ├── BASIS_ADMM │ ├── BASIS_ADMM_MOLOPT │ ├── BASIS_MOLOPT │ ├── GTH_POTENTIALS │ ├── b3lyp-tddft.inp │ ├── b3lyp.inp │ ├── dftd3.dat │ ├── hse06.inp │ ├── optimized_unit_cell.xyz │ └── pbe.inp └── README.md ├── 7_molecular_dynamics ├── 1_c3n4 │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── c3n4.xyz │ ├── md.in │ ├── output.tar.bz2 │ └── submit.slm ├── 2_adamantane │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── clean.sh │ ├── coord.xyz │ ├── cp2k_input_template.inp │ ├── output.tar.bz2 │ └── submit.slm ├── 3_BA2_PbI4 │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── dftd3.dat │ ├── md.inp │ └── optimized_unit_cell.xyz └── README.md ├── 8_cube_file_timeoverlaps └── 3_BA2_PbI4 │ ├── BASIS_MOLOPT │ ├── MD_BA2PbI4_dt0.1fs-pos-1.xyz │ ├── MD_BA2PbI4_dt1fs-pos-1.xyz │ ├── POTENTIAL │ ├── README.md │ ├── cp2k_input_template.inp │ ├── cutoff_analysis.py │ ├── dftd3.dat │ ├── run.py │ └── submit_template.slm ├── 9_nacs ├── 1_c3n4 │ ├── BASIS_MOLOPT │ ├── C3N4-QD-pos-1.xyz │ ├── POTENTIAL │ ├── README.md │ ├── cp2k_input_template.inp │ ├── output.tar.bz2 │ ├── run.py │ └── submit_template.slm └── 2_adamantane │ ├── BASIS_MOLOPT │ ├── POTENTIAL │ ├── README.md │ ├── c10h16-pos-1.xyz │ ├── check_step2_progress.py │ ├── clean.sh │ ├── cp2k_input_template.inp │ ├── output.tar.bz2 │ ├── run.py │ └── submit_template.slm ├── INSTALLATION.md ├── LICENSE ├── README.md └── legacy └── cp2k_libra_workflow ├── compute_dynamical_properties ├── clean.sh └── compute_dynamical_properties.py ├── excitation_analysis ├── clean.sh ├── cp2k_all_logfiles └── excitation_analysis.py ├── md ├── BASIS_MOLOPT ├── POTENTIAL ├── c10h16-pos-1.xyz ├── clean.sh ├── coord.xyz ├── cp2k_input_template.inp └── submit.slm ├── namd ├── clean.sh ├── fit │ ├── cleah.sh │ └── fit_template.py ├── namd.py └── submit.slm ├── pdos ├── clean.sh ├── cp2k_all_pdosfiles └── pdos.py ├── step2 ├── .gitignore ├── BASIS_MOLOPT ├── POTENTIAL ├── README.md ├── c10h16-pos-1.xyz ├── check_step2_progress.py ├── clean.sh ├── cp2k_input_template.inp ├── cp2k_tutorial_res ├── cp2k_tutorial_wd ├── run.py └── submit_template.slm ├── step3 ├── README.md ├── build_bases.py ├── clean.sh ├── cp2k_step3_res └── user_defined_basis │ ├── build_bases.py │ ├── hot_electron_cooling │ └── build_bases.py │ ├── hot_hole_cooling │ └── build_bases.py │ ├── res_mb_sp │ ├── Hvib_sd_150_im │ ├── Hvib_sd_150_re │ ├── Hvib_sd_151_im │ ├── Hvib_sd_151_re │ ├── Hvib_sd_152_im │ ├── Hvib_sd_152_re │ ├── S_sd_150_re │ ├── S_sd_151_re │ ├── S_sd_152_re │ ├── S_sd_153_re │ ├── St_sd_150_re │ ├── St_sd_151_re │ └── St_sd_152_re │ └── sac_basis │ └── build_bases.py └── tddft ├── BASIS_MOLOPT ├── POTENTIAL ├── c10h16-k1-1.pdos ├── c10h16-k2-1.pdos ├── clean.sh ├── coord.xyz ├── cp2k_input_template.inp ├── out.log └── submit.slm /0_structure_preparation/1_c3n4/README.md: -------------------------------------------------------------------------------- 1 | CN1x1.xyz is a large structure which you can use to carve out the C3N4 quantum dots 2 | 3 | c3n4-qd.xyz is something i carved in VESTA, but this one doesn't add missing H 4 | 5 | c3n4.xyz - the one prepared using iQmol - we automatically added H atoms, but need to remove some 6 | of the added ones manually to produce this file. 7 | 8 | -------------------------------------------------------------------------------- /0_structure_preparation/1_c3n4/c3n4-qd.xyz: -------------------------------------------------------------------------------- 1 | 45 2 | Molecule 3 | C 13.568550 11.514150 0.769910 4 | N 13.567470 10.042790 0.769310 5 | N 12.383290 12.128210 0.770160 6 | C 12.363370 13.458130 0.770780 7 | C 11.283520 15.474900 0.769770 8 | C 13.569600 15.546760 0.770090 9 | N 10.009280 16.209660 0.769610 10 | N 11.222080 14.141400 0.770180 11 | N 12.407860 16.194500 0.769070 12 | N 13.569510 14.154240 0.771770 13 | N 17.129690 3.875660 0.768730 14 | C 17.128929 5.346840 0.769040 15 | C 15.922110 7.290180 0.770360 16 | C 14.841190 9.306400 0.769280 17 | C 18.334221 7.291090 0.769970 18 | C 17.127760 9.379670 0.769160 19 | C 19.413691 9.308010 0.769440 20 | N 19.475260 7.974480 0.770500 21 | N 18.289351 10.027700 0.767710 22 | N 14.754370 12.127590 0.770230 23 | N 15.965180 10.026420 0.768310 24 | N 17.127899 7.986980 0.771000 25 | N 18.314270 5.960950 0.768200 26 | N 15.943150 5.960120 0.770220 27 | N 14.780190 7.972870 0.769820 28 | C 20.689541 11.513690 0.770000 29 | N 19.504230 12.127630 0.770680 30 | N 20.688219 10.042560 0.769570 31 | N 21.875311 12.127040 0.769800 32 | C 14.775500 13.457660 0.771100 33 | C 15.856070 15.473890 0.770160 34 | C 19.484030 13.457850 0.770870 35 | C 18.404221 15.474560 0.770250 36 | C 21.896391 13.457180 0.771020 37 | C 20.690620 15.546460 0.770640 38 | C 22.977011 15.473480 0.770660 39 | N 14.731880 16.193760 0.768970 40 | N 15.917150 14.140410 0.771060 41 | N 17.129860 16.209961 0.770020 42 | N 19.528589 16.194269 0.770310 43 | N 21.852921 16.193171 0.769670 44 | N 23.038200 14.139670 0.771440 45 | N 20.690380 14.153710 0.771640 46 | N 18.342800 14.141020 0.770150 47 | N 24.250790 16.209700 0.770600 48 | -------------------------------------------------------------------------------- /0_structure_preparation/1_c3n4/c3n4.xyz: -------------------------------------------------------------------------------- 1 | 54 2 | 3 | C 13.56855 11.51415 0.76991 4 | N 13.56747 10.04279 0.76931 5 | N 12.38329 12.12821 0.77016 6 | C 12.36337 13.45813 0.77078 7 | C 11.28352 15.47490 0.76977 8 | C 13.56960 15.54676 0.77009 9 | N 10.00928 16.20966 0.76961 10 | N 11.22208 14.14140 0.77018 11 | N 12.40786 16.19450 0.76907 12 | N 13.56951 14.15424 0.77177 13 | N 17.12969 3.87566 0.76873 14 | C 17.12893 5.34684 0.76904 15 | C 15.92211 7.29018 0.77036 16 | C 14.84119 9.30640 0.76928 17 | C 18.33422 7.29109 0.76997 18 | C 17.12776 9.37967 0.76916 19 | C 19.41369 9.30801 0.76944 20 | N 19.47526 7.97448 0.77050 21 | N 18.28935 10.02770 0.76771 22 | N 14.75437 12.12759 0.77023 23 | N 15.96518 10.02642 0.76831 24 | N 17.12790 7.98698 0.77100 25 | N 18.31427 5.96095 0.76820 26 | N 15.94315 5.96012 0.77022 27 | N 14.78019 7.97287 0.76982 28 | C 20.68954 11.51369 0.77000 29 | N 19.50423 12.12763 0.77068 30 | N 20.68822 10.04256 0.76957 31 | N 21.87531 12.12704 0.76980 32 | C 14.77550 13.45766 0.77110 33 | C 15.85607 15.47389 0.77016 34 | C 19.48403 13.45785 0.77087 35 | C 18.40422 15.47456 0.77025 36 | C 21.89639 13.45718 0.77102 37 | C 20.69062 15.54646 0.77064 38 | C 22.97701 15.47348 0.77066 39 | N 14.73188 16.19376 0.76897 40 | N 15.91715 14.14041 0.77106 41 | N 17.12986 16.20996 0.77002 42 | N 19.52859 16.19427 0.77031 43 | N 21.85292 16.19317 0.76967 44 | N 23.03820 14.13967 0.77144 45 | N 20.69038 14.15371 0.77164 46 | N 18.34280 14.14102 0.77015 47 | N 24.25079 16.20970 0.77060 48 | H 10.00875 17.19416 0.76931 49 | H 9.15695 15.71695 0.76980 50 | H 17.98255 3.38385 0.76787 51 | H 16.27734 3.38297 0.76938 52 | H 24.25032 17.19420 0.77004 53 | H 25.10362 15.71785 0.77112 54 | H 12.71454 9.55111 0.76893 55 | H 21.54041 9.54960 0.76937 56 | H 17.12957 17.19446 0.76977 57 | -------------------------------------------------------------------------------- /0_structure_preparation/3_BA2_PbI4/README.md: -------------------------------------------------------------------------------- 1 | # Obtaining the `xyz` coordinates from `cif` files 2 | 3 | 4 | In order to obtain the structure coordinates, we will use [VESTA](https://jp-minerals.org/vesta/en/) software. 5 | 6 | More information on how to use VESTA software is available on the [corresponding CyberTraining repo](https://github.com/compchem-cybertraining/Tutorials_Editing_Visualization) 7 | 8 | Even more examples are available on the [Nickel and Copper YouTube Channel](https://www.youtube.com/channel/UCmOHJtv6B2IFqzGpJakANeg) 9 | of [Dr. Brendan Smith](https://github.com/bsmith24) 10 | 11 | The `.cif` files can be obtained from various sources, such as: 12 | 13 | * [American Mineralogists DataBase](http://rruff.geo.arizona.edu/AMS/amcsd.php) 14 | 15 | 16 | 17 | When loading the `cif` file into VESTA, you can simply expand the cell and make supercells. In order to use the coordinates of these files 18 | in CP2K you will need to first export the structures data to `.vasp` format with Cartesian coordinates and then use the `vasp_xyz.py` 19 | file to generate the `xyz` coordinates file. Here is how you can do it: 20 | 21 | ``` 22 | from vasp_xyz import * 23 | vasp_to_xyz('unit_cell.vasp') 24 | vasp_to_xyz('supercell.vasp') 25 | ``` 26 | 27 | You will obtain the `unit_cell.xyz` and `supercell.xyz` files which can be used in CP2K. Also, the cell size will be printed out 28 | (the same as below) and you can copy and paste them in `&CELL` section of the CP2K input. 29 | ``` 30 | [32, 96, 8, 16, 4] ['C', 'H', 'N', 'I', 'Pb'] 31 | A 8.4280004501 0.0000000000 0.0000000000 32 | B 0.0000000000 8.9860000610 0.0000000000 33 | C 0.0000000000 0.0000000000 26.2329998016 34 | ``` 35 | 36 | 37 | **Note:** You can also use the `cif` file directly in CP2K by setting the name of the `cif` file in `COORD_FILE_NAME` in `&TOPOLOGY` 38 | section and change the format to `cif` file by changing the `COORD_FILE_FORMAT` to `CIF`. It is also recommended to add this part to 39 | your input in the `&TOPOLOGY` section in case you use the raw `cif` file: 40 | 41 | ``` 42 | &GENERATE 43 | REORDER .TRUE. 44 | &END GENERATE 45 | ``` 46 | 47 | -------------------------------------------------------------------------------- /0_structure_preparation/3_BA2_PbI4/vasp_xyz.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import numpy as np 4 | 5 | 6 | def vasp_to_xyz(filename): 7 | 8 | f = open(filename,'r') 9 | lines = f.readlines() 10 | f.close() 11 | 12 | xyz_file_name = filename.replace('.vasp','')+'.xyz' 13 | f = open(xyz_file_name,'w') 14 | types = lines[5].split() 15 | n_types = [int(lines[6].split()[i]) for i in range(len(lines[6].split()))] 16 | print(n_types,types) 17 | coord = [] 18 | for i in range(8,len(lines)): 19 | tmp_line = lines[i].split() 20 | x = float(tmp_line[0]) 21 | y = float(tmp_line[1]) 22 | z = float(tmp_line[2]) 23 | coord.append([x,y,z]) 24 | print('A',lines[2]) 25 | print('B',lines[3]) 26 | print('C',lines[4]) 27 | 28 | f.write(str(np.sum(np.array(n_types)))+'\n\n') 29 | 30 | counter = 0 31 | for i in range(len(types)): 32 | for k in range(n_types[i]): 33 | f.write(types[i]+' '+str(coord[counter][0])+' '+str(coord[counter][1])+' '+str(coord[counter][2])+'\n') 34 | counter += 1 35 | 36 | f.close() 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /10_supercell/3_BA2_PbI4/b3lyp.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_supercell_B3LYP 4 | RUN_TYPE ENERGY 5 | EXTENDED_FFT_LENGTHS .TRUE. 6 | &END GLOBAL 7 | &FORCE_EVAL 8 | METHOD QS 9 | &DFT 10 | UKS .FALSE. 11 | BASIS_SET_FILE_NAME BASIS_MOLOPT 12 | BASIS_SET_FILE_NAME BASIS_ADMM 13 | BASIS_SET_FILE_NAME BASIS_ADMM_MOLOPT 14 | POTENTIAL_FILE_NAME GTH_POTENTIALS 15 | WFN_RESTART_FILE_NAME BA2_PbI4_supercell_PBE-RESTART.wfn 16 | &MGRID 17 | NGRIDS 16 18 | CUTOFF 500 19 | REL_CUTOFF 50 20 | &END MGRID 21 | &QS 22 | METHOD GPW 23 | EPS_DEFAULT 1.000E-14 24 | &END QS 25 | &POISSON 26 | PERIODIC XYZ 27 | PSOLVER PERIODIC 28 | &END 29 | &SCF 30 | &DIAGONALIZATION ON 31 | &END DIAGONALIZATION 32 | &MIXING 33 | ALPHA 0.3 34 | METHOD BROYDEN_MIXING 35 | NBROYDEN 8 36 | &END MIXING 37 | EPS_SCF 1.0E-6 38 | SCF_GUESS RESTART 39 | MAX_SCF 50 40 | ADDED_MOS 50 41 | &END SCF 42 | &XC 43 | &XC_FUNCTIONAL 44 | &LIBXC 45 | FUNCTIONAL XC_HYB_GGA_XC_B3LYP 46 | &END LIBXC 47 | &END XC_FUNCTIONAL 48 | &HF 49 | &SCREENING 50 | EPS_SCHWARZ 1.0E-10 51 | &END 52 | !&MEMORY 53 | ! This is the maximum memory for each processor in MBi, I just comment it but 54 | ! you can obtain it through computing the memory you ask in the slurm file 55 | ! divided by the number of processors. 56 | ! MAX_MEMORY 10000 57 | ! EPS_STORAGE_SCALING 0.1 58 | !&END MEMORY 59 | FRACTION 0.20 60 | &END 61 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 62 | &XC_GRID 63 | XC_DERIV SPLINE2_SMOOTH 64 | &END XC_GRID 65 | &VDW_POTENTIAL 66 | POTENTIAL_TYPE PAIR_POTENTIAL 67 | &PAIR_POTENTIAL 68 | PARAMETER_FILE_NAME dftd3.dat 69 | TYPE DFTD3 70 | REFERENCE_FUNCTIONAL PBE 71 | R_CUTOFF [angstrom] 16 72 | &END 73 | &END VDW_POTENTIAL 74 | &END XC 75 | &AUXILIARY_DENSITY_MATRIX_METHOD 76 | METHOD BASIS_PROJECTION 77 | ADMM_PURIFICATION_METHOD NONE 78 | &END 79 | &PRINT 80 | &MULLIKEN OFF 81 | &END 82 | &HIRSHFELD OFF 83 | &END 84 | &MO_CUBES 85 | NHOMO -1 ! All HOMOs 86 | NLUMO -1 ! All LUMOs 87 | WRITE_CUBE F 88 | &END 89 | &END PRINT 90 | &END DFT 91 | &SUBSYS 92 | 93 | &CELL 94 | A 16.8560009003 0.0000000000 0.0000000000 95 | B 0.0000000000 17.9720001221 0.0000000000 96 | C 0.0000000000 0.0000000000 52.4659996033 97 | PERIODIC XYZ 98 | &END CELL 99 | 100 | &TOPOLOGY 101 | COORD_FILE_NAME supercell.xyz 102 | COORD_FILE_FORMAT XYZ 103 | ! Only in case you use cif file 104 | !&GENERATE 105 | ! REORDER T 106 | !&END 107 | &END 108 | 109 | &KIND Cs 110 | BASIS_SET DZVP-MOLOPT-SR-GTH 111 | BASIS_SET AUX_FIT cFIT9 112 | POTENTIAL GTH-BLYP-q9 113 | &END KIND 114 | &KIND Pb 115 | BASIS_SET DZVP-MOLOPT-SR-GTH 116 | BASIS_SET AUX_FIT cFIT6 117 | POTENTIAL GTH-BLYP-q4 118 | &END KIND 119 | &KIND I 120 | BASIS_SET DZVP-MOLOPT-SR-GTH 121 | BASIS_SET AUX_FIT cFIT6 122 | POTENTIAL GTH-BLYP-q7 123 | &END KIND 124 | &KIND H 125 | BASIS_SET DZVP-MOLOPT-GTH 126 | BASIS_SET AUX_FIT cFIT3 127 | POTENTIAL GTH-BLYP-q1 128 | &END KIND 129 | &KIND C 130 | BASIS_SET DZVP-MOLOPT-GTH 131 | BASIS_SET AUX_FIT cFIT3 132 | POTENTIAL GTH-BLYP-q4 133 | &END KIND 134 | &KIND O 135 | BASIS_SET DZVP-MOLOPT-GTH 136 | BASIS_SET AUX_FIT cFIT3 137 | POTENTIAL GTH-BLYP-q6 138 | &END KIND 139 | &KIND N 140 | BASIS_SET DZVP-MOLOPT-GTH 141 | BASIS_SET AUX_FIT cFIT3 142 | POTENTIAL GTH-BLYP-q5 143 | &END KIND 144 | &END SUBSYS 145 | &END FORCE_EVAL 146 | -------------------------------------------------------------------------------- /10_supercell/3_BA2_PbI4/pbe-tddft.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_supercell_PBE 4 | RUN_TYPE ENERGY 5 | EXTENDED_FFT_LENGTHS .TRUE. 6 | &END GLOBAL 7 | &FORCE_EVAL 8 | METHOD QS 9 | &PROPERTIES 10 | &TDDFPT 11 | NSTATES 20 # number of excited states 12 | MAX_ITER 200 # maximum number of Davidson iterations 13 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 14 | &MGRID 15 | NGRIDS 16 16 | CUTOFF 500 # separate cutoff for TDDFPT calc 17 | &END 18 | ! Only in case you have a tdwfn file from previous calculations 19 | !RESTART .TRUE. 20 | !WFN_RESTART_FILE_NAME RESTART.tdwfn 21 | &END TDDFPT 22 | &END PROPERTIES 23 | &DFT 24 | UKS .FALSE. 25 | BASIS_SET_FILE_NAME BASIS_MOLOPT 26 | POTENTIAL_FILE_NAME GTH_POTENTIALS 27 | &MGRID 28 | NGRIDS 16 29 | CUTOFF 500 30 | REL_CUTOFF 50 31 | &END MGRID 32 | &QS 33 | METHOD GPW 34 | EPS_DEFAULT 1.000E-14 35 | &END QS 36 | &POISSON 37 | PERIODIC XYZ 38 | PSOLVER PERIODIC 39 | &END 40 | &SCF 41 | &DIAGONALIZATION ON 42 | &END DIAGONALIZATION 43 | &MIXING 44 | ALPHA 0.3 45 | METHOD BROYDEN_MIXING 46 | NBROYDEN 8 47 | &END MIXING 48 | EPS_SCF 1.0E-6 49 | SCF_GUESS RESTART 50 | MAX_SCF 50 51 | ADDED_MOS 50 52 | &END SCF 53 | &XC 54 | &XC_FUNCTIONAL 55 | &PBE 56 | &END PBE 57 | &END XC_FUNCTIONAL 58 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 59 | &XC_GRID 60 | XC_DERIV SPLINE2_SMOOTH 61 | &END XC_GRID 62 | &VDW_POTENTIAL 63 | POTENTIAL_TYPE PAIR_POTENTIAL 64 | &PAIR_POTENTIAL 65 | PARAMETER_FILE_NAME dftd3.dat 66 | TYPE DFTD3 67 | REFERENCE_FUNCTIONAL PBE 68 | R_CUTOFF [angstrom] 16 69 | &END 70 | &END VDW_POTENTIAL 71 | &END XC 72 | &PRINT 73 | &MULLIKEN OFF 74 | &END 75 | &HIRSHFELD OFF 76 | &END 77 | &END PRINT 78 | &END DFT 79 | &SUBSYS 80 | 81 | &CELL 82 | A 16.8560009003 0.0000000000 0.0000000000 83 | B 0.0000000000 17.9720001221 0.0000000000 84 | C 0.0000000000 0.0000000000 52.4659996033 85 | PERIODIC XYZ 86 | &END CELL 87 | 88 | &TOPOLOGY 89 | COORD_FILE_NAME supercell.xyz 90 | COORD_FILE_FORMAT XYZ 91 | ! Only in case you use cif file 92 | !&GENERATE 93 | ! REORDER T 94 | !&END 95 | &END 96 | 97 | &KIND Cs 98 | BASIS_SET DZVP-MOLOPT-SR-GTH 99 | POTENTIAL GTH-PBE-q9 100 | &END KIND 101 | &KIND Pb 102 | BASIS_SET DZVP-MOLOPT-SR-GTH 103 | POTENTIAL GTH-PBE-q4 104 | &END KIND 105 | &KIND I 106 | BASIS_SET DZVP-MOLOPT-SR-GTH 107 | POTENTIAL GTH-PBE-q7 108 | &END KIND 109 | &KIND H 110 | BASIS_SET DZVP-MOLOPT-GTH 111 | POTENTIAL GTH-PBE-q1 112 | &END KIND 113 | &KIND C 114 | BASIS_SET DZVP-MOLOPT-GTH 115 | POTENTIAL GTH-PBE-q4 116 | &END KIND 117 | &KIND O 118 | BASIS_SET DZVP-MOLOPT-GTH 119 | POTENTIAL GTH-PBE-q6 120 | &END KIND 121 | &KIND N 122 | BASIS_SET DZVP-MOLOPT-GTH 123 | POTENTIAL GTH-PBE-q5 124 | &END KIND 125 | &END SUBSYS 126 | &END FORCE_EVAL 127 | -------------------------------------------------------------------------------- /10_supercell/3_BA2_PbI4/pbe.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_supercell_PBE 4 | RUN_TYPE ENERGY 5 | EXTENDED_FFT_LENGTHS .TRUE. 6 | &END GLOBAL 7 | &FORCE_EVAL 8 | METHOD QS 9 | &DFT 10 | UKS .FALSE. 11 | BASIS_SET_FILE_NAME BASIS_MOLOPT 12 | POTENTIAL_FILE_NAME GTH_POTENTIALS 13 | &MGRID 14 | NGRIDS 16 15 | CUTOFF 1000 16 | REL_CUTOFF 50 17 | &END MGRID 18 | &QS 19 | METHOD GPW 20 | EPS_DEFAULT 1.000E-14 21 | &END QS 22 | &POISSON 23 | PERIODIC XYZ 24 | PSOLVER PERIODIC 25 | &END 26 | &SCF 27 | &DIAGONALIZATION ON 28 | &END DIAGONALIZATION 29 | &MIXING 30 | ALPHA 0.3 31 | METHOD BROYDEN_MIXING 32 | NBROYDEN 8 33 | &END MIXING 34 | EPS_SCF 1.0E-6 35 | SCF_GUESS RESTART 36 | MAX_SCF 50 37 | ADDED_MOS 50 38 | &END SCF 39 | &XC 40 | &XC_FUNCTIONAL 41 | &PBE 42 | &END PBE 43 | &END XC_FUNCTIONAL 44 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 45 | &XC_GRID 46 | XC_DERIV SPLINE2_SMOOTH 47 | &END XC_GRID 48 | &VDW_POTENTIAL 49 | POTENTIAL_TYPE PAIR_POTENTIAL 50 | &PAIR_POTENTIAL 51 | PARAMETER_FILE_NAME dftd3.dat 52 | TYPE DFTD3 53 | REFERENCE_FUNCTIONAL PBE 54 | R_CUTOFF [angstrom] 16 55 | &END 56 | &END VDW_POTENTIAL 57 | &END XC 58 | &PRINT 59 | &MULLIKEN OFF 60 | &END 61 | &HIRSHFELD OFF 62 | &END 63 | &END PRINT 64 | &END DFT 65 | &SUBSYS 66 | 67 | &CELL 68 | A 16.8560009003 0.0000000000 0.0000000000 69 | B 0.0000000000 17.9720001221 0.0000000000 70 | C 0.0000000000 0.0000000000 52.4659996033 71 | PERIODIC XYZ 72 | &END CELL 73 | 74 | &TOPOLOGY 75 | COORD_FILE_NAME supercell.xyz 76 | COORD_FILE_FORMAT XYZ 77 | ! Only in case you use cif file 78 | !&GENERATE 79 | ! REORDER T 80 | !&END 81 | &END 82 | 83 | &KIND Cs 84 | BASIS_SET DZVP-MOLOPT-SR-GTH 85 | POTENTIAL GTH-PBE-q9 86 | &END KIND 87 | &KIND Pb 88 | BASIS_SET DZVP-MOLOPT-SR-GTH 89 | POTENTIAL GTH-PBE-q4 90 | &END KIND 91 | &KIND I 92 | BASIS_SET DZVP-MOLOPT-SR-GTH 93 | POTENTIAL GTH-PBE-q7 94 | &END KIND 95 | &KIND H 96 | BASIS_SET DZVP-MOLOPT-GTH 97 | POTENTIAL GTH-PBE-q1 98 | &END KIND 99 | &KIND C 100 | BASIS_SET DZVP-MOLOPT-GTH 101 | POTENTIAL GTH-PBE-q4 102 | &END KIND 103 | &KIND O 104 | BASIS_SET DZVP-MOLOPT-GTH 105 | POTENTIAL GTH-PBE-q6 106 | &END KIND 107 | &KIND N 108 | BASIS_SET DZVP-MOLOPT-GTH 109 | POTENTIAL GTH-PBE-q5 110 | &END KIND 111 | &END SUBSYS 112 | &END FORCE_EVAL 113 | -------------------------------------------------------------------------------- /10_supercell/README.md: -------------------------------------------------------------------------------- 1 | # CP2K for a thousand atoms system 2 | 3 | Now, it is time to perform the calculations mentioned in the previous sections to a 2x2x2 supercell of (BA)2PbI4 with CP2K. 4 | The system contains 1248 atoms that are stored in `supercell.xyz` file. 5 | Here, we will only study some types of calculations due to relatively high computational cost 6 | although the computational cost for such system seems to be pretty good. 7 | 8 | -------------------------------------------------------------------------------- /1_energy/1_c3n4/c3n4.xyz: -------------------------------------------------------------------------------- 1 | 54 2 | 3 | C 13.56855 11.51415 0.76991 4 | N 13.56747 10.04279 0.76931 5 | N 12.38329 12.12821 0.77016 6 | C 12.36337 13.45813 0.77078 7 | C 11.28352 15.47490 0.76977 8 | C 13.56960 15.54676 0.77009 9 | N 10.00928 16.20966 0.76961 10 | N 11.22208 14.14140 0.77018 11 | N 12.40786 16.19450 0.76907 12 | N 13.56951 14.15424 0.77177 13 | N 17.12969 3.87566 0.76873 14 | C 17.12893 5.34684 0.76904 15 | C 15.92211 7.29018 0.77036 16 | C 14.84119 9.30640 0.76928 17 | C 18.33422 7.29109 0.76997 18 | C 17.12776 9.37967 0.76916 19 | C 19.41369 9.30801 0.76944 20 | N 19.47526 7.97448 0.77050 21 | N 18.28935 10.02770 0.76771 22 | N 14.75437 12.12759 0.77023 23 | N 15.96518 10.02642 0.76831 24 | N 17.12790 7.98698 0.77100 25 | N 18.31427 5.96095 0.76820 26 | N 15.94315 5.96012 0.77022 27 | N 14.78019 7.97287 0.76982 28 | C 20.68954 11.51369 0.77000 29 | N 19.50423 12.12763 0.77068 30 | N 20.68822 10.04256 0.76957 31 | N 21.87531 12.12704 0.76980 32 | C 14.77550 13.45766 0.77110 33 | C 15.85607 15.47389 0.77016 34 | C 19.48403 13.45785 0.77087 35 | C 18.40422 15.47456 0.77025 36 | C 21.89639 13.45718 0.77102 37 | C 20.69062 15.54646 0.77064 38 | C 22.97701 15.47348 0.77066 39 | N 14.73188 16.19376 0.76897 40 | N 15.91715 14.14041 0.77106 41 | N 17.12986 16.20996 0.77002 42 | N 19.52859 16.19427 0.77031 43 | N 21.85292 16.19317 0.76967 44 | N 23.03820 14.13967 0.77144 45 | N 20.69038 14.15371 0.77164 46 | N 18.34280 14.14102 0.77015 47 | N 24.25079 16.20970 0.77060 48 | H 10.00875 17.19416 0.76931 49 | H 9.15695 15.71695 0.76980 50 | H 17.98255 3.38385 0.76787 51 | H 16.27734 3.38297 0.76938 52 | H 24.25032 17.19420 0.77004 53 | H 25.10362 15.71785 0.77112 54 | H 12.71454 9.55111 0.76893 55 | H 21.54041 9.54960 0.76937 56 | H 17.12957 17.19446 0.76977 57 | -------------------------------------------------------------------------------- /1_energy/1_c3n4/energy.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME C3N4-QD 4 | RUN_TYPE ENERGY 5 | !For huge cutoff this keyword is required 6 | EXTENDED_FFT_LENGTHS .TRUE. 7 | &END GLOBAL 8 | 9 | &FORCE_EVAL 10 | METHOD QS 11 | 12 | &DFT 13 | BASIS_SET_FILE_NAME BASIS_MOLOPT 14 | POTENTIAL_FILE_NAME POTENTIAL 15 | MULTIPLICITY 1 16 | 17 | &MGRID 18 | NGRIDS 4 19 | CUTOFF 500 20 | &END MGRID 21 | &QS 22 | METHOD GPW 23 | EPS_DEFAULT 1.000E-14 24 | &END QS 25 | &POISSON 26 | PERIODIC NONE 27 | POISSON_SOLVER ANALYTIC 28 | &END 29 | 30 | &SCF 31 | &DIAGONALIZATION 32 | ALGORITHM DAVIDSON 33 | &END 34 | 35 | &SMEAR 36 | METHOD FERMI_DIRAC 37 | &END 38 | 39 | &MIXING 40 | ALPHA 0.3 41 | METHOD BROYDEN_MIXING 42 | NBROYDEN 8 43 | &END MIXING 44 | 45 | EPS_SCF 1.0E-6 46 | SCF_GUESS ATOMIC 47 | MAX_SCF 50 48 | ADDED_MOS 50 49 | ! Only in case you need outer scf for convergence 50 | !&OUTER_SCF T 51 | ! EPS_SCF 1.0E-06 52 | ! MAX_SCF 20 53 | !&END OUTER_SCF 54 | &END SCF 55 | 56 | &XC 57 | &XC_FUNCTIONAL 58 | &PBE 59 | &END PBE 60 | &END XC_FUNCTIONAL 61 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 62 | &XC_GRID 63 | XC_DERIV SPLINE2_SMOOTH 64 | &END XC_GRID 65 | &VDW_POTENTIAL 66 | POTENTIAL_TYPE PAIR_POTENTIAL 67 | &PAIR_POTENTIAL 68 | PARAMETER_FILE_NAME dftd3.dat 69 | TYPE DFTD3 70 | REFERENCE_FUNCTIONAL PBE 71 | &END 72 | &END VDW_POTENTIAL 73 | &END XC 74 | &PRINT 75 | &MULLIKEN OFF 76 | &END 77 | &HIRSHFELD OFF 78 | &END 79 | &MO_CUBES 80 | NHOMO 3 81 | NLUMO 3 82 | ! If the it is set to .TRUE. or T, it will print out the cube files 83 | ! In this case it will only print all the HOMO energies and 3 LUMO energies 84 | WRITE_CUBE F 85 | &END 86 | &PDOS 87 | APPEND .TRUE. 88 | COMPONENTS .TRUE. 89 | NLUMO -1 90 | &END PDOS 91 | &END PRINT 92 | &END DFT 93 | &SUBSYS 94 | 95 | &CELL 96 | A 25.0000000000 0.0000000000 0.0000000000 97 | B 0.0000000000 25.0000000000 0.0000000000 98 | C 0.0000000000 0.0000000000 10.0000000000 99 | PERIODIC NONE 100 | &END CELL 101 | 102 | &TOPOLOGY 103 | COORD_FILE_NAME c3n4.xyz 104 | COORD_FILE_FORMAT XYZ 105 | ! Only in case you use cif file 106 | !&GENERATE 107 | ! REORDER T 108 | !&END 109 | &END 110 | 111 | &KIND H 112 | BASIS_SET DZVP-MOLOPT-GTH 113 | POTENTIAL GTH-PBE-q1 114 | &END KIND 115 | &KIND C 116 | BASIS_SET DZVP-MOLOPT-GTH 117 | POTENTIAL GTH-PBE-q4 118 | &END KIND 119 | &KIND N 120 | BASIS_SET DZVP-MOLOPT-GTH 121 | POTENTIAL GTH-PBE-q5 122 | &END KIND 123 | &END SUBSYS 124 | &END FORCE_EVAL 125 | 126 | 127 | -------------------------------------------------------------------------------- /1_energy/1_c3n4/output.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/1_energy/1_c3n4/output.tar.bz2 -------------------------------------------------------------------------------- /1_energy/1_c3n4/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=valhalla --qos=valhalla 3 | #SBATCH --clusters=faculty 4 | 5 | #SBATCH --time=00:30:00 6 | #SBATCH --nodes=1 7 | #SBATCH --ntasks-per-node=9 8 | #SBATCH --cpus-per-task=1 9 | #SBATCH --mem=28000 10 | ###SBATCH --mail-user=alexeyak@buffalo.edu 11 | echo "SLURM_JOBID="$SLURM_JOBID 12 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 13 | echo "SLURM_NNODES="$SLURM_NNODES 14 | echo "SLURMTMPDIR="$SLURMTMPDIR 15 | echo "working directory="$SLURM_SUBMIT_DIR 16 | 17 | NPROCS=`srun --nodes=${SLURM_NNODES} bash -c 'hostname' |wc -l` 18 | echo NPROCS=$NPROCS 19 | 20 | 21 | module load cp2k/8.1-sse 22 | 23 | #module load openmpi/3.0.3/gcc-7.3.0 24 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 25 | 26 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 27 | omp_threads=$SLURM_CPUS_PER_TASK 28 | else 29 | omp_threads=1 30 | fi 31 | export OMP_NUM_THREADS=$omp_threads 32 | 33 | 34 | 35 | 36 | mpirun -n $NPROCS cp2k.popt -i energy.inp -o OUT-conv-anal-$cutoff-$ngrids.log 37 | echo "Done!" 38 | 39 | 40 | -------------------------------------------------------------------------------- /2_convergence_analysis/1_c3n4/c3n4.xyz: -------------------------------------------------------------------------------- 1 | 54 2 | 3 | C 13.56855 11.51415 0.76991 4 | N 13.56747 10.04279 0.76931 5 | N 12.38329 12.12821 0.77016 6 | C 12.36337 13.45813 0.77078 7 | C 11.28352 15.47490 0.76977 8 | C 13.56960 15.54676 0.77009 9 | N 10.00928 16.20966 0.76961 10 | N 11.22208 14.14140 0.77018 11 | N 12.40786 16.19450 0.76907 12 | N 13.56951 14.15424 0.77177 13 | N 17.12969 3.87566 0.76873 14 | C 17.12893 5.34684 0.76904 15 | C 15.92211 7.29018 0.77036 16 | C 14.84119 9.30640 0.76928 17 | C 18.33422 7.29109 0.76997 18 | C 17.12776 9.37967 0.76916 19 | C 19.41369 9.30801 0.76944 20 | N 19.47526 7.97448 0.77050 21 | N 18.28935 10.02770 0.76771 22 | N 14.75437 12.12759 0.77023 23 | N 15.96518 10.02642 0.76831 24 | N 17.12790 7.98698 0.77100 25 | N 18.31427 5.96095 0.76820 26 | N 15.94315 5.96012 0.77022 27 | N 14.78019 7.97287 0.76982 28 | C 20.68954 11.51369 0.77000 29 | N 19.50423 12.12763 0.77068 30 | N 20.68822 10.04256 0.76957 31 | N 21.87531 12.12704 0.76980 32 | C 14.77550 13.45766 0.77110 33 | C 15.85607 15.47389 0.77016 34 | C 19.48403 13.45785 0.77087 35 | C 18.40422 15.47456 0.77025 36 | C 21.89639 13.45718 0.77102 37 | C 20.69062 15.54646 0.77064 38 | C 22.97701 15.47348 0.77066 39 | N 14.73188 16.19376 0.76897 40 | N 15.91715 14.14041 0.77106 41 | N 17.12986 16.20996 0.77002 42 | N 19.52859 16.19427 0.77031 43 | N 21.85292 16.19317 0.76967 44 | N 23.03820 14.13967 0.77144 45 | N 20.69038 14.15371 0.77164 46 | N 18.34280 14.14102 0.77015 47 | N 24.25079 16.20970 0.77060 48 | H 10.00875 17.19416 0.76931 49 | H 9.15695 15.71695 0.76980 50 | H 17.98255 3.38385 0.76787 51 | H 16.27734 3.38297 0.76938 52 | H 24.25032 17.19420 0.77004 53 | H 25.10362 15.71785 0.77112 54 | H 12.71454 9.55111 0.76893 55 | H 21.54041 9.54960 0.76937 56 | H 17.12957 17.19446 0.76977 57 | -------------------------------------------------------------------------------- /2_convergence_analysis/1_c3n4/energy.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME C3N4-QD 4 | RUN_TYPE ENERGY 5 | !For huge cutoff this keyword is required 6 | EXTENDED_FFT_LENGTHS .TRUE. 7 | &END GLOBAL 8 | &FORCE_EVAL 9 | METHOD QS 10 | &DFT 11 | UKS .TRUE. 12 | BASIS_SET_FILE_NAME BASIS_MOLOPT 13 | POTENTIAL_FILE_NAME POTENTIAL 14 | &MGRID 15 | NGRIDS 12 16 | CUTOFF 1300 17 | &END MGRID 18 | &QS 19 | METHOD GPW 20 | EPS_DEFAULT 1.000E-14 21 | &END QS 22 | &POISSON 23 | PERIODIC NONE 24 | POISSON_SOLVER ANALYTIC 25 | &END 26 | &SCF 27 | &DIAGONALIZATION ON 28 | &END DIAGONALIZATION 29 | &MIXING 30 | ALPHA 0.3 31 | METHOD BROYDEN_MIXING 32 | NBROYDEN 8 33 | &END MIXING 34 | EPS_SCF 1.0E-6 35 | SCF_GUESS ATOMIC 36 | MAX_SCF 50 37 | ADDED_MOS 50 38 | ! Only in case you need outer scf for convergence 39 | !&OUTER_SCF T 40 | ! EPS_SCF 1.0E-06 41 | ! MAX_SCF 20 42 | !&END OUTER_SCF 43 | &END SCF 44 | &XC 45 | &XC_FUNCTIONAL 46 | &PBE 47 | &END PBE 48 | &END XC_FUNCTIONAL 49 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 50 | &XC_GRID 51 | XC_DERIV SPLINE2_SMOOTH 52 | &END XC_GRID 53 | &VDW_POTENTIAL 54 | POTENTIAL_TYPE PAIR_POTENTIAL 55 | &PAIR_POTENTIAL 56 | PARAMETER_FILE_NAME dftd3.dat 57 | TYPE DFTD3 58 | REFERENCE_FUNCTIONAL PBE 59 | &END 60 | &END VDW_POTENTIAL 61 | &END XC 62 | &PRINT 63 | &MULLIKEN OFF 64 | &END 65 | &HIRSHFELD OFF 66 | &END 67 | &MO_CUBES 68 | NHOMO 3 69 | NLUMO 3 70 | ! If the it is set to .TRUE. or T, it will print out the cube files 71 | ! In this case it will only print all the HOMO energies and 3 LUMO energies 72 | WRITE_CUBE F 73 | &END 74 | &PDOS 75 | APPEND .TRUE. 76 | COMPONENTS .TRUE. 77 | NLUMO -1 78 | &END PDOS 79 | &END PRINT 80 | &END DFT 81 | &SUBSYS 82 | 83 | &CELL 84 | A 25.0000000000 0.0000000000 0.0000000000 85 | B 0.0000000000 25.0000000000 0.0000000000 86 | C 0.0000000000 0.0000000000 10.0000000000 87 | PERIODIC NONE 88 | &END CELL 89 | 90 | &TOPOLOGY 91 | COORD_FILE_NAME c3n4.xyz 92 | COORD_FILE_FORMAT XYZ 93 | ! Only in case you use cif file 94 | !&GENERATE 95 | ! REORDER T 96 | !&END 97 | &END 98 | 99 | &KIND H 100 | BASIS_SET DZVP-MOLOPT-GTH 101 | POTENTIAL GTH-PBE-q1 102 | &END KIND 103 | &KIND C 104 | BASIS_SET DZVP-MOLOPT-GTH 105 | POTENTIAL GTH-PBE-q4 106 | &END KIND 107 | &KIND N 108 | BASIS_SET DZVP-MOLOPT-GTH 109 | POTENTIAL GTH-PBE-q5 110 | &END KIND 111 | &END SUBSYS 112 | &END FORCE_EVAL 113 | 114 | 115 | -------------------------------------------------------------------------------- /2_convergence_analysis/1_c3n4/output.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/2_convergence_analysis/1_c3n4/output.tar.bz2 -------------------------------------------------------------------------------- /2_convergence_analysis/1_c3n4/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=valhalla --qos=valhalla 3 | #SBATCH --clusters=faculty 4 | 5 | #SBATCH --time=02:30:00 6 | #SBATCH --nodes=1 7 | #SBATCH --ntasks-per-node=9 8 | #SBATCH --cpus-per-task=1 9 | #SBATCH --mem=68000 10 | ###SBATCH --mail-user=alexeyak@buffalo.edu 11 | echo "SLURM_JOBID="$SLURM_JOBID 12 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 13 | echo "SLURM_NNODES="$SLURM_NNODES 14 | echo "SLURMTMPDIR="$SLURMTMPDIR 15 | echo "working directory="$SLURM_SUBMIT_DIR 16 | 17 | NPROCS=`srun --nodes=${SLURM_NNODES} bash -c 'hostname' |wc -l` 18 | echo NPROCS=$NPROCS 19 | 20 | 21 | module load cp2k/8.1-sse 22 | 23 | #module load openmpi/3.0.3/gcc-7.3.0 24 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 25 | 26 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 27 | omp_threads=$SLURM_CPUS_PER_TASK 28 | else 29 | omp_threads=1 30 | fi 31 | export OMP_NUM_THREADS=$omp_threads 32 | 33 | 34 | 35 | # Remember you need to have the CP2K loaded. This is done either by `module load` or by exporting the path. 36 | # This is explained in Readme.md file 37 | 38 | for cutoff in {100..1300..200}; do 39 | for ngrids in {4,,8,12}; do 40 | # Substituting the CUTOFF value 41 | sed -i "/CUTOFF /c\ CUTOFF $cutoff" energy.inp 42 | # Substituting the NGRIDS value 43 | sed -i "/NGRIDS /c\ NGRIDS $ngrids" energy.inp 44 | echo "----------$cutoff-------" 45 | echo "Running for cutoff $cutoff Ry and NGRIDS $ngrids..." 46 | mpirun -n $NPROCS cp2k.popt -i energy.inp -o OUT-conv-anal-$cutoff-$ngrids.log 47 | echo "Done!" 48 | # This command will 49 | awk 'c&&!--c;/SCF WAVEFU/{c=4}' OUT-conv-anal-$cutoff-$ngrids.log | awk '{print $1 " " $4 " " $6}' 50 | # You can also use this command as well 51 | #cat OUT-conv-anal-$cutoff.log | grep -A 4 'SCF WAVEFUNC' 52 | 53 | done 54 | done 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /2_convergence_analysis/3_BA2_PbI4/conv_anal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Remember you need to have the CP2K loaded. This is done either by `module load` or by exporting the path. 4 | # This is explained in Readme.md file 5 | 6 | for cutoff in {100..1500..100}; do 7 | for ngrids in {4,6,8,10,12,14}; do 8 | # Substituting the CUTOFF value 9 | sed -i "/CUTOFF /c\ CUTOFF $cutoff" energy.inp 10 | # Substituting the NGRIDS value 11 | sed -i "/NGRIDS /c\ NGRIDS $ngrids" energy.inp 12 | echo "----------$cutoff-------" 13 | echo "Running for cutoff $cutoff Ry and NGRIDS $ngrids..." 14 | mpirun -np 25 cp2k.psmp -i energy.inp -o OUT-conv-anal-$cutoff-$ngrids.log 15 | echo "Done!" 16 | # This command will 17 | awk 'c&&!--c;/SCF WAVEFU/{c=4}' OUT-conv-anal-$cutoff-$ngrids.log | awk '{print $1 " " $4 " " $6}' 18 | # You can also use this command as well 19 | #cat OUT-conv-anal-$cutoff.log | grep -A 4 'SCF WAVEFUNC' 20 | 21 | done 22 | done 23 | 24 | 25 | -------------------------------------------------------------------------------- /2_convergence_analysis/3_BA2_PbI4/energy.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_unit_cell 4 | RUN_TYPE ENERGY 5 | !For huge cutoff this keyword is required 6 | EXTENDED_FFT_LENGTHS .TRUE. 7 | &END GLOBAL 8 | &FORCE_EVAL 9 | METHOD QS 10 | &DFT 11 | UKS .FALSE. 12 | BASIS_SET_FILE_NAME BASIS_MOLOPT 13 | POTENTIAL_FILE_NAME POTENTIAL 14 | &MGRID 15 | ! Increase the NGRIDS for large cutoff values and large cells 16 | NGRIDS 14 17 | CUTOFF 1000 18 | REL_CUTOFF 50 19 | &END MGRID 20 | &QS 21 | METHOD GPW 22 | EPS_DEFAULT 1.000E-14 23 | &END QS 24 | &POISSON 25 | PERIODIC XYZ 26 | PSOLVER PERIODIC 27 | &END 28 | &SCF 29 | &DIAGONALIZATION ON 30 | &END DIAGONALIZATION 31 | &MIXING 32 | ALPHA 0.3 33 | METHOD BROYDEN_MIXING 34 | NBROYDEN 8 35 | &END MIXING 36 | EPS_SCF 1.0E-6 37 | SCF_GUESS ATOMIC 38 | MAX_SCF 1 39 | ADDED_MOS 50 40 | ! Only in case you need outer scf for convergence 41 | !&OUTER_SCF T 42 | ! EPS_SCF 1.0E-06 43 | ! MAX_SCF 20 44 | !&END OUTER_SCF 45 | &END SCF 46 | &XC 47 | &XC_FUNCTIONAL 48 | &PBE 49 | &END PBE 50 | &END XC_FUNCTIONAL 51 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 52 | &XC_GRID 53 | XC_DERIV SPLINE2_SMOOTH 54 | &END XC_GRID 55 | &VDW_POTENTIAL 56 | POTENTIAL_TYPE PAIR_POTENTIAL 57 | &PAIR_POTENTIAL 58 | PARAMETER_FILE_NAME dftd3.dat 59 | TYPE DFTD3 60 | REFERENCE_FUNCTIONAL PBE 61 | &END 62 | &END VDW_POTENTIAL 63 | &END XC 64 | &PRINT 65 | &MULLIKEN OFF 66 | &END 67 | &HIRSHFELD OFF 68 | &END 69 | &MO_CUBES 70 | NHOMO 3 71 | NLUMO 3 72 | ! If the it is set to .TRUE. or T, it will print out the cube files 73 | ! In this case it will only print all the HOMO energies and 3 LUMO energies 74 | WRITE_CUBE F 75 | &END 76 | &PDOS 77 | APPEND .TRUE. 78 | COMPONENTS .TRUE. 79 | NLUMO -1 80 | &END PDOS 81 | &END PRINT 82 | &END DFT 83 | &SUBSYS 84 | 85 | &CELL 86 | A 8.4280004501 0.0000000000 0.0000000000 87 | B 0.0000000000 8.9860000610 0.0000000000 88 | C 0.0000000000 0.0000000000 26.2329998016 89 | PERIODIC XYZ 90 | &END CELL 91 | 92 | &TOPOLOGY 93 | COORD_FILE_NAME unit_cell.xyz 94 | COORD_FILE_FORMAT XYZ 95 | ! Only in case you use cif file 96 | !&GENERATE 97 | ! REORDER T 98 | !&END 99 | &END 100 | 101 | &KIND Cs 102 | BASIS_SET DZVP-MOLOPT-SR-GTH 103 | POTENTIAL GTH-PBE-q9 104 | &END KIND 105 | &KIND Pb 106 | BASIS_SET DZVP-MOLOPT-SR-GTH 107 | POTENTIAL GTH-PBE-q4 108 | &END KIND 109 | &KIND I 110 | BASIS_SET DZVP-MOLOPT-SR-GTH 111 | POTENTIAL GTH-PBE-q7 112 | &END KIND 113 | &KIND H 114 | BASIS_SET DZVP-MOLOPT-GTH 115 | POTENTIAL GTH-PBE-q1 116 | &END KIND 117 | &KIND C 118 | BASIS_SET DZVP-MOLOPT-GTH 119 | POTENTIAL GTH-PBE-q4 120 | &END KIND 121 | &KIND O 122 | BASIS_SET DZVP-MOLOPT-GTH 123 | POTENTIAL GTH-PBE-q6 124 | &END KIND 125 | &KIND N 126 | BASIS_SET DZVP-MOLOPT-GTH 127 | POTENTIAL GTH-PBE-q5 128 | &END KIND 129 | &END SUBSYS 130 | &END FORCE_EVAL 131 | 132 | 133 | -------------------------------------------------------------------------------- /2_convergence_analysis/3_BA2_PbI4/unit_cell.xyz: -------------------------------------------------------------------------------- 1 | 156 2 | 3 | C 7.795900345 3.953840017 22.489549637 4 | C 0.632099926 5.032160282 3.74344945 5 | C 4.84610033 5.032160282 9.373051643 6 | C 3.581899881 3.953840017 16.859949112 7 | C 0.632099926 8.446840286 16.859949112 8 | C 7.795900345 0.539160013 9.373051643 9 | C 3.581899881 0.539160013 3.74344945 10 | C 4.84610033 8.446840286 22.489549637 11 | C 8.065596581 5.274782181 21.791751862 12 | C 0.36240387 3.71121788 4.441247463 13 | C 4.576404095 3.71121788 8.675251007 14 | C 3.851596355 5.274782181 17.557746887 15 | C 0.36240387 0.781782091 17.557746887 16 | C 8.065596581 8.204217911 8.675251007 17 | C 3.851596355 8.204217911 4.441247463 18 | C 4.576404095 0.781782091 21.791751862 19 | C 7.130088329 5.553347588 20.59028244 20 | C 1.297911882 3.432652235 5.642717838 21 | C 5.511912346 3.432652235 7.473780155 22 | C 2.916087866 5.553347588 18.759218216 23 | C 1.297911882 1.060348272 18.759218216 24 | C 7.130088329 7.925652504 7.473780155 25 | C 2.916087866 7.925652504 5.642717838 26 | C 5.511912346 1.060348272 20.59028244 27 | C 7.492492199 6.793416023 19.900354385 28 | C 0.935508072 2.192584276 6.33264637 29 | C 5.149508476 2.192584276 6.783853531 30 | C 3.278491735 6.793416023 19.449146271 31 | C 0.935508072 2.30041647 19.449146271 32 | C 7.492492199 6.685584068 6.783853531 33 | C 3.278491735 6.685584068 6.33264637 34 | C 5.149508476 2.30041647 19.900354385 35 | H 6.839322567 3.886445045 22.709907532 36 | H 1.588678002 5.099555016 3.523091793 37 | H 5.802678108 5.099555016 9.593408585 38 | H 2.625322819 3.886445045 16.639591217 39 | H 1.588678002 8.379445076 16.639591217 40 | H 6.839322567 0.606554985 9.593408585 41 | H 2.625322819 0.606554985 3.523091793 42 | H 5.802678108 8.379445076 22.709907532 43 | H 8.013342857 3.211596489 21.883569717 44 | H 0.414657623 5.774403572 4.349430561 45 | H 4.628657818 5.774403572 8.767068863 46 | H 3.799342155 3.211596489 17.465930939 47 | H 0.414657623 7.704596519 17.465930939 48 | H 8.013342857 1.281403661 8.767068863 49 | H 3.799342155 1.281403661 4.349430561 50 | H 4.628657818 7.704596519 21.883569717 51 | H 0.565519214 5.288261414 21.479579926 52 | H 7.862481117 3.697738886 4.753420353 53 | H 3.648480892 3.697738886 8.363080025 54 | H 4.779519558 5.288261414 17.869920731 55 | H 7.862481117 0.795261204 17.869920731 56 | H 0.565519214 8.190738678 8.363080025 57 | H 4.779519558 8.190738678 4.753420353 58 | H 3.648480892 0.795261204 21.479579926 59 | H 7.962774754 6.004445553 22.442331314 60 | H 0.465225458 2.981554747 3.790668964 61 | H 4.679225922 2.981554747 9.325831413 62 | H 3.748774767 6.004445553 16.907169342 63 | H 0.465225458 1.511445403 16.907169342 64 | H 7.962774754 7.474554539 9.325831413 65 | H 3.748774767 7.474554539 3.790668964 66 | H 4.679225922 1.511445403 22.442331314 67 | H 7.186555862 4.803017139 19.960689545 68 | H 1.241444468 4.182982922 6.27230978 69 | H 5.455444813 4.182982922 6.844190121 70 | H 2.972555637 4.803017139 19.388809204 71 | H 1.241444468 0.31001702 19.388809204 72 | H 7.186555862 8.675983429 6.844190121 73 | H 2.972555637 8.675983429 6.27230978 74 | H 5.455444813 0.31001702 19.960689545 75 | H 6.205536842 5.61265564 20.905076981 76 | H 2.222463846 3.373344421 5.327922821 77 | H 6.436463833 3.373344421 7.78857851 78 | H 1.991536379 5.61265564 18.444423676 79 | H 2.222463846 1.119655013 18.444423676 80 | H 6.205536842 7.866344452 7.78857851 81 | H 1.991536379 7.866344452 5.327922821 82 | H 6.436463833 1.119655013 20.905076981 83 | H 6.885675907 6.937191963 19.157960892 84 | H 1.542324305 2.048807859 7.075039864 85 | H 5.756324768 2.048807859 6.041458607 86 | H 2.671675444 6.937191963 20.191539764 87 | H 1.542324305 2.444192648 20.191539764 88 | H 6.885675907 6.541808128 6.041458607 89 | H 2.671675444 6.541808128 7.075039864 90 | H 5.756324768 2.444192648 19.157960892 91 | H 8.40103054 6.725121975 19.567193985 92 | H 0.026969556 2.260877848 6.665805817 93 | H 4.240969658 2.260877848 6.450692654 94 | H 4.187030315 6.725121975 19.782306671 95 | H 0.026969556 2.232122183 19.782306671 96 | H 8.40103054 6.753878117 6.450692654 97 | H 4.187030315 6.753878117 6.665805817 98 | H 4.240969658 2.232122183 19.567193985 99 | H 7.429282665 7.536558151 20.519451141 100 | H 0.998718023 1.449441791 5.713547707 101 | H 5.21271801 1.449441791 7.402952194 102 | H 3.215282202 7.536558151 18.830047607 103 | H 0.998718023 3.043558836 18.830047607 104 | H 7.429282665 5.94244194 7.402952194 105 | H 3.215282202 5.94244194 5.713547707 106 | H 5.21271801 3.043558836 20.519451141 107 | H 8.391759872 3.047152758 24.068777084 108 | H 0.036240388 5.938847542 2.164222002 109 | H 4.250240803 5.938847542 10.952278137 110 | H 4.177759647 3.047152758 15.280721664 111 | H 0.036240388 7.54015255 15.280721664 112 | H 8.391759872 1.445847392 10.952278137 113 | H 4.177759647 1.445847392 2.164222002 114 | H 4.250240803 7.54015255 24.068777084 115 | H 8.347933769 4.506479263 24.23666954 116 | H 0.080066226 4.479520798 1.996331096 117 | H 4.294066429 4.479520798 11.120168686 118 | H 4.133934021 4.506479263 15.112831116 119 | H 0.080066226 0.013479094 15.112831116 120 | H 8.347933769 8.972520828 11.120168686 121 | H 4.133934021 8.972520828 1.996331096 122 | H 4.294066429 0.013479094 24.23666954 123 | H 1.009674191 3.887343645 23.470664978 124 | H 7.418326378 5.098656178 2.762335062 125 | H 3.204325914 5.098656178 10.354166031 126 | H 5.223674297 3.887343645 15.878834724 127 | H 7.418326378 8.380343437 15.878834724 128 | H 1.009674191 0.605656505 10.354166031 129 | H 5.223674297 0.605656505 2.762335062 130 | H 3.204325914 8.380343437 23.470664978 131 | N 0.134848282 3.837021828 23.675281525 132 | N 8.293151855 5.148978233 2.557718277 133 | N 4.079152107 5.148978233 10.558779716 134 | N 4.348848343 3.837021828 15.674218178 135 | N 8.293151855 8.330021858 15.674218178 136 | N 0.134848282 0.655978143 10.558779716 137 | N 4.348848343 0.655978143 2.557718277 138 | N 4.079152107 8.330021858 23.675281525 139 | I 0.656541646 0.267783314 23.143014908 140 | I 7.771458626 8.718216896 3.089984655 141 | I 3.557458639 8.718216896 10.026515007 142 | I 4.870542049 0.267783314 16.206483841 143 | I 7.771458626 4.760783195 16.206483841 144 | I 0.656541646 4.225216866 10.026515007 145 | I 4.870542049 4.225216866 3.089984655 146 | I 3.557458639 4.760783195 23.143014908 147 | I 5.888644218 1.834941506 25.632001877 148 | I 2.53935647 7.151058674 0.600997984 149 | I 6.753356457 7.151058674 12.515501976 150 | I 1.674643278 1.834941506 13.717497826 151 | I 2.53935647 6.327941418 13.717497826 152 | I 5.888644218 2.658058643 12.515501976 153 | I 1.674643278 2.658058643 0.600997984 154 | I 6.753356457 6.327941418 25.632001877 155 | Pb 0.0 0.0 0.0 156 | Pb 4.214000225 0.0 13.116499901 157 | Pb 0.0 4.493000031 13.116499901 158 | Pb 4.214000225 4.493000031 0.0 159 | -------------------------------------------------------------------------------- /3_geometry_optimization/1_c3n4/1_wavelet/c3n4.xyz: -------------------------------------------------------------------------------- 1 | 54 2 | 3 | C 13.56855 11.51415 0.76991 4 | N 13.56747 10.04279 0.76931 5 | N 12.38329 12.12821 0.77016 6 | C 12.36337 13.45813 0.77078 7 | C 11.28352 15.47490 0.76977 8 | C 13.56960 15.54676 0.77009 9 | N 10.00928 16.20966 0.76961 10 | N 11.22208 14.14140 0.77018 11 | N 12.40786 16.19450 0.76907 12 | N 13.56951 14.15424 0.77177 13 | N 17.12969 3.87566 0.76873 14 | C 17.12893 5.34684 0.76904 15 | C 15.92211 7.29018 0.77036 16 | C 14.84119 9.30640 0.76928 17 | C 18.33422 7.29109 0.76997 18 | C 17.12776 9.37967 0.76916 19 | C 19.41369 9.30801 0.76944 20 | N 19.47526 7.97448 0.77050 21 | N 18.28935 10.02770 0.76771 22 | N 14.75437 12.12759 0.77023 23 | N 15.96518 10.02642 0.76831 24 | N 17.12790 7.98698 0.77100 25 | N 18.31427 5.96095 0.76820 26 | N 15.94315 5.96012 0.77022 27 | N 14.78019 7.97287 0.76982 28 | C 20.68954 11.51369 0.77000 29 | N 19.50423 12.12763 0.77068 30 | N 20.68822 10.04256 0.76957 31 | N 21.87531 12.12704 0.76980 32 | C 14.77550 13.45766 0.77110 33 | C 15.85607 15.47389 0.77016 34 | C 19.48403 13.45785 0.77087 35 | C 18.40422 15.47456 0.77025 36 | C 21.89639 13.45718 0.77102 37 | C 20.69062 15.54646 0.77064 38 | C 22.97701 15.47348 0.77066 39 | N 14.73188 16.19376 0.76897 40 | N 15.91715 14.14041 0.77106 41 | N 17.12986 16.20996 0.77002 42 | N 19.52859 16.19427 0.77031 43 | N 21.85292 16.19317 0.76967 44 | N 23.03820 14.13967 0.77144 45 | N 20.69038 14.15371 0.77164 46 | N 18.34280 14.14102 0.77015 47 | N 24.25079 16.20970 0.77060 48 | H 10.00875 17.19416 0.76931 49 | H 9.15695 15.71695 0.76980 50 | H 17.98255 3.38385 0.76787 51 | H 16.27734 3.38297 0.76938 52 | H 24.25032 17.19420 0.77004 53 | H 25.10362 15.71785 0.77112 54 | H 12.71454 9.55111 0.76893 55 | H 21.54041 9.54960 0.76937 56 | H 17.12957 17.19446 0.76977 57 | -------------------------------------------------------------------------------- /3_geometry_optimization/1_c3n4/1_wavelet/geo_opt.in: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME C3N4-QD 4 | RUN_TYPE GEO_OPT 5 | !For huge cutoff this keyword is required 6 | EXTENDED_FFT_LENGTHS .TRUE. 7 | &END GLOBAL 8 | 9 | &FORCE_EVAL 10 | METHOD QS 11 | 12 | &DFT 13 | BASIS_SET_FILE_NAME BASIS_MOLOPT 14 | POTENTIAL_FILE_NAME POTENTIAL 15 | MULTIPLICITY 1 16 | 17 | &MGRID 18 | NGRIDS 4 19 | CUTOFF 400 20 | &END MGRID 21 | 22 | &QS 23 | METHOD GPW 24 | EPS_DEFAULT 1.000E-14 25 | &END QS 26 | 27 | &POISSON 28 | PERIODIC NONE 29 | POISSON_SOLVER WAVELET 30 | &END 31 | 32 | &SCF 33 | &DIAGONALIZATION 34 | ALGORITHM DAVIDSON 35 | &END 36 | 37 | &SMEAR 38 | METHOD FERMI_DIRAC 39 | &END 40 | 41 | &MIXING 42 | ALPHA 0.3 43 | METHOD BROYDEN_MIXING 44 | NBROYDEN 8 45 | &END MIXING 46 | EPS_SCF 1.0E-8 47 | SCF_GUESS ATOMIC 48 | MAX_SCF 100 49 | ADDED_MOS 10 50 | ! Only in case you need outer scf for convergence 51 | !&OUTER_SCF T 52 | ! EPS_SCF 1.0E-06 53 | ! MAX_SCF 20 54 | !&END OUTER_SCF 55 | &END SCF 56 | 57 | &XC 58 | &XC_FUNCTIONAL 59 | &PBE 60 | &END PBE 61 | &END XC_FUNCTIONAL 62 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 63 | &XC_GRID 64 | XC_DERIV SPLINE2_SMOOTH 65 | &END XC_GRID 66 | &VDW_POTENTIAL 67 | POTENTIAL_TYPE PAIR_POTENTIAL 68 | &PAIR_POTENTIAL 69 | PARAMETER_FILE_NAME dftd3.dat 70 | TYPE DFTD3 71 | REFERENCE_FUNCTIONAL PBE 72 | R_CUTOFF [angstrom] 16 73 | &END 74 | &END VDW_POTENTIAL 75 | &END XC 76 | 77 | &PRINT 78 | &MULLIKEN OFF 79 | &END 80 | &HIRSHFELD OFF 81 | &END 82 | &MO_CUBES 83 | NHOMO 3 84 | NLUMO 3 85 | ! If the it is set to .TRUE. or T, it will print out the cube files 86 | ! In this case it will only print all the HOMO energies and 3 LUMO energies 87 | WRITE_CUBE F 88 | &END 89 | &PDOS 90 | APPEND .FALSE. 91 | COMPONENTS .FALSE. 92 | NLUMO -1 93 | &END PDOS 94 | &END PRINT 95 | &END DFT 96 | &SUBSYS 97 | 98 | &CELL 99 | ABC 35.0 35.0 35.0 100 | PERIODIC NONE 101 | &END CELL 102 | 103 | &TOPOLOGY 104 | COORD_FILE_NAME c3n4.xyz 105 | COORD_FILE_FORMAT XYZ 106 | ! Only in case you use cif file 107 | !&GENERATE 108 | ! REORDER T 109 | !&END 110 | &CENTER_COORDINATES 111 | &END 112 | &END 113 | 114 | &KIND H 115 | BASIS_SET DZVP-MOLOPT-GTH 116 | POTENTIAL GTH-PBE-q1 117 | &END KIND 118 | &KIND C 119 | BASIS_SET DZVP-MOLOPT-GTH 120 | POTENTIAL GTH-PBE-q4 121 | &END KIND 122 | &KIND N 123 | BASIS_SET DZVP-MOLOPT-GTH 124 | POTENTIAL GTH-PBE-q5 125 | &END KIND 126 | &END SUBSYS 127 | &END FORCE_EVAL 128 | 129 | 130 | 131 | &MOTION 132 | &GEO_OPT 133 | OPTIMIZER BFGS 134 | MAX_ITER 550 135 | MAX_DR [bohr] 0.002 136 | MAX_FORCE 3.000E-4 137 | RMS_DR [bohr] 0.002 138 | RMS_FORCE 3.000E-4 139 | &BFGS 140 | &END 141 | &END 142 | &PRINT 143 | &TRAJECTORY 144 | &EACH 145 | GEO_OPT 1 146 | &END EACH 147 | &END TRAJECTORY 148 | &FORCES ON 149 | &END FORCES 150 | &RESTART 151 | BACKUP_COPIES 1 152 | &EACH 153 | GEO_OPT 1 154 | &END EACH 155 | &END RESTART 156 | &END PRINT 157 | &END 158 | 159 | 160 | -------------------------------------------------------------------------------- /3_geometry_optimization/1_c3n4/1_wavelet/output.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/3_geometry_optimization/1_c3n4/1_wavelet/output.tar.bz2 -------------------------------------------------------------------------------- /3_geometry_optimization/1_c3n4/1_wavelet/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=valhalla --qos=valhalla 3 | #SBATCH --clusters=faculty 4 | #SBATCH --time=08:30:00 5 | #SBATCH --nodes=1 6 | #SBATCH --ntasks-per-node=9 7 | #SBATCH --cpus-per-task=1 8 | #SBATCH --mem=78000 9 | ###SBATCH --mail-user=alexeyak@buffalo.edu 10 | echo "SLURM_JOBID="$SLURM_JOBID 11 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 12 | echo "SLURM_NNODES="$SLURM_NNODES 13 | echo "SLURMTMPDIR="$SLURMTMPDIR 14 | echo "working directory="$SLURM_SUBMIT_DIR 15 | 16 | NPROCS=`srun --nodes=${SLURM_NNODES} bash -c 'hostname' |wc -l` 17 | echo NPROCS=$NPROCS 18 | 19 | 20 | module load cp2k/8.1-sse 21 | 22 | #module load openmpi/3.0.3/gcc-7.3.0 23 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 24 | 25 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 26 | omp_threads=$SLURM_CPUS_PER_TASK 27 | else 28 | omp_threads=1 29 | fi 30 | export OMP_NUM_THREADS=$omp_threads 31 | 32 | 33 | 34 | 35 | mpirun -n $NPROCS cp2k.popt -i geo_opt.in -o geo_opt_out.log 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /3_geometry_optimization/1_c3n4/2_pbc/c3n4.xyz: -------------------------------------------------------------------------------- 1 | 54 2 | 3 | C 13.56855 11.51415 0.76991 4 | N 13.56747 10.04279 0.76931 5 | N 12.38329 12.12821 0.77016 6 | C 12.36337 13.45813 0.77078 7 | C 11.28352 15.47490 0.76977 8 | C 13.56960 15.54676 0.77009 9 | N 10.00928 16.20966 0.76961 10 | N 11.22208 14.14140 0.77018 11 | N 12.40786 16.19450 0.76907 12 | N 13.56951 14.15424 0.77177 13 | N 17.12969 3.87566 0.76873 14 | C 17.12893 5.34684 0.76904 15 | C 15.92211 7.29018 0.77036 16 | C 14.84119 9.30640 0.76928 17 | C 18.33422 7.29109 0.76997 18 | C 17.12776 9.37967 0.76916 19 | C 19.41369 9.30801 0.76944 20 | N 19.47526 7.97448 0.77050 21 | N 18.28935 10.02770 0.76771 22 | N 14.75437 12.12759 0.77023 23 | N 15.96518 10.02642 0.76831 24 | N 17.12790 7.98698 0.77100 25 | N 18.31427 5.96095 0.76820 26 | N 15.94315 5.96012 0.77022 27 | N 14.78019 7.97287 0.76982 28 | C 20.68954 11.51369 0.77000 29 | N 19.50423 12.12763 0.77068 30 | N 20.68822 10.04256 0.76957 31 | N 21.87531 12.12704 0.76980 32 | C 14.77550 13.45766 0.77110 33 | C 15.85607 15.47389 0.77016 34 | C 19.48403 13.45785 0.77087 35 | C 18.40422 15.47456 0.77025 36 | C 21.89639 13.45718 0.77102 37 | C 20.69062 15.54646 0.77064 38 | C 22.97701 15.47348 0.77066 39 | N 14.73188 16.19376 0.76897 40 | N 15.91715 14.14041 0.77106 41 | N 17.12986 16.20996 0.77002 42 | N 19.52859 16.19427 0.77031 43 | N 21.85292 16.19317 0.76967 44 | N 23.03820 14.13967 0.77144 45 | N 20.69038 14.15371 0.77164 46 | N 18.34280 14.14102 0.77015 47 | N 24.25079 16.20970 0.77060 48 | H 10.00875 17.19416 0.76931 49 | H 9.15695 15.71695 0.76980 50 | H 17.98255 3.38385 0.76787 51 | H 16.27734 3.38297 0.76938 52 | H 24.25032 17.19420 0.77004 53 | H 25.10362 15.71785 0.77112 54 | H 12.71454 9.55111 0.76893 55 | H 21.54041 9.54960 0.76937 56 | H 17.12957 17.19446 0.76977 57 | -------------------------------------------------------------------------------- /3_geometry_optimization/1_c3n4/2_pbc/geo_opt.in: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME C3N4-QD 4 | RUN_TYPE GEO_OPT 5 | !For huge cutoff this keyword is required 6 | EXTENDED_FFT_LENGTHS .TRUE. 7 | &END GLOBAL 8 | 9 | &FORCE_EVAL 10 | METHOD QS 11 | 12 | &DFT 13 | BASIS_SET_FILE_NAME BASIS_MOLOPT 14 | POTENTIAL_FILE_NAME POTENTIAL 15 | MULTIPLICITY 1 16 | 17 | &MGRID 18 | NGRIDS 6 19 | CUTOFF 1200 20 | &END MGRID 21 | 22 | &QS 23 | METHOD GPW 24 | EPS_DEFAULT 1.000E-14 25 | &END QS 26 | 27 | &SCF 28 | &DIAGONALIZATION 29 | ALGORITHM DAVIDSON 30 | &END 31 | 32 | &SMEAR 33 | METHOD FERMI_DIRAC 34 | &END 35 | 36 | &MIXING 37 | ALPHA 0.3 38 | METHOD BROYDEN_MIXING 39 | NBROYDEN 8 40 | &END MIXING 41 | EPS_SCF 1.0E-8 42 | SCF_GUESS ATOMIC 43 | MAX_SCF 100 44 | ADDED_MOS 10 45 | ! Only in case you need outer scf for convergence 46 | !&OUTER_SCF T 47 | ! EPS_SCF 1.0E-06 48 | ! MAX_SCF 20 49 | !&END OUTER_SCF 50 | &END SCF 51 | 52 | &XC 53 | &XC_FUNCTIONAL 54 | &PBE 55 | &END PBE 56 | &END XC_FUNCTIONAL 57 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 58 | &XC_GRID 59 | XC_DERIV SPLINE2_SMOOTH 60 | &END XC_GRID 61 | &VDW_POTENTIAL 62 | POTENTIAL_TYPE PAIR_POTENTIAL 63 | &PAIR_POTENTIAL 64 | PARAMETER_FILE_NAME dftd3.dat 65 | TYPE DFTD3 66 | REFERENCE_FUNCTIONAL PBE 67 | R_CUTOFF [angstrom] 16 68 | &END 69 | &END VDW_POTENTIAL 70 | &END XC 71 | 72 | &PRINT 73 | &MULLIKEN OFF 74 | &END 75 | &HIRSHFELD OFF 76 | &END 77 | &MO_CUBES 78 | NHOMO 3 79 | NLUMO 3 80 | ! If the it is set to .TRUE. or T, it will print out the cube files 81 | ! In this case it will only print all the HOMO energies and 3 LUMO energies 82 | WRITE_CUBE F 83 | &END 84 | &PDOS 85 | APPEND .TRUE. 86 | COMPONENTS .TRUE. 87 | NLUMO -1 88 | &END PDOS 89 | &END PRINT 90 | &END DFT 91 | &SUBSYS 92 | 93 | &CELL 94 | A 25.0000000000 0.0000000000 0.0000000000 95 | B 0.0000000000 25.0000000000 0.0000000000 96 | C 0.0000000000 0.0000000000 10.0000000000 97 | PERIODIC NONE 98 | &END CELL 99 | 100 | &TOPOLOGY 101 | COORD_FILE_NAME c3n4.xyz 102 | COORD_FILE_FORMAT XYZ 103 | ! Only in case you use cif file 104 | !&GENERATE 105 | ! REORDER T 106 | !&END 107 | &END 108 | 109 | &KIND H 110 | BASIS_SET DZVP-MOLOPT-GTH 111 | POTENTIAL GTH-PBE-q1 112 | &END KIND 113 | &KIND C 114 | BASIS_SET DZVP-MOLOPT-GTH 115 | POTENTIAL GTH-PBE-q4 116 | &END KIND 117 | &KIND N 118 | BASIS_SET DZVP-MOLOPT-GTH 119 | POTENTIAL GTH-PBE-q5 120 | &END KIND 121 | &END SUBSYS 122 | &END FORCE_EVAL 123 | 124 | 125 | &MOTION 126 | &GEO_OPT 127 | OPTIMIZER BFGS 128 | MAX_ITER 550 129 | MAX_DR [bohr] 0.002 130 | MAX_FORCE 3.000E-4 131 | RMS_DR [bohr] 0.002 132 | RMS_FORCE 3.000E-4 133 | &BFGS 134 | &END 135 | &END 136 | 137 | &PRINT 138 | &TRAJECTORY 139 | &EACH 140 | GEO_OPT 1 141 | &END EACH 142 | &END TRAJECTORY 143 | 144 | &FORCES ON 145 | &END FORCES 146 | &RESTART 147 | BACKUP_COPIES 1 148 | &EACH 149 | GEO_OPT 1 150 | &END EACH 151 | &END RESTART 152 | &END PRINT 153 | 154 | &END 155 | 156 | -------------------------------------------------------------------------------- /3_geometry_optimization/1_c3n4/2_pbc/output.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/3_geometry_optimization/1_c3n4/2_pbc/output.tar.bz2 -------------------------------------------------------------------------------- /3_geometry_optimization/1_c3n4/2_pbc/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=valhalla --qos=valhalla 3 | #SBATCH --clusters=faculty 4 | 5 | #SBATCH --time=05:30:00 6 | #SBATCH --nodes=1 7 | #SBATCH --ntasks-per-node=9 8 | #SBATCH --cpus-per-task=1 9 | #SBATCH --mem=78000 10 | ###SBATCH --mail-user=alexeyak@buffalo.edu 11 | echo "SLURM_JOBID="$SLURM_JOBID 12 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 13 | echo "SLURM_NNODES="$SLURM_NNODES 14 | echo "SLURMTMPDIR="$SLURMTMPDIR 15 | echo "working directory="$SLURM_SUBMIT_DIR 16 | 17 | NPROCS=`srun --nodes=${SLURM_NNODES} bash -c 'hostname' |wc -l` 18 | echo NPROCS=$NPROCS 19 | 20 | 21 | module load cp2k/8.1-sse 22 | 23 | #module load openmpi/3.0.3/gcc-7.3.0 24 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 25 | 26 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 27 | omp_threads=$SLURM_CPUS_PER_TASK 28 | else 29 | omp_threads=1 30 | fi 31 | export OMP_NUM_THREADS=$omp_threads 32 | 33 | 34 | 35 | 36 | mpirun -n $NPROCS cp2k.popt -i geo_opt.in -o geo_opt_out.log 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /3_geometry_optimization/3_BA2_PbI4/geo_opt.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_geo_opt 4 | RUN_TYPE GEO_OPT 5 | &END GLOBAL 6 | 7 | &FORCE_EVAL 8 | ! This one is used for cell optimization 9 | !STRESS_TENSOR ANALYTICAL 10 | METHOD QS 11 | &DFT 12 | UKS .FALSE. 13 | BASIS_SET_FILE_NAME BASIS_MOLOPT 14 | POTENTIAL_FILE_NAME POTENTIAL 15 | &MGRID 16 | NGRIDS 16 17 | CUTOFF 500 18 | REL_CUTOFF 50 19 | &END MGRID 20 | &QS 21 | METHOD GPW 22 | EPS_DEFAULT 1.000E-14 23 | &END QS 24 | &POISSON 25 | PERIODIC XYZ 26 | PSOLVER PERIODIC 27 | &END 28 | &SCF 29 | &DIAGONALIZATION ON 30 | &END DIAGONALIZATION 31 | &MIXING 32 | ALPHA 0.3 33 | METHOD BROYDEN_MIXING 34 | NBROYDEN 8 35 | &END MIXING 36 | EPS_SCF 1.0E-8 37 | SCF_GUESS RESTART 38 | MAX_SCF 50 39 | ADDED_MOS 50 40 | &END SCF 41 | &XC 42 | &XC_FUNCTIONAL 43 | &PBE 44 | &END PBE 45 | &END XC_FUNCTIONAL 46 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 47 | &XC_GRID 48 | XC_DERIV SPLINE2_SMOOTH 49 | &END XC_GRID 50 | &VDW_POTENTIAL 51 | POTENTIAL_TYPE PAIR_POTENTIAL 52 | &PAIR_POTENTIAL 53 | PARAMETER_FILE_NAME dftd3.dat 54 | TYPE DFTD3 55 | REFERENCE_FUNCTIONAL PBE 56 | R_CUTOFF [angstrom] 16 57 | &END 58 | &END VDW_POTENTIAL 59 | &END XC 60 | &PRINT 61 | &MULLIKEN OFF 62 | &END 63 | &HIRSHFELD OFF 64 | &END 65 | &END PRINT 66 | &END DFT 67 | &SUBSYS 68 | 69 | &CELL 70 | A 8.4280004501 0.0000000000 0.0000000000 71 | B 0.0000000000 8.9860000610 0.0000000000 72 | C 0.0000000000 0.0000000000 26.2329998016 73 | PERIODIC XYZ 74 | &END CELL 75 | 76 | &TOPOLOGY 77 | COORD_FILE_NAME unit_cell.xyz 78 | COORD_FILE_FORMAT XYZ 79 | ! Only in case you use cif file 80 | !&GENERATE 81 | ! REORDER T 82 | !&END 83 | &END 84 | 85 | &KIND Cs 86 | BASIS_SET DZVP-MOLOPT-SR-GTH 87 | POTENTIAL GTH-PBE-q9 88 | &END KIND 89 | &KIND Pb 90 | BASIS_SET DZVP-MOLOPT-SR-GTH 91 | POTENTIAL GTH-PBE-q4 92 | &END KIND 93 | &KIND I 94 | BASIS_SET DZVP-MOLOPT-SR-GTH 95 | POTENTIAL GTH-PBE-q7 96 | &END KIND 97 | &KIND H 98 | BASIS_SET DZVP-MOLOPT-GTH 99 | POTENTIAL GTH-PBE-q1 100 | &END KIND 101 | &KIND C 102 | BASIS_SET DZVP-MOLOPT-GTH 103 | POTENTIAL GTH-PBE-q4 104 | &END KIND 105 | &KIND O 106 | BASIS_SET DZVP-MOLOPT-GTH 107 | POTENTIAL GTH-PBE-q6 108 | &END KIND 109 | &KIND N 110 | BASIS_SET DZVP-MOLOPT-GTH 111 | POTENTIAL GTH-PBE-q5 112 | &END KIND 113 | &END SUBSYS 114 | &END FORCE_EVAL 115 | 116 | &MOTION 117 | &GEO_OPT 118 | OPTIMIZER BFGS 119 | MAX_ITER 550 120 | MAX_DR [bohr] 0.002 121 | MAX_FORCE 3.000E-4 122 | RMS_DR [bohr] 0.002 123 | RMS_FORCE 3.000E-4 124 | &BFGS 125 | &END 126 | &END 127 | &PRINT 128 | &TRAJECTORY 129 | &EACH 130 | GEO_OPT 1 131 | &END EACH 132 | &END TRAJECTORY 133 | &FORCES ON 134 | &END FORCES 135 | &RESTART 136 | BACKUP_COPIES 1 137 | &EACH 138 | GEO_OPT 1 139 | &END EACH 140 | &END RESTART 141 | &END PRINT 142 | &END 143 | -------------------------------------------------------------------------------- /3_geometry_optimization/README.md: -------------------------------------------------------------------------------- 1 | # Geometry optimization 2 | 3 | We first need to obtain an optimized geometry of the structure. When we make a new structure, like heterostructures, 4 | we may also need to obtain an optimum cell as well. The cell optimization has only one more variable than geometry optimization 5 | which is pressure and the optimizer will let the cell changes its size after each cell optimization step. 6 | In CP2K, it is better to perform both cell and geometry optimization together which is done by the 7 | keyword `TYPE DIRECT_CELL_OPT` in the `&CELL_OPT` section of the input. We have the cell optimization inputs in `cell_optimization` folder. 8 | 9 | For other structures, like supercells, usually obtained from `cif` files, the structure may be initially optimized 10 | when geometry optimization is performed but usually this is not the case because the energy calculations in each software package 11 | may be different. Therefore, you need to perform geometry optimization first. If the changes in the structure are massive 12 | then you need to move to cell optimization as well. You can first use an initial cutoff value for this purpose, which is obtained 13 | through the convergence analysis for the initial structure. After obtaining the optimized geometry, one can perform the convergence 14 | analysis again to obtain another cutoff value. If the initial cutoff is not the same as the one obtained from the convergence analysis, 15 | one can redo the geometry optimization using the new cutoff value. This will not take longer than the previous geometry optimization 16 | and will finish sooner. 17 | 18 | Note that the CP2K optimizer works based on the forces for each of the geometry and cell optimization. In fact, the movement of the atoms 19 | is based on their computed forces. The lower the convergence criteria of the SCF cycle (`EPS_SCF`) the more accurate the computed forces are. 20 | This will lead to a better optimized geometry and will not confuse the optimizer. So, it is recommended that for the geometry or cell 21 | optimization to use a good cutoff value and a smaller target accuracy of SCF cycle defined by `EPS_SCF`, like `10E-8.0` 22 | After you obtained the optimized geometry, for the MD you can use lower `EPS_SCF` values like `10E-6.0`. 23 | But the more accurate the forces in MD the more accurate the time-overlaps are and therefore the more accurate the nonadiabatic couplings will be. 24 | This is up to the user on which `EPS_SCF` value to choose and is totally dependent on the studied system and its computational cost. 25 | 26 | The target forces and displacement for the geometry or cell optimizations are defined in the `&MOTION` and `&GEO_OPT` section with `MAX_FORCE` 27 | and `MAX_DR` keywords respectively. The force value unit is in `Hartree/Bohr` and the displacement unit is in `Bohr`. 28 | Here, the maximum force is set to 0.0003 Hartree/Bohr which is almost equivalent to 15 meV/A and the maximum displacement is set to 0.002 Bohr. 29 | 30 | When running the geometry optimization, it will print out the coordinates and forces in each step in `*-pos-1.xyz` and `*-frc-1.xyz` files. 31 | The last coordinates in the `*-pos-1.xyz` will be the optimized geometry. Also, `*.restart` files are produced that contain the information 32 | of the geometry optimization of the lsat step and if the run is suddenly interrupted, you can change the extension to `.inp` by `mv` 33 | command and then run it again. This will continue the geometry optimization from the point it was interrupted. 34 | 35 | In this case, for faster SCF calculations of the first step after interruption, you can add the `WFN_RESTART_FILE_NAME` with the produced `wfn` 36 | file to the input and set the `SCF_GUESS` to `RESTART`. The controls over the production of such files can be 37 | done in the [`&PRINT`](https://manual.cp2k.org/trunk/CP2K_INPUT/MOTION/PRINT.html) section of `&MOTION` section. 38 | The optimized geometry of the initial structure with a cutoff value of 500 Ry is obtained and uploaded above (`optimized_BA2_PbI4.xyz`). 39 | The `BFGS` algorithm is used for the geometry optimization in the inputs. 40 | 41 | -------------------------------------------------------------------------------- /4_cell_optimization/3_BA2_PbI4/cell_opt.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_cell_opt 4 | RUN_TYPE CELL_OPT 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | ! This one is used for cell optimization 8 | STRESS_TENSOR ANALYTICAL 9 | METHOD QS 10 | &DFT 11 | UKS .FALSE. 12 | BASIS_SET_FILE_NAME BASIS_MOLOPT 13 | POTENTIAL_FILE_NAME POTENTIAL 14 | &MGRID 15 | NGRIDS 16 16 | CUTOFF 500 17 | REL_CUTOFF 50 18 | &END MGRID 19 | &QS 20 | METHOD GPW 21 | EPS_DEFAULT 1.000E-14 22 | &END QS 23 | &POISSON 24 | PERIODIC XYZ 25 | PSOLVER PERIODIC 26 | &END 27 | &SCF 28 | &DIAGONALIZATION ON 29 | &END DIAGONALIZATION 30 | &MIXING 31 | ALPHA 0.3 32 | METHOD BROYDEN_MIXING 33 | NBROYDEN 8 34 | &END MIXING 35 | EPS_SCF 1.0E-8 36 | SCF_GUESS RESTART 37 | MAX_SCF 50 38 | ADDED_MOS 50 39 | &END SCF 40 | &XC 41 | &XC_FUNCTIONAL 42 | &PBE 43 | &END PBE 44 | &END XC_FUNCTIONAL 45 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 46 | &XC_GRID 47 | XC_DERIV SPLINE2_SMOOTH 48 | &END XC_GRID 49 | &VDW_POTENTIAL 50 | POTENTIAL_TYPE PAIR_POTENTIAL 51 | &PAIR_POTENTIAL 52 | PARAMETER_FILE_NAME dftd3.dat 53 | TYPE DFTD3 54 | REFERENCE_FUNCTIONAL PBE 55 | R_CUTOFF [angstrom] 16 56 | &END 57 | &END VDW_POTENTIAL 58 | &END XC 59 | &PRINT 60 | &MULLIKEN OFF 61 | &END 62 | &HIRSHFELD OFF 63 | &END 64 | &END PRINT 65 | &END DFT 66 | &SUBSYS 67 | 68 | &CELL 69 | A 8.4280004501 0.0000000000 0.0000000000 70 | B 0.0000000000 8.9860000610 0.0000000000 71 | C 0.0000000000 0.0000000000 26.2329998016 72 | PERIODIC XYZ 73 | &END CELL 74 | 75 | &TOPOLOGY 76 | COORD_FILE_NAME unit_cell.xyz 77 | COORD_FILE_FORMAT XYZ 78 | ! Only in case you use cif file 79 | !&GENERATE 80 | ! REORDER T 81 | !&END 82 | &END 83 | 84 | &KIND Cs 85 | BASIS_SET DZVP-MOLOPT-SR-GTH 86 | POTENTIAL GTH-PBE-q9 87 | &END KIND 88 | &KIND Pb 89 | BASIS_SET DZVP-MOLOPT-SR-GTH 90 | POTENTIAL GTH-PBE-q4 91 | &END KIND 92 | &KIND I 93 | BASIS_SET DZVP-MOLOPT-SR-GTH 94 | POTENTIAL GTH-PBE-q7 95 | &END KIND 96 | &KIND H 97 | BASIS_SET DZVP-MOLOPT-GTH 98 | POTENTIAL GTH-PBE-q1 99 | &END KIND 100 | &KIND C 101 | BASIS_SET DZVP-MOLOPT-GTH 102 | POTENTIAL GTH-PBE-q4 103 | &END KIND 104 | &KIND O 105 | BASIS_SET DZVP-MOLOPT-GTH 106 | POTENTIAL GTH-PBE-q6 107 | &END KIND 108 | &KIND N 109 | BASIS_SET DZVP-MOLOPT-GTH 110 | POTENTIAL GTH-PBE-q5 111 | &END KIND 112 | &END SUBSYS 113 | &END FORCE_EVAL 114 | 115 | &MOTION 116 | &CELL_OPT 117 | TYPE DIRECT_CELL_OPT 118 | MAX_DR 0.002 119 | MAX_FORCE 3.0E-04 120 | RMS_DR 0.002 121 | RMS_FORCE 3.0E-04 122 | PRESSURE_TOLERANCE 100 123 | EXTERNAL_PRESSURE [bar] 100 0 0 0 100 0 0 0 100 124 | MAX_ITER 550 125 | OPTIMIZER BFGS 126 | ! It is better to let the optimizer change the cell as is needed 127 | ! KEEP_SYMMETRY .TRUE. will make the optimization harder. 128 | KEEP_SYMMETRY .FALSE. 129 | &END CELL_OPT 130 | &GEO_OPT 131 | OPTIMIZER BFGS 132 | MAX_ITER 550 133 | MAX_DR [bohr] 0.002 134 | MAX_FORCE 3.000E-4 135 | RMS_DR [bohr] 0.002 136 | RMS_FORCE 3.000E-4 137 | &BFGS 138 | &END 139 | &END 140 | &PRINT 141 | &TRAJECTORY 142 | &EACH 143 | GEO_OPT 1 144 | &END EACH 145 | &END TRAJECTORY 146 | &FORCES ON 147 | &END FORCES 148 | &STRESS ON 149 | &END 150 | &RESTART 151 | BACKUP_COPIES 1 152 | &EACH 153 | GEO_OPT 1 154 | &END EACH 155 | &END RESTART 156 | &END PRINT 157 | &END 158 | -------------------------------------------------------------------------------- /4_cell_optimization/README.md: -------------------------------------------------------------------------------- 1 | # Cell optimization 2 | 3 | More explanation has been given in the geometry optimization section. Here, we just mention some notes on cell optimization. It is better to perform both cell and geometry 4 | optimization simultaneously. This is done by setting the `TYPE` in `&CELL_OPT` to `DIRECT_CELL_OPT`. There are different types of cell optimization such as `MD` which is not considered here. 5 | 6 | As was mentioned in the geometry optimization section, we need accurate forces 7 | so that the optimizer can better optimize the structure. Therefore, more accurate electronic structure calculations are required which is done by lowering the value of `EPS_SCF`. The `STRESS_TENSOR` is also needed to compute the pressure for cell optimization. You can also print out the stress as well 8 | using `&STRESS ON` in `&PRINT` section. 9 | 10 | Here, we did not perform cell optimization because the changes in the geometry optimizations were small. But you can do it if the structure in the geometry optimization 11 | shows massive changes. 12 | -------------------------------------------------------------------------------- /5_tddft/1_c3n4/C3N4-QD-RESTART.tdwfn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/5_tddft/1_c3n4/C3N4-QD-RESTART.tdwfn -------------------------------------------------------------------------------- /5_tddft/1_c3n4/C3N4-QD-RESTART.wfn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/5_tddft/1_c3n4/C3N4-QD-RESTART.wfn -------------------------------------------------------------------------------- /5_tddft/1_c3n4/C3N4-QD-RESTART.wfn.bak-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/5_tddft/1_c3n4/C3N4-QD-RESTART.wfn.bak-1 -------------------------------------------------------------------------------- /5_tddft/1_c3n4/c3n4.xyz: -------------------------------------------------------------------------------- 1 | 54 2 | 3 | C 13.56855 11.51415 0.76991 4 | N 13.56747 10.04279 0.76931 5 | N 12.38329 12.12821 0.77016 6 | C 12.36337 13.45813 0.77078 7 | C 11.28352 15.47490 0.76977 8 | C 13.56960 15.54676 0.77009 9 | N 10.00928 16.20966 0.76961 10 | N 11.22208 14.14140 0.77018 11 | N 12.40786 16.19450 0.76907 12 | N 13.56951 14.15424 0.77177 13 | N 17.12969 3.87566 0.76873 14 | C 17.12893 5.34684 0.76904 15 | C 15.92211 7.29018 0.77036 16 | C 14.84119 9.30640 0.76928 17 | C 18.33422 7.29109 0.76997 18 | C 17.12776 9.37967 0.76916 19 | C 19.41369 9.30801 0.76944 20 | N 19.47526 7.97448 0.77050 21 | N 18.28935 10.02770 0.76771 22 | N 14.75437 12.12759 0.77023 23 | N 15.96518 10.02642 0.76831 24 | N 17.12790 7.98698 0.77100 25 | N 18.31427 5.96095 0.76820 26 | N 15.94315 5.96012 0.77022 27 | N 14.78019 7.97287 0.76982 28 | C 20.68954 11.51369 0.77000 29 | N 19.50423 12.12763 0.77068 30 | N 20.68822 10.04256 0.76957 31 | N 21.87531 12.12704 0.76980 32 | C 14.77550 13.45766 0.77110 33 | C 15.85607 15.47389 0.77016 34 | C 19.48403 13.45785 0.77087 35 | C 18.40422 15.47456 0.77025 36 | C 21.89639 13.45718 0.77102 37 | C 20.69062 15.54646 0.77064 38 | C 22.97701 15.47348 0.77066 39 | N 14.73188 16.19376 0.76897 40 | N 15.91715 14.14041 0.77106 41 | N 17.12986 16.20996 0.77002 42 | N 19.52859 16.19427 0.77031 43 | N 21.85292 16.19317 0.76967 44 | N 23.03820 14.13967 0.77144 45 | N 20.69038 14.15371 0.77164 46 | N 18.34280 14.14102 0.77015 47 | N 24.25079 16.20970 0.77060 48 | H 10.00875 17.19416 0.76931 49 | H 9.15695 15.71695 0.76980 50 | H 17.98255 3.38385 0.76787 51 | H 16.27734 3.38297 0.76938 52 | H 24.25032 17.19420 0.77004 53 | H 25.10362 15.71785 0.77112 54 | H 12.71454 9.55111 0.76893 55 | H 21.54041 9.54960 0.76937 56 | H 17.12957 17.19446 0.76977 57 | -------------------------------------------------------------------------------- /5_tddft/1_c3n4/slurm-6572145.out: -------------------------------------------------------------------------------- 1 | SLURM_JOBID=6572145 2 | SLURM_JOB_NODELIST=cpn-p27-15 3 | SLURM_NNODES=1 4 | SLURMTMPDIR=/scratch/6572145 5 | working directory=/projects/academic/cyberwksp21/Instructors_material/alexeyak/cp2k/3_tddft/1_c3n4 6 | NPROCS=9 7 | The MKL Libraries are in your library path. This is adequate for compiling and 8 | running most codes. Source $MKL/bin/mklvars.sh" for more features. 9 | -------------------------------------------------------------------------------- /5_tddft/1_c3n4/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=valhalla --qos=valhalla 3 | #SBATCH --clusters=faculty 4 | #SBATCH --time=03:30:00 5 | #SBATCH --nodes=1 6 | #SBATCH --ntasks-per-node=9 7 | #SBATCH --cpus-per-task=1 8 | #SBATCH --mem=78000 9 | ###SBATCH --mail-user=alexeyak@buffalo.edu 10 | echo "SLURM_JOBID="$SLURM_JOBID 11 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 12 | echo "SLURM_NNODES="$SLURM_NNODES 13 | echo "SLURMTMPDIR="$SLURMTMPDIR 14 | echo "working directory="$SLURM_SUBMIT_DIR 15 | 16 | NPROCS=`srun --nodes=${SLURM_NNODES} bash -c 'hostname' |wc -l` 17 | echo NPROCS=$NPROCS 18 | 19 | 20 | module load cp2k/8.1-sse 21 | 22 | #module load openmpi/3.0.3/gcc-7.3.0 23 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 24 | 25 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 26 | omp_threads=$SLURM_CPUS_PER_TASK 27 | else 28 | omp_threads=1 29 | fi 30 | export OMP_NUM_THREADS=$omp_threads 31 | 32 | 33 | 34 | 35 | mpirun -n $NPROCS cp2k.popt -i tddft.in -o tddft.log 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /5_tddft/1_c3n4/tddft.in: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME C3N4-QD 4 | RUN_TYPE ENERGY 5 | !For huge cutoff this keyword is required 6 | EXTENDED_FFT_LENGTHS .TRUE. 7 | &END GLOBAL 8 | 9 | &FORCE_EVAL 10 | METHOD QS 11 | 12 | &PROPERTIES 13 | &TDDFPT 14 | NSTATES 5 # number of excited states 15 | MAX_ITER 200 # maximum number of Davidson iterations 16 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 17 | &MGRID 18 | NGRIDS 4 19 | CUTOFF 500 # separate cutoff for TDDFPT calc 20 | &END 21 | ! Only in case you have a tdwfn file from previous calculations 22 | !RESTART .TRUE. 23 | !WFN_RESTART_FILE_NAME RESTART.tdwfn 24 | &END TDDFPT 25 | &END PROPERTIES 26 | 27 | 28 | &DFT 29 | UKS .FALSE. 30 | BASIS_SET_FILE_NAME BASIS_MOLOPT 31 | POTENTIAL_FILE_NAME POTENTIAL 32 | &MGRID 33 | NGRIDS 4 34 | CUTOFF 300 35 | &END MGRID 36 | &QS 37 | METHOD GPW 38 | EPS_DEFAULT 1.000E-14 39 | &END QS 40 | 41 | &POISSON 42 | PERIODIC XYZ 43 | POISSON_SOLVER PERIODIC 44 | &END 45 | 46 | &SCF 47 | &DIAGONALIZATION ON 48 | &END DIAGONALIZATION 49 | &MIXING 50 | ALPHA 0.3 51 | METHOD BROYDEN_MIXING 52 | NBROYDEN 8 53 | &END MIXING 54 | EPS_SCF 1.0E-6 55 | SCF_GUESS ATOMIC 56 | MAX_SCF 50 57 | ADDED_MOS 10 58 | ! Only in case you need outer scf for convergence 59 | !&OUTER_SCF T 60 | ! EPS_SCF 1.0E-06 61 | ! MAX_SCF 20 62 | !&END OUTER_SCF 63 | &END SCF 64 | 65 | &XC 66 | &XC_FUNCTIONAL 67 | &PBE 68 | &END PBE 69 | &END XC_FUNCTIONAL 70 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 71 | &XC_GRID 72 | XC_DERIV SPLINE2_SMOOTH 73 | &END XC_GRID 74 | &VDW_POTENTIAL 75 | POTENTIAL_TYPE PAIR_POTENTIAL 76 | &PAIR_POTENTIAL 77 | PARAMETER_FILE_NAME dftd3.dat 78 | TYPE DFTD3 79 | REFERENCE_FUNCTIONAL PBE 80 | R_CUTOFF [angstrom] 16 81 | &END 82 | &END VDW_POTENTIAL 83 | &END XC 84 | 85 | &PRINT 86 | &MULLIKEN OFF 87 | &END 88 | &HIRSHFELD OFF 89 | &END 90 | &MO_CUBES 91 | NHOMO 3 92 | NLUMO 3 93 | ! If the it is set to .TRUE. or T, it will print out the cube files 94 | ! In this case it will only print all the HOMO energies and 3 LUMO energies 95 | WRITE_CUBE F 96 | &END 97 | &PDOS 98 | APPEND .TRUE. 99 | COMPONENTS .TRUE. 100 | NLUMO -1 101 | &END PDOS 102 | &END PRINT 103 | &END DFT 104 | &SUBSYS 105 | 106 | &CELL 107 | ABC 25.0 25.0 25.0 108 | PERIODIC XYZ 109 | &END CELL 110 | 111 | &TOPOLOGY 112 | COORD_FILE_NAME c3n4.xyz 113 | COORD_FILE_FORMAT XYZ 114 | ! Only in case you use cif file 115 | !&GENERATE 116 | ! REORDER T 117 | !&END 118 | &END 119 | 120 | &KIND H 121 | BASIS_SET DZVP-MOLOPT-GTH 122 | POTENTIAL GTH-PBE-q1 123 | &END KIND 124 | &KIND C 125 | BASIS_SET DZVP-MOLOPT-GTH 126 | POTENTIAL GTH-PBE-q4 127 | &END KIND 128 | &KIND N 129 | BASIS_SET DZVP-MOLOPT-GTH 130 | POTENTIAL GTH-PBE-q5 131 | &END KIND 132 | &END SUBSYS 133 | &END FORCE_EVAL 134 | 135 | -------------------------------------------------------------------------------- /5_tddft/2_adamantane/c10h16-RESTART.tdwfn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/5_tddft/2_adamantane/c10h16-RESTART.tdwfn -------------------------------------------------------------------------------- /5_tddft/2_adamantane/c10h16-RESTART.tdwfn.bak-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/5_tddft/2_adamantane/c10h16-RESTART.tdwfn.bak-1 -------------------------------------------------------------------------------- /5_tddft/2_adamantane/c10h16-RESTART.wfn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/5_tddft/2_adamantane/c10h16-RESTART.wfn -------------------------------------------------------------------------------- /5_tddft/2_adamantane/clean.sh: -------------------------------------------------------------------------------- 1 | rm sl* 2 | rm c10* 3 | rm *wfc* 4 | -------------------------------------------------------------------------------- /5_tddft/2_adamantane/coord.xyz: -------------------------------------------------------------------------------- 1 | 26 2 | XYZ file 3 | C 9.178580 5.928680 6.784230 4 | C 8.288780 6.827330 5.895700 5 | C 9.184490 7.712870 5.000010 6 | C 10.068360 6.815530 4.104270 7 | C 10.956860 5.916830 4.994050 8 | C 9.160840 4.144480 5.000060 9 | C 10.062460 5.030020 5.889820 10 | C 7.388480 5.940480 5.005880 11 | C 8.271070 5.041840 4.110200 12 | C 9.166750 5.928710 3.215770 13 | H 8.541821 5.298140 7.443030 14 | H 9.819710 6.559260 7.438760 15 | H 7.653340 7.473351 6.539620 16 | H 8.552010 8.373790 4.367380 17 | H 9.825700 8.365280 5.632710 18 | H 10.712270 7.453100 3.460340 19 | H 11.619880 6.547200 5.626580 20 | H 11.607130 5.277700 4.357070 21 | H 9.789130 3.483580 4.363250 22 | H 8.523830 3.492070 5.636970 23 | H 10.702130 4.383980 6.529520 24 | H 6.729700 5.310070 5.642790 25 | H 6.733950 6.579590 4.373250 26 | H 7.622920 4.404290 3.470520 27 | H 9.795130 5.289790 2.556990 28 | H 8.534019 6.567690 2.561230 29 | 30 | -------------------------------------------------------------------------------- /5_tddft/2_adamantane/cp2k_input_template.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PROJECT c10h16 3 | RUN_TYPE ENERGY 4 | PRINT_LEVEL MEDIUM 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD Quickstep 8 | 9 | &PROPERTIES 10 | &TDDFPT 11 | NSTATES 10 # number of excited states 12 | MAX_ITER 200 # maximum number of Davidson iterations 13 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 14 | &MGRID 15 | CUTOFF 400 # separate cutoff for TDDFPT calc 16 | &END 17 | 18 | RESTART .FALSE. 19 | WFN_RESTART_FILE_NAME RESTART.tdwfn 20 | 21 | &END TDDFPT 22 | &END PROPERTIES 23 | 24 | &PRINT 25 | &FORCES 26 | &END 27 | &TOTAL_NUMBERS ON 28 | &END TOTAL_NUMBERS 29 | &END PRINT 30 | 31 | &DFT 32 | 33 | &POISSON 34 | PERIODIC none 35 | POISSON_SOLVER wavelet 36 | &END POISSON 37 | 38 | &PRINT 39 | &PDOS SILENT 40 | COMPONENTS T 41 | NLUMO -1 42 | &END PDOS 43 | &MO_CUBES 44 | NLUMO -1 45 | NHOMO 30 46 | WRITE_CUBE .FALSE. 47 | STRIDE 2 2 2 48 | &END 49 | &END PRINT 50 | 51 | BASIS_SET_FILE_NAME BASIS_MOLOPT 52 | POTENTIAL_FILE_NAME POTENTIAL 53 | WFN_RESTART_FILE_NAME RESTART.wfn 54 | 55 | &MGRID 56 | CUTOFF 400 57 | REL_CUTOFF 60 58 | &END MGRID 59 | 60 | &QS 61 | EPS_DEFAULT 1.0E-16 62 | &END QS 63 | 64 | &SCF 65 | SCF_GUESS RESTART 66 | EPS_SCF 1.0E-6 67 | MAX_SCF 300 68 | 69 | ADDED_MOS 20 70 | &DIAGONALIZATION 71 | ALGORITHM STANDARD 72 | &END DIAGONALIZATION 73 | &MIXING 74 | METHOD BROYDEN_MIXING 75 | ALPHA 0.5 76 | BETA 0.5 77 | NBROYDEN 8 78 | &END MIXING 79 | &END SCF 80 | 81 | &XC 82 | &XC_FUNCTIONAL PBE 83 | &END XC_FUNCTIONAL 84 | &END XC 85 | 86 | &END DFT 87 | 88 | &SUBSYS 89 | 90 | &KIND C 91 | ELEMENT C 92 | BASIS_SET ORB DZVP-MOLOPT-GTH 93 | POTENTIAL GTH-PBE-q4 94 | &END KIND 95 | &KIND H 96 | ELEMENT H 97 | BASIS_SET ORB DZVP-MOLOPT-GTH 98 | POTENTIAL GTH-PBE-q1 99 | &END KIND 100 | 101 | &CELL 102 | PERIODIC NONE 103 | A 15.0 0.00 0.00 104 | B 0.00 15.0 0.00 105 | C 0.00 0.00 15.0 106 | &END CELL 107 | &TOPOLOGY 108 | COORD_FILE_NAME coord.xyz 109 | COORD_FILE_FORMAT XYZ 110 | &END 111 | &END SUBSYS 112 | &END FORCE_EVAL 113 | 114 | -------------------------------------------------------------------------------- /5_tddft/2_adamantane/slurm-6486786.out: -------------------------------------------------------------------------------- 1 | SLURM_JOBID=6486786 2 | SLURM_JOB_NODELIST=cpn-p27-16 3 | SLURM_NNODES=1 4 | SLURMTMPDIR=/scratch/6486786 5 | working directory=/projects/academic/cyberwksp21/Instructors_material/alexeyak/cp2k/tddft 6 | The MKL Libraries are in your library path. This is adequate for compiling and 7 | running most codes. Source $MKL/bin/mklvars.sh" for more features. 8 | -------------------------------------------------------------------------------- /5_tddft/2_adamantane/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ###SBATCH --partition=debug --qos=debug 3 | ###SBATCH --clusters=ub-hpc 4 | ###SBATCH --constraint=CPU-Gold-6130 5 | 6 | #SBATCH --partition=valhalla --qos=valhalla 7 | #SBATCH --clusters=faculty 8 | ###SBATCH --requeue 9 | 10 | #SBATCH --time=1:00:00 11 | #SBATCH --nodes=1 12 | #SBATCH --ntasks-per-node=12 13 | #SBATCH --cpus-per-task=1 14 | #SBATCH --mem=28000 15 | ###SBATCH --mail-user=alexeyak@buffalo.edu 16 | echo "SLURM_JOBID="$SLURM_JOBID 17 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 18 | echo "SLURM_NNODES="$SLURM_NNODES 19 | echo "SLURMTMPDIR="$SLURMTMPDIR 20 | echo "working directory="$SLURM_SUBMIT_DIR 21 | 22 | 23 | #module load openmpi/3.0.3/gcc-7.3.0 24 | module load cp2k 25 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 26 | 27 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 28 | omp_threads=$SLURM_CPUS_PER_TASK 29 | else 30 | omp_threads=1 31 | fi 32 | export OMP_NUM_THREADS=$omp_threads 33 | 34 | nprocs=12 35 | cp2k_exe=cp2k.popt # /panasas/scratch/grp-alexeyak/brendan/cp2k_install/cp2k-7.1/exe/local/cp2k.popt 36 | 37 | mpirun -np $nprocs $cp2k_exe -i cp2k_input_template.inp -o out.log 38 | 39 | 40 | -------------------------------------------------------------------------------- /5_tddft/3_BA2_PbI4/tddft.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_tddft 4 | RUN_TYPE ENERGY 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD QS 8 | &PROPERTIES 9 | &TDDFPT 10 | NSTATES 20 # number of excited states 11 | MAX_ITER 200 # maximum number of Davidson iterations 12 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 13 | &MGRID 14 | NGRIDS 16 15 | CUTOFF 500 # separate cutoff for TDDFPT calc 16 | &END 17 | ! Only in case you have a tdwfn file from previous calculations 18 | !RESTART .TRUE. 19 | !WFN_RESTART_FILE_NAME RESTART.tdwfn 20 | &END TDDFPT 21 | &END PROPERTIES 22 | &DFT 23 | UKS .FALSE. 24 | BASIS_SET_FILE_NAME BASIS_MOLOPT 25 | POTENTIAL_FILE_NAME POTENTIAL 26 | &MGRID 27 | NGRIDS 16 28 | CUTOFF 500 29 | REL_CUTOFF 50 30 | &END MGRID 31 | &QS 32 | METHOD GPW 33 | EPS_DEFAULT 1.000E-14 34 | &END QS 35 | &POISSON 36 | PERIODIC XYZ 37 | PSOLVER PERIODIC 38 | &END 39 | &SCF 40 | &DIAGONALIZATION ON 41 | &END DIAGONALIZATION 42 | &MIXING 43 | ALPHA 0.3 44 | METHOD BROYDEN_MIXING 45 | NBROYDEN 8 46 | &END MIXING 47 | EPS_SCF 1.0E-6 48 | SCF_GUESS RESTART 49 | MAX_SCF 50 50 | ADDED_MOS 50 51 | &END SCF 52 | &XC 53 | &XC_FUNCTIONAL 54 | &PBE 55 | &END PBE 56 | &END XC_FUNCTIONAL 57 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations. 58 | &XC_GRID 59 | XC_DERIV SPLINE2_SMOOTH 60 | &END XC_GRID 61 | &VDW_POTENTIAL 62 | POTENTIAL_TYPE PAIR_POTENTIAL 63 | &PAIR_POTENTIAL 64 | PARAMETER_FILE_NAME dftd3.dat 65 | TYPE DFTD3 66 | REFERENCE_FUNCTIONAL PBE 67 | R_CUTOFF [angstrom] 16 68 | &END 69 | &END VDW_POTENTIAL 70 | &END XC 71 | &PRINT 72 | &MULLIKEN OFF 73 | &END 74 | &HIRSHFELD OFF 75 | &END 76 | &END PRINT 77 | &END DFT 78 | &SUBSYS 79 | 80 | &CELL 81 | A 8.4280004501 0.0000000000 0.0000000000 82 | B 0.0000000000 8.9860000610 0.0000000000 83 | C 0.0000000000 0.0000000000 26.2329998016 84 | PERIODIC XYZ 85 | &END CELL 86 | 87 | &TOPOLOGY 88 | COORD_FILE_NAME optimized_unit_cell.xyz 89 | COORD_FILE_FORMAT XYZ 90 | ! Only in case you use cif file 91 | !&GENERATE 92 | ! REORDER T 93 | !&END 94 | &END 95 | 96 | &KIND Cs 97 | BASIS_SET DZVP-MOLOPT-SR-GTH 98 | POTENTIAL GTH-PBE-q9 99 | &END KIND 100 | &KIND Pb 101 | BASIS_SET DZVP-MOLOPT-SR-GTH 102 | POTENTIAL GTH-PBE-q4 103 | &END KIND 104 | &KIND I 105 | BASIS_SET DZVP-MOLOPT-SR-GTH 106 | POTENTIAL GTH-PBE-q7 107 | &END KIND 108 | &KIND H 109 | BASIS_SET DZVP-MOLOPT-GTH 110 | POTENTIAL GTH-PBE-q1 111 | &END KIND 112 | &KIND C 113 | BASIS_SET DZVP-MOLOPT-GTH 114 | POTENTIAL GTH-PBE-q4 115 | &END KIND 116 | &KIND O 117 | BASIS_SET DZVP-MOLOPT-GTH 118 | POTENTIAL GTH-PBE-q6 119 | &END KIND 120 | &KIND N 121 | BASIS_SET DZVP-MOLOPT-GTH 122 | POTENTIAL GTH-PBE-q5 123 | &END KIND 124 | &END SUBSYS 125 | &END FORCE_EVAL 126 | 127 | -------------------------------------------------------------------------------- /6_hybrid_functionals/3_BA2_PbI4/b3lyp-tddft.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_B3LYP 4 | RUN_TYPE ENERGY 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD QS 8 | &PROPERTIES 9 | &TDDFPT 10 | NSTATES 20 # number of excited states 11 | MAX_ITER 200 # maximum number of Davidson iterations 12 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 13 | &MGRID 14 | NGRIDS 16 15 | CUTOFF 500 # separate cutoff for TDDFPT calc 16 | &END 17 | ! Only in case you have a tdwfn file from previous calculations 18 | !RESTART .TRUE. 19 | !WFN_RESTART_FILE_NAME RESTART.tdwfn 20 | &END TDDFPT 21 | &END PROPERTIES 22 | &DFT 23 | UKS .FALSE. 24 | BASIS_SET_FILE_NAME BASIS_MOLOPT 25 | BASIS_SET_FILE_NAME BASIS_ADMM 26 | BASIS_SET_FILE_NAME BASIS_ADMM_MOLOPT 27 | POTENTIAL_FILE_NAME GTH_POTENTIALS 28 | WFN_RESTART_FILE_NAME BA2_PbI4_PBE-RESTART.wfn 29 | &MGRID 30 | NGRIDS 16 31 | CUTOFF 500 32 | REL_CUTOFF 50 33 | &END MGRID 34 | &QS 35 | METHOD GPW 36 | EPS_DEFAULT 1.000E-14 37 | &END QS 38 | &POISSON 39 | PERIODIC XYZ 40 | PSOLVER PERIODIC 41 | &END 42 | &SCF 43 | &DIAGONALIZATION ON 44 | &END DIAGONALIZATION 45 | &MIXING 46 | ALPHA 0.3 47 | METHOD BROYDEN_MIXING 48 | NBROYDEN 8 49 | &END MIXING 50 | EPS_SCF 1.0E-6 51 | SCF_GUESS RESTART 52 | MAX_SCF 50 53 | ADDED_MOS 50 54 | &END SCF 55 | &XC 56 | &XC_FUNCTIONAL 57 | &LIBXC 58 | FUNCTIONAL XC_HYB_GGA_XC_B3LYP 59 | &END LIBXC 60 | &END XC_FUNCTIONAL 61 | &HF 62 | &SCREENING 63 | EPS_SCHWARZ 1.0E-10 64 | &END 65 | !&MEMORY 66 | ! This is the maximum memory for each processor in MBi, I just comment it but 67 | ! you can obtain it through computing the memory you ask in the slurm file 68 | ! divided by the number of processors. 69 | ! MAX_MEMORY 10000 70 | ! EPS_STORAGE_SCALING 0.1 71 | !&END MEMORY 72 | FRACTION 0.20 73 | &END 74 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 75 | &XC_GRID 76 | XC_DERIV SPLINE2_SMOOTH 77 | &END XC_GRID 78 | &VDW_POTENTIAL 79 | POTENTIAL_TYPE PAIR_POTENTIAL 80 | &PAIR_POTENTIAL 81 | PARAMETER_FILE_NAME dftd3.dat 82 | TYPE DFTD3 83 | REFERENCE_FUNCTIONAL PBE 84 | R_CUTOFF [angstrom] 16 85 | &END 86 | &END VDW_POTENTIAL 87 | &END XC 88 | &AUXILIARY_DENSITY_MATRIX_METHOD 89 | METHOD BASIS_PROJECTION 90 | ADMM_PURIFICATION_METHOD NONE 91 | &END 92 | &PRINT 93 | &MULLIKEN OFF 94 | &END 95 | &HIRSHFELD OFF 96 | &END 97 | &MO_CUBES 98 | NHOMO -1 ! All HOMOs 99 | NLUMO -1 ! All LUMOs 100 | WRITE_CUBE F 101 | &END 102 | &END PRINT 103 | &END DFT 104 | &SUBSYS 105 | 106 | &CELL 107 | A 8.4280004501 0.0000000000 0.0000000000 108 | B 0.0000000000 8.9860000610 0.0000000000 109 | C 0.0000000000 0.0000000000 26.2329998016 110 | PERIODIC XYZ 111 | &END CELL 112 | 113 | &TOPOLOGY 114 | COORD_FILE_NAME optimized_unit_cell.xyz 115 | COORD_FILE_FORMAT XYZ 116 | ! Only in case you use cif file 117 | !&GENERATE 118 | ! REORDER T 119 | !&END 120 | &END 121 | 122 | &KIND Cs 123 | BASIS_SET DZVP-MOLOPT-SR-GTH 124 | BASIS_SET AUX_FIT cFIT9 125 | POTENTIAL GTH-BLYP-q9 126 | &END KIND 127 | &KIND Pb 128 | BASIS_SET DZVP-MOLOPT-SR-GTH 129 | BASIS_SET AUX_FIT cFIT6 130 | POTENTIAL GTH-BLYP-q4 131 | &END KIND 132 | &KIND I 133 | BASIS_SET DZVP-MOLOPT-SR-GTH 134 | BASIS_SET AUX_FIT cFIT6 135 | POTENTIAL GTH-BLYP-q7 136 | &END KIND 137 | &KIND H 138 | BASIS_SET DZVP-MOLOPT-GTH 139 | BASIS_SET AUX_FIT cFIT3 140 | POTENTIAL GTH-BLYP-q1 141 | &END KIND 142 | &KIND C 143 | BASIS_SET DZVP-MOLOPT-GTH 144 | BASIS_SET AUX_FIT cFIT3 145 | POTENTIAL GTH-BLYP-q4 146 | &END KIND 147 | &KIND O 148 | BASIS_SET DZVP-MOLOPT-GTH 149 | BASIS_SET AUX_FIT cFIT3 150 | POTENTIAL GTH-BLYP-q6 151 | &END KIND 152 | &KIND N 153 | BASIS_SET DZVP-MOLOPT-GTH 154 | BASIS_SET AUX_FIT cFIT3 155 | POTENTIAL GTH-BLYP-q5 156 | &END KIND 157 | &END SUBSYS 158 | &END FORCE_EVAL 159 | -------------------------------------------------------------------------------- /6_hybrid_functionals/3_BA2_PbI4/b3lyp.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_B3LYP 4 | RUN_TYPE ENERGY 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD QS 8 | &DFT 9 | UKS .FALSE. 10 | BASIS_SET_FILE_NAME BASIS_MOLOPT 11 | BASIS_SET_FILE_NAME BASIS_ADMM 12 | BASIS_SET_FILE_NAME BASIS_ADMM_MOLOPT 13 | POTENTIAL_FILE_NAME GTH_POTENTIALS 14 | WFN_RESTART_FILE_NAME BA2_PbI4_PBE-RESTART.wfn 15 | &MGRID 16 | NGRIDS 16 17 | CUTOFF 500 18 | REL_CUTOFF 50 19 | &END MGRID 20 | &QS 21 | METHOD GPW 22 | EPS_DEFAULT 1.000E-14 23 | &END QS 24 | &POISSON 25 | PERIODIC XYZ 26 | PSOLVER PERIODIC 27 | &END 28 | &SCF 29 | &DIAGONALIZATION ON 30 | &END DIAGONALIZATION 31 | &MIXING 32 | ALPHA 0.3 33 | METHOD BROYDEN_MIXING 34 | NBROYDEN 8 35 | &END MIXING 36 | EPS_SCF 1.0E-6 37 | SCF_GUESS RESTART 38 | MAX_SCF 50 39 | ADDED_MOS 50 40 | &END SCF 41 | &XC 42 | &XC_FUNCTIONAL 43 | &LIBXC 44 | FUNCTIONAL XC_HYB_GGA_XC_B3LYP 45 | &END LIBXC 46 | &END XC_FUNCTIONAL 47 | &HF 48 | &SCREENING 49 | EPS_SCHWARZ 1.0E-10 50 | &END 51 | !&MEMORY 52 | ! This is the maximum memory for each processor in MBi, I just comment it but 53 | ! you can obtain it through computing the memory you ask in the slurm file 54 | ! divided by the number of processors. 55 | ! MAX_MEMORY 10000 56 | ! EPS_STORAGE_SCALING 0.1 57 | !&END MEMORY 58 | FRACTION 0.20 59 | &END 60 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 61 | &XC_GRID 62 | XC_DERIV SPLINE2_SMOOTH 63 | &END XC_GRID 64 | &VDW_POTENTIAL 65 | POTENTIAL_TYPE PAIR_POTENTIAL 66 | &PAIR_POTENTIAL 67 | PARAMETER_FILE_NAME dftd3.dat 68 | TYPE DFTD3 69 | REFERENCE_FUNCTIONAL PBE 70 | R_CUTOFF [angstrom] 16 71 | &END 72 | &END VDW_POTENTIAL 73 | &END XC 74 | &AUXILIARY_DENSITY_MATRIX_METHOD 75 | METHOD BASIS_PROJECTION 76 | ADMM_PURIFICATION_METHOD NONE 77 | &END 78 | &PRINT 79 | &MULLIKEN OFF 80 | &END 81 | &HIRSHFELD OFF 82 | &END 83 | &MO_CUBES 84 | NHOMO -1 ! All HOMOs 85 | NLUMO -1 ! All LUMOs 86 | WRITE_CUBE F 87 | &END 88 | &END PRINT 89 | &END DFT 90 | &SUBSYS 91 | 92 | &CELL 93 | A 8.4280004501 0.0000000000 0.0000000000 94 | B 0.0000000000 8.9860000610 0.0000000000 95 | C 0.0000000000 0.0000000000 26.2329998016 96 | PERIODIC XYZ 97 | &END CELL 98 | 99 | &TOPOLOGY 100 | COORD_FILE_NAME optimized_unit_cell.xyz 101 | COORD_FILE_FORMAT XYZ 102 | ! Only in case you use cif file 103 | !&GENERATE 104 | ! REORDER T 105 | !&END 106 | &END 107 | 108 | &KIND Cs 109 | BASIS_SET DZVP-MOLOPT-SR-GTH 110 | BASIS_SET AUX_FIT cFIT9 111 | POTENTIAL GTH-BLYP-q9 112 | &END KIND 113 | &KIND Pb 114 | BASIS_SET DZVP-MOLOPT-SR-GTH 115 | BASIS_SET AUX_FIT cFIT6 116 | POTENTIAL GTH-BLYP-q4 117 | &END KIND 118 | &KIND I 119 | BASIS_SET DZVP-MOLOPT-SR-GTH 120 | BASIS_SET AUX_FIT cFIT6 121 | POTENTIAL GTH-BLYP-q7 122 | &END KIND 123 | &KIND H 124 | BASIS_SET DZVP-MOLOPT-GTH 125 | BASIS_SET AUX_FIT cFIT3 126 | POTENTIAL GTH-BLYP-q1 127 | &END KIND 128 | &KIND C 129 | BASIS_SET DZVP-MOLOPT-GTH 130 | BASIS_SET AUX_FIT cFIT3 131 | POTENTIAL GTH-BLYP-q4 132 | &END KIND 133 | &KIND O 134 | BASIS_SET DZVP-MOLOPT-GTH 135 | BASIS_SET AUX_FIT cFIT3 136 | POTENTIAL GTH-BLYP-q6 137 | &END KIND 138 | &KIND N 139 | BASIS_SET DZVP-MOLOPT-GTH 140 | BASIS_SET AUX_FIT cFIT3 141 | POTENTIAL GTH-BLYP-q5 142 | &END KIND 143 | &END SUBSYS 144 | &END FORCE_EVAL 145 | -------------------------------------------------------------------------------- /6_hybrid_functionals/3_BA2_PbI4/hse06.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_HSE06 4 | RUN_TYPE ENERGY 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD QS 8 | &DFT 9 | UKS .FALSE. 10 | BASIS_SET_FILE_NAME BASIS_MOLOPT 11 | BASIS_SET_FILE_NAME BASIS_ADMM 12 | BASIS_SET_FILE_NAME BASIS_ADMM_MOLOPT 13 | POTENTIAL_FILE_NAME GTH_POTENTIALS 14 | WFN_RESTART_FILE_NAME BA2_PbI4_PBE-RESTART.wfn 15 | &MGRID 16 | NGRIDS 16 17 | CUTOFF 500 18 | REL_CUTOFF 50 19 | &END MGRID 20 | &QS 21 | METHOD GPW 22 | EPS_DEFAULT 1.000E-14 23 | &END QS 24 | &POISSON 25 | PERIODIC XYZ 26 | PSOLVER PERIODIC 27 | &END 28 | &SCF 29 | &DIAGONALIZATION ON 30 | &END DIAGONALIZATION 31 | &MIXING 32 | ALPHA 0.3 33 | METHOD BROYDEN_MIXING 34 | NBROYDEN 8 35 | &END MIXING 36 | EPS_SCF 1.0E-6 37 | SCF_GUESS RESTART 38 | MAX_SCF 50 39 | ADDED_MOS 50 40 | &END SCF 41 | &XC 42 | &XC_FUNCTIONAL 43 | &XWPBE 44 | SCALE_X -0.25 45 | SCALE_X0 1.0 46 | OMEGA 0.11 47 | &END 48 | &PBE 49 | SCALE_X 0.0 50 | SCALE_C 1.0 51 | &END PBE 52 | &END XC_FUNCTIONAL 53 | &HF 54 | &SCREENING 55 | EPS_SCHWARZ 1.0E-6 56 | EPS_SCHWARZ_FORCES 1.0E-5 57 | SCREEN_ON_INITIAL_P FALSE 58 | &END SCREENING 59 | &INTERACTION_POTENTIAL 60 | CUTOFF_RADIUS 10 61 | POTENTIAL_TYPE SHORTRANGE 62 | OMEGA 0.11 63 | &END INTERACTION_POTENTIAL 64 | ! Defines the maximum amount of memory [MiB] to be consumed by the full HFX module. 65 | !&MEMORY 66 | ! MAX_MEMORY 10000 67 | ! EPS_STORAGE_SCALING 0.1 68 | !&END MEMORY 69 | FRACTION 0.25 70 | &END HF 71 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 72 | &XC_GRID 73 | XC_DERIV SPLINE2_SMOOTH 74 | &END XC_GRID 75 | &VDW_POTENTIAL 76 | POTENTIAL_TYPE PAIR_POTENTIAL 77 | &PAIR_POTENTIAL 78 | PARAMETER_FILE_NAME dftd3.dat 79 | TYPE DFTD3 80 | REFERENCE_FUNCTIONAL PBE 81 | R_CUTOFF [angstrom] 16 82 | &END 83 | &END VDW_POTENTIAL 84 | &END XC 85 | &AUXILIARY_DENSITY_MATRIX_METHOD 86 | METHOD BASIS_PROJECTION 87 | ADMM_PURIFICATION_METHOD NONE 88 | &END 89 | &PRINT 90 | &MULLIKEN OFF 91 | &END 92 | &HIRSHFELD OFF 93 | &END 94 | &MO_CUBES 95 | NHOMO -1 ! All HOMOs 96 | NLUMO -1 ! All LUMOs 97 | WRITE_CUBE F 98 | &END 99 | &END PRINT 100 | &END DFT 101 | &SUBSYS 102 | 103 | &CELL 104 | A 8.4280004501 0.0000000000 0.0000000000 105 | B 0.0000000000 8.9860000610 0.0000000000 106 | C 0.0000000000 0.0000000000 26.2329998016 107 | PERIODIC XYZ 108 | &END CELL 109 | 110 | &TOPOLOGY 111 | COORD_FILE_NAME optimized_unit_cell.xyz 112 | COORD_FILE_FORMAT XYZ 113 | ! Only in case you use cif file 114 | !&GENERATE 115 | ! REORDER T 116 | !&END 117 | &END 118 | 119 | &KIND Cs 120 | BASIS_SET DZVP-MOLOPT-SR-GTH 121 | BASIS_SET AUX_FIT cFIT9 122 | POTENTIAL GTH-PBE-q9 123 | &END KIND 124 | &KIND Pb 125 | BASIS_SET DZVP-MOLOPT-SR-GTH 126 | BASIS_SET AUX_FIT cFIT6 127 | POTENTIAL GTH-PBE-q4 128 | &END KIND 129 | &KIND I 130 | BASIS_SET DZVP-MOLOPT-SR-GTH 131 | BASIS_SET AUX_FIT cFIT6 132 | POTENTIAL GTH-PBE-q7 133 | &END KIND 134 | &KIND H 135 | BASIS_SET DZVP-MOLOPT-GTH 136 | BASIS_SET AUX_FIT cFIT3 137 | POTENTIAL GTH-PBE-q1 138 | &END KIND 139 | &KIND C 140 | BASIS_SET DZVP-MOLOPT-GTH 141 | BASIS_SET AUX_FIT cFIT3 142 | POTENTIAL GTH-PBE-q4 143 | &END KIND 144 | &KIND O 145 | BASIS_SET DZVP-MOLOPT-GTH 146 | BASIS_SET AUX_FIT cFIT3 147 | POTENTIAL GTH-PBE-q6 148 | &END KIND 149 | &KIND N 150 | BASIS_SET DZVP-MOLOPT-GTH 151 | BASIS_SET AUX_FIT cFIT3 152 | POTENTIAL GTH-PBE-q5 153 | &END KIND 154 | &END SUBSYS 155 | &END FORCE_EVAL 156 | -------------------------------------------------------------------------------- /6_hybrid_functionals/3_BA2_PbI4/pbe.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_PBE 4 | RUN_TYPE ENERGY 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD QS 8 | &DFT 9 | UKS .FALSE. 10 | BASIS_SET_FILE_NAME BASIS_MOLOPT 11 | POTENTIAL_FILE_NAME GTH_POTENTIALS 12 | &MGRID 13 | NGRIDS 16 14 | CUTOFF 500 15 | REL_CUTOFF 50 16 | &END MGRID 17 | &QS 18 | METHOD GPW 19 | EPS_DEFAULT 1.000E-14 20 | &END QS 21 | &POISSON 22 | PERIODIC XYZ 23 | PSOLVER PERIODIC 24 | &END 25 | &SCF 26 | &DIAGONALIZATION ON 27 | &END DIAGONALIZATION 28 | &MIXING 29 | ALPHA 0.3 30 | METHOD BROYDEN_MIXING 31 | NBROYDEN 8 32 | &END MIXING 33 | EPS_SCF 1.0E-6 34 | SCF_GUESS RESTART 35 | MAX_SCF 50 36 | ADDED_MOS 50 37 | &END SCF 38 | &XC 39 | &XC_FUNCTIONAL 40 | &PBE 41 | &END PBE 42 | &END XC_FUNCTIONAL 43 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 44 | &XC_GRID 45 | XC_DERIV SPLINE2_SMOOTH 46 | &END XC_GRID 47 | &VDW_POTENTIAL 48 | POTENTIAL_TYPE PAIR_POTENTIAL 49 | &PAIR_POTENTIAL 50 | PARAMETER_FILE_NAME dftd3.dat 51 | TYPE DFTD3 52 | REFERENCE_FUNCTIONAL PBE 53 | R_CUTOFF [angstrom] 16 54 | &END 55 | &END VDW_POTENTIAL 56 | &END XC 57 | &PRINT 58 | &MULLIKEN OFF 59 | &END 60 | &HIRSHFELD OFF 61 | &END 62 | &END PRINT 63 | &END DFT 64 | &SUBSYS 65 | 66 | &CELL 67 | A 8.4280004501 0.0000000000 0.0000000000 68 | B 0.0000000000 8.9860000610 0.0000000000 69 | C 0.0000000000 0.0000000000 26.2329998016 70 | PERIODIC XYZ 71 | &END CELL 72 | 73 | &TOPOLOGY 74 | COORD_FILE_NAME optimized_unit_cell.xyz 75 | COORD_FILE_FORMAT XYZ 76 | ! Only in case you use cif file 77 | !&GENERATE 78 | ! REORDER T 79 | !&END 80 | &END 81 | 82 | &KIND Cs 83 | BASIS_SET DZVP-MOLOPT-SR-GTH 84 | POTENTIAL GTH-PBE-q9 85 | &END KIND 86 | &KIND Pb 87 | BASIS_SET DZVP-MOLOPT-SR-GTH 88 | POTENTIAL GTH-PBE-q4 89 | &END KIND 90 | &KIND I 91 | BASIS_SET DZVP-MOLOPT-SR-GTH 92 | POTENTIAL GTH-PBE-q7 93 | &END KIND 94 | &KIND H 95 | BASIS_SET DZVP-MOLOPT-GTH 96 | POTENTIAL GTH-PBE-q1 97 | &END KIND 98 | &KIND C 99 | BASIS_SET DZVP-MOLOPT-GTH 100 | POTENTIAL GTH-PBE-q4 101 | &END KIND 102 | &KIND O 103 | BASIS_SET DZVP-MOLOPT-GTH 104 | POTENTIAL GTH-PBE-q6 105 | &END KIND 106 | &KIND N 107 | BASIS_SET DZVP-MOLOPT-GTH 108 | POTENTIAL GTH-PBE-q5 109 | &END KIND 110 | &END SUBSYS 111 | &END FORCE_EVAL 112 | -------------------------------------------------------------------------------- /7_molecular_dynamics/1_c3n4/c3n4.xyz: -------------------------------------------------------------------------------- 1 | 54 2 | 3 | C 13.56855 11.51415 0.76991 4 | N 13.56747 10.04279 0.76931 5 | N 12.38329 12.12821 0.77016 6 | C 12.36337 13.45813 0.77078 7 | C 11.28352 15.47490 0.76977 8 | C 13.56960 15.54676 0.77009 9 | N 10.00928 16.20966 0.76961 10 | N 11.22208 14.14140 0.77018 11 | N 12.40786 16.19450 0.76907 12 | N 13.56951 14.15424 0.77177 13 | N 17.12969 3.87566 0.76873 14 | C 17.12893 5.34684 0.76904 15 | C 15.92211 7.29018 0.77036 16 | C 14.84119 9.30640 0.76928 17 | C 18.33422 7.29109 0.76997 18 | C 17.12776 9.37967 0.76916 19 | C 19.41369 9.30801 0.76944 20 | N 19.47526 7.97448 0.77050 21 | N 18.28935 10.02770 0.76771 22 | N 14.75437 12.12759 0.77023 23 | N 15.96518 10.02642 0.76831 24 | N 17.12790 7.98698 0.77100 25 | N 18.31427 5.96095 0.76820 26 | N 15.94315 5.96012 0.77022 27 | N 14.78019 7.97287 0.76982 28 | C 20.68954 11.51369 0.77000 29 | N 19.50423 12.12763 0.77068 30 | N 20.68822 10.04256 0.76957 31 | N 21.87531 12.12704 0.76980 32 | C 14.77550 13.45766 0.77110 33 | C 15.85607 15.47389 0.77016 34 | C 19.48403 13.45785 0.77087 35 | C 18.40422 15.47456 0.77025 36 | C 21.89639 13.45718 0.77102 37 | C 20.69062 15.54646 0.77064 38 | C 22.97701 15.47348 0.77066 39 | N 14.73188 16.19376 0.76897 40 | N 15.91715 14.14041 0.77106 41 | N 17.12986 16.20996 0.77002 42 | N 19.52859 16.19427 0.77031 43 | N 21.85292 16.19317 0.76967 44 | N 23.03820 14.13967 0.77144 45 | N 20.69038 14.15371 0.77164 46 | N 18.34280 14.14102 0.77015 47 | N 24.25079 16.20970 0.77060 48 | H 10.00875 17.19416 0.76931 49 | H 9.15695 15.71695 0.76980 50 | H 17.98255 3.38385 0.76787 51 | H 16.27734 3.38297 0.76938 52 | H 24.25032 17.19420 0.77004 53 | H 25.10362 15.71785 0.77112 54 | H 12.71454 9.55111 0.76893 55 | H 21.54041 9.54960 0.76937 56 | H 17.12957 17.19446 0.76977 57 | -------------------------------------------------------------------------------- /7_molecular_dynamics/1_c3n4/md.in: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME C3N4-QD 4 | RUN_TYPE MD 5 | !For huge cutoff this keyword is required 6 | EXTENDED_FFT_LENGTHS .TRUE. 7 | &END GLOBAL 8 | 9 | &FORCE_EVAL 10 | METHOD QS 11 | 12 | &DFT 13 | BASIS_SET_FILE_NAME BASIS_MOLOPT 14 | POTENTIAL_FILE_NAME POTENTIAL 15 | WFN_RESTART_FILE_NAME C3N4-QD-RESTART.wfn 16 | 17 | MULTIPLICITY 1 18 | 19 | &MGRID 20 | NGRIDS 4 21 | CUTOFF 400 22 | &END MGRID 23 | 24 | &QS 25 | METHOD GPW 26 | EPS_DEFAULT 1.000E-14 27 | &END QS 28 | 29 | &POISSON 30 | PERIODIC NONE 31 | POISSON_SOLVER WAVELET 32 | &END 33 | 34 | &SCF 35 | &DIAGONALIZATION 36 | ALGORITHM DAVIDSON 37 | &END 38 | 39 | &SMEAR 40 | METHOD FERMI_DIRAC 41 | &END 42 | 43 | &MIXING 44 | ALPHA 0.3 45 | METHOD BROYDEN_MIXING 46 | NBROYDEN 8 47 | &END MIXING 48 | EPS_SCF 1.0E-8 49 | SCF_GUESS RESTART 50 | MAX_SCF 100 51 | ADDED_MOS 10 52 | ! Only in case you need outer scf for convergence 53 | !&OUTER_SCF T 54 | ! EPS_SCF 1.0E-06 55 | ! MAX_SCF 20 56 | !&END OUTER_SCF 57 | &END SCF 58 | 59 | &XC 60 | &XC_FUNCTIONAL 61 | &PBE 62 | &END PBE 63 | &END XC_FUNCTIONAL 64 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 65 | &XC_GRID 66 | XC_DERIV SPLINE2_SMOOTH 67 | &END XC_GRID 68 | &VDW_POTENTIAL 69 | POTENTIAL_TYPE PAIR_POTENTIAL 70 | &PAIR_POTENTIAL 71 | PARAMETER_FILE_NAME dftd3.dat 72 | TYPE DFTD3 73 | REFERENCE_FUNCTIONAL PBE 74 | R_CUTOFF [angstrom] 16 75 | &END 76 | &END VDW_POTENTIAL 77 | &END XC 78 | 79 | &PRINT 80 | &MULLIKEN OFF 81 | &END 82 | &HIRSHFELD OFF 83 | &END 84 | &MO_CUBES 85 | NHOMO 3 86 | NLUMO 3 87 | ! If the it is set to .TRUE. or T, it will print out the cube files 88 | ! In this case it will only print all the HOMO energies and 3 LUMO energies 89 | WRITE_CUBE F 90 | &END 91 | &PDOS 92 | APPEND .FALSE. 93 | COMPONENTS .FALSE. 94 | NLUMO -1 95 | &END PDOS 96 | &END PRINT 97 | &END DFT 98 | &SUBSYS 99 | 100 | &CELL 101 | ABC 35.0 35.0 35.0 102 | PERIODIC NONE 103 | &END CELL 104 | 105 | &TOPOLOGY 106 | COORD_FILE_NAME c3n4.xyz 107 | COORD_FILE_FORMAT XYZ 108 | ! Only in case you use cif file 109 | !&GENERATE 110 | ! REORDER T 111 | !&END 112 | &CENTER_COORDINATES 113 | &END 114 | &END 115 | 116 | &KIND H 117 | BASIS_SET DZVP-MOLOPT-GTH 118 | POTENTIAL GTH-PBE-q1 119 | &END KIND 120 | &KIND C 121 | BASIS_SET DZVP-MOLOPT-GTH 122 | POTENTIAL GTH-PBE-q4 123 | &END KIND 124 | &KIND N 125 | BASIS_SET DZVP-MOLOPT-GTH 126 | POTENTIAL GTH-PBE-q5 127 | &END KIND 128 | &END SUBSYS 129 | &END FORCE_EVAL 130 | 131 | 132 | 133 | &MOTION 134 | &MD 135 | ENSEMBLE NVT 136 | TEMPERATURE [K] 300 137 | TIMESTEP [fs] 1.0 138 | STEPS 100 139 | COMVEL_TOL 0.0 140 | &THERMOSTAT 141 | REGION GLOBAL 142 | TYPE CSVR 143 | &CSVR 144 | TIMECON 16 145 | &END 146 | &END THERMOSTAT 147 | &END 148 | &PRINT 149 | &TRAJECTORY 150 | &EACH 151 | MD 1 152 | &END EACH 153 | &END TRAJECTORY 154 | &VELOCITIES ON 155 | &END VELOCITIES 156 | &FORCES ON 157 | &END FORCES 158 | &RESTART 159 | BACKUP_COPIES 1 160 | &EACH 161 | MD 1 162 | &END EACH 163 | &END RESTART 164 | &END PRINT 165 | &END 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /7_molecular_dynamics/1_c3n4/output.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/7_molecular_dynamics/1_c3n4/output.tar.bz2 -------------------------------------------------------------------------------- /7_molecular_dynamics/1_c3n4/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=valhalla --qos=valhalla 3 | #SBATCH --clusters=faculty 4 | #SBATCH --time=08:30:00 5 | #SBATCH --nodes=1 6 | #SBATCH --ntasks-per-node=9 7 | #SBATCH --cpus-per-task=1 8 | #SBATCH --mem=78000 9 | ###SBATCH --mail-user=alexeyak@buffalo.edu 10 | echo "SLURM_JOBID="$SLURM_JOBID 11 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 12 | echo "SLURM_NNODES="$SLURM_NNODES 13 | echo "SLURMTMPDIR="$SLURMTMPDIR 14 | echo "working directory="$SLURM_SUBMIT_DIR 15 | 16 | NPROCS=`srun --nodes=${SLURM_NNODES} bash -c 'hostname' |wc -l` 17 | echo NPROCS=$NPROCS 18 | 19 | 20 | module load cp2k/8.1-sse 21 | 22 | #module load openmpi/3.0.3/gcc-7.3.0 23 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 24 | 25 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 26 | omp_threads=$SLURM_CPUS_PER_TASK 27 | else 28 | omp_threads=1 29 | fi 30 | export OMP_NUM_THREADS=$omp_threads 31 | 32 | 33 | 34 | 35 | mpirun -n $NPROCS cp2k.popt -i md.in -o md.log 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /7_molecular_dynamics/2_adamantane/clean.sh: -------------------------------------------------------------------------------- 1 | rm o* 2 | rm sl* 3 | rm c10* 4 | rm *wfc* 5 | -------------------------------------------------------------------------------- /7_molecular_dynamics/2_adamantane/coord.xyz: -------------------------------------------------------------------------------- 1 | 26 2 | XYZ file 3 | C 9.178580 5.928680 6.784230 4 | C 8.288780 6.827330 5.895700 5 | C 9.184490 7.712870 5.000010 6 | C 10.068360 6.815530 4.104270 7 | C 10.956860 5.916830 4.994050 8 | C 9.160840 4.144480 5.000060 9 | C 10.062460 5.030020 5.889820 10 | C 7.388480 5.940480 5.005880 11 | C 8.271070 5.041840 4.110200 12 | C 9.166750 5.928710 3.215770 13 | H 8.541821 5.298140 7.443030 14 | H 9.819710 6.559260 7.438760 15 | H 7.653340 7.473351 6.539620 16 | H 8.552010 8.373790 4.367380 17 | H 9.825700 8.365280 5.632710 18 | H 10.712270 7.453100 3.460340 19 | H 11.619880 6.547200 5.626580 20 | H 11.607130 5.277700 4.357070 21 | H 9.789130 3.483580 4.363250 22 | H 8.523830 3.492070 5.636970 23 | H 10.702130 4.383980 6.529520 24 | H 6.729700 5.310070 5.642790 25 | H 6.733950 6.579590 4.373250 26 | H 7.622920 4.404290 3.470520 27 | H 9.795130 5.289790 2.556990 28 | H 8.534019 6.567690 2.561230 29 | 30 | -------------------------------------------------------------------------------- /7_molecular_dynamics/2_adamantane/cp2k_input_template.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PROJECT c10h16 3 | RUN_TYPE MD 4 | PRINT_LEVEL MEDIUM 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD Quickstep 8 | 9 | &PRINT 10 | &FORCES 11 | &END 12 | &TOTAL_NUMBERS ON 13 | &END TOTAL_NUMBERS 14 | &END PRINT 15 | 16 | &DFT 17 | 18 | BASIS_SET_FILE_NAME BASIS_MOLOPT 19 | POTENTIAL_FILE_NAME POTENTIAL 20 | WFN_RESTART_FILE_NAME RESTART.wfn 21 | 22 | &MGRID 23 | CUTOFF 400 24 | REL_CUTOFF 60 25 | NGRIDS 6 26 | &END MGRID 27 | 28 | &QS 29 | EPS_DEFAULT 1.0E-16 30 | &END QS 31 | 32 | &SCF 33 | SCF_GUESS RESTART 34 | EPS_SCF 1.0E-6 35 | MAX_SCF 300 36 | 37 | ADDED_MOS 20 38 | &DIAGONALIZATION 39 | ALGORITHM STANDARD 40 | &END DIAGONALIZATION 41 | &MIXING 42 | METHOD BROYDEN_MIXING 43 | ALPHA 0.5 44 | BETA 0.5 45 | NBROYDEN 8 46 | &END MIXING 47 | &END SCF 48 | 49 | &XC 50 | &XC_FUNCTIONAL PBE 51 | &END XC_FUNCTIONAL 52 | &END XC 53 | 54 | &END DFT 55 | 56 | &SUBSYS 57 | 58 | &KIND C 59 | ELEMENT C 60 | BASIS_SET ORB DZVP-MOLOPT-GTH 61 | POTENTIAL GTH-PBE-q4 62 | &END KIND 63 | &KIND H 64 | ELEMENT H 65 | BASIS_SET ORB DZVP-MOLOPT-GTH 66 | POTENTIAL GTH-PBE-q1 67 | &END KIND 68 | 69 | &CELL 70 | PERIODIC NONE 71 | A 15.0 0.00 0.00 72 | B 0.00 15.0 0.00 73 | C 0.00 0.00 15.0 74 | &END CELL 75 | &TOPOLOGY 76 | COORD_FILE_NAME coord.xyz 77 | COORD_FILE_FORMAT XYZ 78 | &END 79 | &END SUBSYS 80 | &END FORCE_EVAL 81 | 82 | 83 | &MOTION 84 | &MD 85 | ENSEMBLE NVT 86 | TEMPERATURE [K] 300 87 | TIMESTEP [fs] 1.0 88 | STEPS 100 89 | COMVEL_TOL 0.0 90 | &THERMOSTAT 91 | REGION GLOBAL 92 | TYPE CSVR 93 | &CSVR 94 | TIMECON 16 95 | &END 96 | &END THERMOSTAT 97 | &END 98 | &PRINT 99 | &TRAJECTORY 100 | &EACH 101 | MD 1 102 | &END EACH 103 | &END TRAJECTORY 104 | &VELOCITIES ON 105 | &END VELOCITIES 106 | &FORCES ON 107 | &END FORCES 108 | &RESTART 109 | BACKUP_COPIES 1 110 | &EACH 111 | MD 1 112 | &END EACH 113 | &END RESTART 114 | &END PRINT 115 | &END 116 | 117 | -------------------------------------------------------------------------------- /7_molecular_dynamics/2_adamantane/output.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/7_molecular_dynamics/2_adamantane/output.tar.bz2 -------------------------------------------------------------------------------- /7_molecular_dynamics/2_adamantane/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=valhalla --qos=valhalla 3 | #SBATCH --clusters=faculty 4 | 5 | #SBATCH --time=01:30:00 6 | #SBATCH --nodes=1 7 | #SBATCH --ntasks-per-node=12 8 | #SBATCH --cpus-per-task=1 9 | #SBATCH --mem=28000 10 | ###SBATCH --mail-user=alexeyak@buffalo.edu 11 | echo "SLURM_JOBID="$SLURM_JOBID 12 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 13 | echo "SLURM_NNODES="$SLURM_NNODES 14 | echo "SLURMTMPDIR="$SLURMTMPDIR 15 | echo "working directory="$SLURM_SUBMIT_DIR 16 | 17 | NPROCS=`srun --nodes=${SLURM_NNODES} bash -c 'hostname' |wc -l` 18 | echo NPROCS=$NPROCS 19 | 20 | 21 | module load cp2k/8.1-sse 22 | 23 | #module load openmpi/3.0.3/gcc-7.3.0 24 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 25 | 26 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 27 | omp_threads=$SLURM_CPUS_PER_TASK 28 | else 29 | omp_threads=1 30 | fi 31 | export OMP_NUM_THREADS=$omp_threads 32 | 33 | 34 | #nprocs=32 35 | #cp2k_exe=/panasas/scratch/grp-alexeyak/brendan/cp2k_install/cp2k-7.1/exe/local/cp2k.popt 36 | #module load cp2k/8.1-sse 37 | 38 | mpirun -n $NPROCS cp2k.popt -i cp2k_input_template.inp -o out.log 39 | 40 | 41 | -------------------------------------------------------------------------------- /7_molecular_dynamics/3_BA2_PbI4/md.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PRINT_LEVEL MEDIUM 3 | PROJECT_NAME BA2_PbI4_MD 4 | RUN_TYPE MD 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD QS 8 | &DFT 9 | UKS .FALSE. 10 | BASIS_SET_FILE_NAME BASIS_MOLOPT 11 | POTENTIAL_FILE_NAME POTENTIAL 12 | &MGRID 13 | NGRIDS 16 14 | CUTOFF 500 15 | REL_CUTOFF 50 16 | &END MGRID 17 | &QS 18 | METHOD GPW 19 | EPS_DEFAULT 1.000E-14 20 | &END QS 21 | &POISSON 22 | PERIODIC XYZ 23 | PSOLVER PERIODIC 24 | &END 25 | &SCF 26 | &DIAGONALIZATION ON 27 | &END DIAGONALIZATION 28 | &MIXING 29 | ALPHA 0.3 30 | METHOD BROYDEN_MIXING 31 | NBROYDEN 8 32 | &END MIXING 33 | EPS_SCF 1.0E-6 34 | SCF_GUESS ATOMIC 35 | MAX_SCF 50 36 | ADDED_MOS 50 37 | &END SCF 38 | &XC 39 | &XC_FUNCTIONAL 40 | &PBE 41 | &END PBE 42 | &END XC_FUNCTIONAL 43 | ! In CP2K versions lower than v7, this part is required for TDDFT calculations 44 | &XC_GRID 45 | XC_DERIV SPLINE2_SMOOTH 46 | &END XC_GRID 47 | &VDW_POTENTIAL 48 | POTENTIAL_TYPE PAIR_POTENTIAL 49 | &PAIR_POTENTIAL 50 | PARAMETER_FILE_NAME dftd3.dat 51 | TYPE DFTD3 52 | REFERENCE_FUNCTIONAL PBE 53 | R_CUTOFF [angstrom] 16 54 | &END 55 | &END VDW_POTENTIAL 56 | &END XC 57 | &PRINT 58 | &MULLIKEN OFF 59 | &END 60 | &HIRSHFELD OFF 61 | &END 62 | &END PRINT 63 | &END DFT 64 | &SUBSYS 65 | 66 | &CELL 67 | A 8.4280004501 0.0000000000 0.0000000000 68 | B 0.0000000000 8.9860000610 0.0000000000 69 | C 0.0000000000 0.0000000000 26.2329998016 70 | PERIODIC XYZ 71 | &END CELL 72 | 73 | &TOPOLOGY 74 | COORD_FILE_NAME optimized_unit_cell.xyz 75 | COORD_FILE_FORMAT XYZ 76 | ! Only in case you use cif file 77 | !&GENERATE 78 | ! REORDER T 79 | !&END 80 | &END 81 | 82 | &KIND Cs 83 | BASIS_SET DZVP-MOLOPT-SR-GTH 84 | POTENTIAL GTH-PBE-q9 85 | &END KIND 86 | &KIND Pb 87 | BASIS_SET DZVP-MOLOPT-SR-GTH 88 | POTENTIAL GTH-PBE-q4 89 | &END KIND 90 | &KIND I 91 | BASIS_SET DZVP-MOLOPT-SR-GTH 92 | POTENTIAL GTH-PBE-q7 93 | &END KIND 94 | &KIND H 95 | BASIS_SET DZVP-MOLOPT-GTH 96 | POTENTIAL GTH-PBE-q1 97 | &END KIND 98 | &KIND C 99 | BASIS_SET DZVP-MOLOPT-GTH 100 | POTENTIAL GTH-PBE-q4 101 | &END KIND 102 | &KIND O 103 | BASIS_SET DZVP-MOLOPT-GTH 104 | POTENTIAL GTH-PBE-q6 105 | &END KIND 106 | &KIND N 107 | BASIS_SET DZVP-MOLOPT-GTH 108 | POTENTIAL GTH-PBE-q5 109 | &END KIND 110 | &END SUBSYS 111 | &END FORCE_EVAL 112 | 113 | &MOTION 114 | &MD 115 | ENSEMBLE NVT 116 | TEMPERATURE [K] 300 117 | TIMESTEP [fs] 1.0 118 | STEPS 1000 119 | &THERMOSTAT 120 | REGION GLOBAL 121 | TYPE CSVR 122 | &CSVR 123 | TIMECON 16 124 | &END 125 | &END THERMOSTAT 126 | &END 127 | &PRINT 128 | &TRAJECTORY 129 | &EACH 130 | MD 1 131 | &END EACH 132 | &END TRAJECTORY 133 | &VELOCITIES ON 134 | &END VELOCITIES 135 | &FORCES ON 136 | &END FORCES 137 | &RESTART 138 | BACKUP_COPIES 1 139 | &EACH 140 | MD 1 141 | &END EACH 142 | &END RESTART 143 | &END PRINT 144 | &END 145 | -------------------------------------------------------------------------------- /7_molecular_dynamics/README.md: -------------------------------------------------------------------------------- 1 | # Molecular dynamics in CP2K 2 | 3 | The input of the molecular dynamics (MD) is almost the same as that for geometry optimization. 4 | For this case, change the `RUN_TYPE` to `MD` in the `&GLOBAL` section, and the `&MOTION` section as well. 5 | 6 | The obtained trajectory is stored in the `*-pos-1.xyz` file. The same as in geometry optimization, CP2K will print out 7 | a `.restart` file if the calculations are interrupted. The production of such files can be controlled in the 8 | [`&PRINT`](https://manual.cp2k.org/trunk/CP2K_INPUT/MOTION/PRINT.html) section of `&MOTION` section. 9 | 10 | The timings, temperature, potential, kinetic, and total energy are printed out in a `.ener` file. 11 | To see if the system is equilibrated, you can use Python by plotting the 12 | temperature vs time or total energy vs time. This is done using the following command: 13 | 14 | ``` 15 | import numpy as np 16 | import matplotlib.pyplot as plt 17 | # Load the .ener file 18 | ener_data = np.loadtxt('project_name-1.ener', skiprows=1) 19 | # Plot the temperature (4th column) vs time (second column) 20 | plt.figure() 21 | plt.plot(ener_data[:,1], ener_data[:,3]) 22 | plt.xlabel('Time, fs') 23 | plt.ylabel('Temperature, K') 24 | plt.title('Temperature vs time') 25 | plt.savefig('temp_vs_time.png',dpi=300) 26 | plt.close() 27 | ``` 28 | 29 | It is highly recommended to plot the energy levels vs time as well. In order to do this, you need to add the `&MO_CUBE` section without printing out the cube files by setting 30 | `WRITE_CUBE .FALSE.`. This will print out the energy levels for each step in the log file. If you have set the `&DIAGONALIZATION` to `ON`, the energies will be printed 31 | instantly because it has already computed the energies through diagonalization. If you want to use the `OT` (orbital transformation) method, it will take a bit longer to print 32 | out the energies. After the energies were printed in the log file, you can plot them using Libra. In order to do so, you will need to run the following command in Python (it is recommended to use the Jupyter notebook): 33 | 34 | ``` 35 | import numpy as np 36 | import matplotlib.pyplot as plt 37 | from libra_py.CP2K_methods import read_energies_from_cp2k_md_log_file 38 | 39 | params = { } 40 | params["logfile_name"] = 'OUT-BA2PbI4-MD.log' # The log file name 41 | min_band = # put the minimum band here 42 | max_band = # put the maximum band here 43 | params["min_band"] = min_band 44 | params["max_band"] = max_band 45 | params["spin"] = 1 # which spin energies to read 46 | params["init_time"] = 50 # the initial time you want 47 | params["final_time"] = 250 # The final time you need 48 | 49 | # Read the energies 50 | energies, tot = read_energies_from_cp2k_md_log_file(params) 51 | 52 | # Now it is needed to 53 | # Only in case you are using Jupyter Notebook 54 | # %matplotlib notebook 55 | plt.figure() 56 | homo_index = # set the HOMO index here 57 | 58 | for band in range(0,max_band-min_band+1): 59 | energy_levels = [] 60 | for time in range(params["init_time"],params["final_time"]): 61 | energy_levels.append(energies[time-params["init_time"]][band]) 62 | energy_levels = np.array(energy_levels) * 27.211385 # Converting to eV 63 | if band == homo_index-min_band: # Plot the HOMO with blue color 64 | plt.plot(energy_levels, color="blue") 65 | elif band == homo_index-min_band+1: # Plot the LUMO with red color 66 | plt.plot(energy_levels, color="red") 67 | else: # Other states are plotted with black color 68 | plt.plot(energy_levels, color="black") 69 | 70 | plt.xlabel("Time, fs") 71 | plt.ylabel("Energy, eV") 72 | plt.title("(BA)$_2$PbI$_4$ energy levels vs time") 73 | plt.savefig('BA2PbI4_energy_levels_vs_time.png', dpi=300) 74 | plt.close() 75 | ``` 76 | With this method, you can always check the energy levels vs time live as the MD goes. You can also check the average of the gap between two states over the MD. For this, you can 77 | add another cell in Jupyter in which you have the following python code: 78 | ``` 79 | # The HOMO-LUMO gap 80 | istate = homo_index 81 | fstate = homo_index+1 82 | energy_gap = [] 83 | for time in range(params["init_time"],params["final_time"]): 84 | energy_gap.append(energies[time-params["init_time"]][fstate-min_band] - energies[time-params["init_time"]][istate-min_band]) 85 | energy_gap = np.array(energy_gap) * 27.211385 86 | print('The average energy gap between state %d and %d is:'%(istate,fstate), np.mean(energy_gap), 'eV') 87 | ``` 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /8_cube_file_timeoverlaps/3_BA2_PbI4/README.md: -------------------------------------------------------------------------------- 1 | # 1. Cutoff analysis for cube files overlaps 2 | 3 | The last part in this manual is about the effect of CP2K parameters on the overlap matrices. CP2K uses the converged wavefunction to produce the cube files for each molecular 4 | orbital. It will append the numerical values of the wavefunction computed at each grid point in a cube file. The grid points is dependent on the cutoff value. 5 | The larger the cutoff the higher the number of grid points are. In fact, the cutoff value "defines" the number of grid points. 6 | 7 | Now, if we have a huge cutoff value, like 1000 Ry, and we want to append all the values of the plane waves in all the grid points, then each cube file size will rise up to 8 | hundreds of MBs or even some GBs. This is also dependent on the system cell size as well and the larger the cell size the larger the cube files will be. There are different 9 | ways to avoid high computational cost for outputting the cube files by CP2K. Specially, if we are going to use a large number of states, for example 30 states in valence 10 | band and 20 in conduction band. Each cube file is 600 MB, for example, and therefore all the cube files will be up to 30 GB for only one time step and for two consecutive 11 | time step this would be 60 GB that in some cases may cause overflow of the disk. 12 | 13 | One way to overcome this problem and avoiding the overflow of the disk space is to use the keyword `STRIDE` in the input file. The `STRIDE` keyword will use and evaluate 14 | the wave functions only at some grid points. To clarify what it means, it is better to give an example. The `STRIDE 1 1 1` will use all the grid points in all the three X, Y, 15 | and Z axis. The `STRIDE 2 2 2` will use half of the grid points on each of the X, Y, and Z axis and `STRIDE 3 3 3` will use one third of the grid points on each of the axes and 16 | so on. The choice of the `STRIDE` needs to be studied for each system separately. For example if one chooses a huge cutoff value, say 1500 Ry, the cube files will be massively 17 | large and the computational times will increase. It is worth noting that Libra uses multiprocessing for reading the cube files and it is fast enough and may not take a very long 18 | time but note that one should also be very careful about the memory of the computer. If it overflows the code will crash. Therefore, the use of `STRIDE` is necessary. Now, if we 19 | want to check which `STRIDE` we should use we can start with a few number of Kohn-Sham states, say only 5 in valence band and 5 in conduction band, and start from `STRIDE 1 1 1`, 20 | and save the overlap matrices obtained from this parameter. Then we can move to `STRIDE 2 2 2` and compare the computed overlaps with the ones obtained from the finer mesh points 21 | (`STRIDE 1 1 1`). This loop is continued until we get to a large difference between the overlap values that can change the matrix elements significantly. The latter is the optimum 22 | `STRIDE` to use. Note that if one uses `STRIDE n` it is equivalent to `STRIDE n n n` in which `n` is an integer value. 23 | 24 | Here, we have adopted the `step2` files from [this repository](https://github.com/AkimovLab/Project_CsPbI3_MB_vs_SP). What we need to do is to check the results for different 25 | cutoff values or time step. We have provided Python file, `cutoff_analysis.py`, which will change the `cp2k_input_template.inp` cutoff and 26 | runs the calculations by `python run.py`. This is done through `for new_cutoff in range(300,1401,100):` line. It will consider the cutoff values of 300,400,500,..,1400 Ry. 27 | Then, it will change the directory name to `res-cutoffvalue` and you can see the overlaps and time-overlaps for the above purpose. 28 | There are two equilibrated trajectories available. One is with 1 fs time step, `MD_BA2PbI4_dt1fs-pos-1.xyz` and the other with 0.1 fs time step, `MD_BA2PbI4_dt0.1fs-pos-1.xyz`. 29 | To see the effect of time step on time overlaps, you can comment the current `trajectory_xyz_file` with 1 fs time step and uncomment the other one which is with 0.1 fs time 30 | step. Then you can run the calculations for different cutoff values as was mentioned above. 31 | 32 | **Note**: In `run.py`, we have can use `os.system("sbatch submit_"+str(njob)+".slm")` which submits the job on CCR. But if one wants to run this file without submitting it can be changed 33 | to `os.system("sh submit_"+str(njob)+".slm")`. 34 | 35 | This can also be done for different `STRIDE` values as well. You can either move the computed overlaps to a new directory and change the `STRIDE` in `cp2k_input_template.inp`, 36 | or you can write a new Python code that works based on changing the `STRIDE` keyword using the above Python code as an example. You can also set this up in two 37 | for loops, one for `CUTOFF` and one for `STRIDE` as well. 38 | 39 | One can see the changes of these values or any other parameter that is in CP2K input (such as `&VDW_POTENTIAL` for the effect of dispersion correction just as an example). 40 | You can check the results of the `step3` and `step4` to see the changes on nonadiabatic couplings or nonadiabatic dynamics as well. 41 | -------------------------------------------------------------------------------- /8_cube_file_timeoverlaps/3_BA2_PbI4/cp2k_input_template.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PROJECT cspbi3_cubic 3 | RUN_TYPE ENERGY 4 | PRINT_LEVEL MEDIUM 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD Quickstep 8 | 9 | &PROPERTIES 10 | &TDDFPT 11 | NSTATES 5 # number of excited states 12 | MAX_ITER 200 # maximum number of Davidson iterations 13 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 14 | &MGRID 15 | NGRIDS 25 16 | CUTOFF 100 17 | &END 18 | 19 | RESTART .FALSE. 20 | WFN_RESTART_FILE_NAME RESTART.tdwfn 21 | 22 | &END TDDFPT 23 | &END PROPERTIES 24 | 25 | &PRINT 26 | &FORCES 27 | &END 28 | &TOTAL_NUMBERS ON 29 | &END TOTAL_NUMBERS 30 | &END PRINT 31 | 32 | &DFT 33 | 34 | &PRINT 35 | &PDOS SILENT 36 | COMPONENTS T 37 | NLUMO -1 38 | &END PDOS 39 | &MO_CUBES 40 | NLUMO 5 41 | NHOMO 5 42 | WRITE_CUBE .TRUE. 43 | STRIDE 1 1 1 44 | &END 45 | 46 | &MULLIKEN OFF 47 | &END 48 | &HIRSHFELD OFF 49 | &END 50 | 51 | &END PRINT 52 | 53 | BASIS_SET_FILE_NAME /home/97425008/project_2d_perovskite/cutoff_analysis/BASIS_MOLOPT 54 | POTENTIAL_FILE_NAME /home/97425008/project_2d_perovskite/cutoff_analysis/POTENTIAL 55 | WFN_RESTART_FILE_NAME RESTART.wfn 56 | 57 | &MGRID 58 | NGRIDS 25 59 | CUTOFF 300 60 | &END MGRID 61 | &QS 62 | EPS_DEFAULT 1.0E-16 63 | &END QS 64 | &SCF 65 | SCF_GUESS RESTART 66 | EPS_SCF 1.0E-6 67 | MAX_SCF 50 68 | 69 | !&OT 70 | ! PRECONDITIONER FULL_ALL 71 | ! MINIMIZER DIIS 72 | !&END OT 73 | 74 | ADDED_MOS 50 75 | !CHOLESKY INVERSE 76 | !&SMEAR ON 77 | ! METHOD FERMI_DIRAC 78 | ! ELECTRONIC_TEMPERATURE [K] 300 79 | !&END SMEAR 80 | &DIAGONALIZATION ON 81 | ALGORITHM STANDARD 82 | &END DIAGONALIZATION 83 | &MIXING 84 | METHOD BROYDEN_MIXING 85 | ALPHA 0.5 86 | BETA 0.5 87 | NBROYDEN 8 88 | &END MIXING 89 | 90 | &END SCF 91 | &XC 92 | &XC_FUNCTIONAL PBE 93 | &END XC_FUNCTIONAL 94 | &VDW_POTENTIAL 95 | POTENTIAL_TYPE PAIR_POTENTIAL 96 | &PAIR_POTENTIAL 97 | PARAMETER_FILE_NAME /home/97425008/project_2d_perovskite/cutoff_analysis/dftd3.dat 98 | TYPE DFTD3 99 | REFERENCE_FUNCTIONAL PBE 100 | R_CUTOFF [angstrom] 16 101 | &END 102 | &END VDW_POTENTIAL 103 | &XC_GRID 104 | XC_DERIV SPLINE2_SMOOTH 105 | &END XC_GRID 106 | &END XC 107 | &END DFT 108 | &SUBSYS 109 | 110 | &KIND Cs 111 | ELEMENT Cs 112 | BASIS_SET ORB DZVP-MOLOPT-SR-GTH 113 | POTENTIAL GTH-PBE-q9 114 | &END KIND 115 | &KIND Pb 116 | ELEMENT Pb 117 | BASIS_SET ORB DZVP-MOLOPT-SR-GTH 118 | POTENTIAL GTH-PBE-q4 119 | &END KIND 120 | &KIND I 121 | ELEMENT I 122 | BASIS_SET ORB DZVP-MOLOPT-SR-GTH 123 | POTENTIAL GTH-PBE-q7 124 | &END KIND 125 | 126 | 127 | &CELL 128 | PERIODIC XYZ 129 | !A 8.4280000000 0.0000000000 0.0000000000 130 | !B 0.0000000000 8.9860000610 0.0000000000 131 | !C 0.0000000000 0.0000000000 26.2329998016 132 | A 12.8282909393 0.00 0.00 133 | B 0.00 12.8282909393 0.00 134 | C 0.00 0.00 12.8282909393 135 | &END CELL 136 | &TOPOLOGY 137 | COORD_FILE_NAME coord.xyz 138 | COORD_FILE_FORMAT XYZ 139 | &END 140 | &END SUBSYS 141 | &END FORCE_EVAL 142 | -------------------------------------------------------------------------------- /8_cube_file_timeoverlaps/3_BA2_PbI4/cutoff_analysis.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import numpy as np 4 | 5 | for new_cutoff in range(300,1401,100): 6 | 7 | # Open up the cp2k_input_template.inp file 8 | 9 | f1 = open('cp2k_input_template.inp','r') 10 | lines = f1.readlines() 11 | f1.close() 12 | 13 | # Finding the CUTOFF keyword line number 14 | cutoff_line_num = [] 15 | for i in range(len(lines)): 16 | if 'cutoff' in lines[i].lower().split(): 17 | cutoff_line_num.append(i) 18 | 19 | # Open up a new file which will replace the original one 20 | # This file contains the new grid cutoff 21 | 22 | f2 = open('cp2k_input_template_1.inp','w') 23 | 24 | for i in range(len(lines)): 25 | if i != cutoff_line_num[1]: 26 | f2.write(lines[i]) 27 | else: 28 | f2.write(' CUTOFF %d\n'%new_cutoff) 29 | 30 | f2.close() 31 | os.system('rm cp2k_input_template.inp') 32 | os.system('mv cp2k_input_template_1.inp cp2k_input_template.inp') 33 | os.system('python run.py') 34 | print('Done with cutoff %d'%new_cutoff) 35 | os.system('mv res res-%dRy'%new_cutoff) 36 | 37 | 38 | -------------------------------------------------------------------------------- /8_cube_file_timeoverlaps/3_BA2_PbI4/run.py: -------------------------------------------------------------------------------- 1 | ## This is inplace of the notebook for now -- to be converted to a notebook later 2 | 3 | from liblibra_core import * 4 | 5 | import multiprocessing as mp 6 | import numpy as np 7 | import math 8 | import sys 9 | import os 10 | 11 | 12 | from libra_py import CP2K_methods 13 | from libra_py import Gaussian_methods 14 | from libra_py.workflows.nbra import step2_many_body 15 | 16 | ########################### creating directories ############################### 17 | try: 18 | os.system("rm -r wd") 19 | os.mkdir('wd') 20 | os.system("rm -r res") 21 | os.mkdir('res') 22 | except: 23 | sys.exit(0) 24 | 25 | ######################### creating and submitting jobs ######################### 26 | # For MD with time step of 1 fs 27 | trajectory_xyz_file = "MD_BA2PbI4_dt1fs-pos-1.xyz" 28 | 29 | # For MD with time step of 0.1 fs 30 | #trajectory_xyz_file = "MD_BA2PbI4_dt0.1fs-pos-1.xyz" 31 | 32 | es_software_input_template = "cp2k_input_template.inp" 33 | es_software = "cp2k" 34 | #es_software_input_template = "gaussian_input_template.gjf" 35 | #es_software = "gaussian" 36 | istep = 0 37 | fstep = 1#3000 38 | # since it is a test for cube overlap convergence we use only one job 39 | njobs = 1#600 40 | for njob in range( njobs ): 41 | 42 | job_init_step, job_final_step = step2_many_body.curr_and_final_step_job( istep, fstep, njobs, njob ) 43 | nsteps_this_job = job_final_step - job_init_step + 1 44 | 45 | print( '\n1- We are before creating job ', njob, ' in directory:', os.getcwd() ) 46 | # Here we create the jobs through auxiliary_functions.cp2k_distribute 47 | if es_software.lower() == "cp2k": 48 | CP2K_methods.cp2k_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, njob ) 49 | 50 | elif es_software.lower() == "gaussian": 51 | Gaussian_methods.gaussian_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, njob ) 52 | 53 | print('2- Finished distributing for job ',njob,'\nNow we are in directory', os.getcwd()) 54 | os.chdir("wd/job"+str(njob)+"/") 55 | 56 | print('3- Now we have changed directory to :', os.getcwd(),'To submit job', njob) 57 | #os.mkdir("cubefiles") 58 | #os.mkdir("logfiles") 59 | 60 | print("4- The initial step for the job ", njob, " is: ", job_init_step, 'with final step: ', job_final_step) 61 | print("5- nsteps_this_job is: ", nsteps_this_job) 62 | St_ks_job = [] 63 | S_ks_job = [] 64 | debug = [] 65 | 66 | ############################ 67 | os.system("cp ../../submit_template.slm submit_"+str(njob)+".slm") 68 | # Now, open the submit_template file in this job folder 69 | # Add the values to the params for this job 70 | f = open( "submit_"+str(njob)+".slm" ) 71 | submit_template_file = f.readlines() 72 | submit_template_file_size = len( submit_template_file ) 73 | f.close() 74 | 75 | f = open( "submit_"+str(njob)+".slm" , 'w' ); f.close() 76 | for i in range( submit_template_file_size ): 77 | 78 | f = open( "submit_"+str(njob)+".slm" , 'a' ) 79 | 80 | submit_template_file_line = submit_template_file[i].split() 81 | if not submit_template_file_line: 82 | continue 83 | 84 | elif submit_template_file_line[0] == "job_init_step=": 85 | f.write( "declare -i job_init_step=%i" % (job_init_step) ) 86 | f.write("\n") 87 | 88 | elif submit_template_file_line[0] == "nsteps_this_job=": 89 | f.write( "declare -i nsteps_this_job=%i" % (nsteps_this_job) ) 90 | f.write("\n") 91 | 92 | elif submit_template_file_line[0] == "njob=": 93 | f.write( "declare -i njob=%i" % (njob) ) 94 | f.write("\n") 95 | 96 | else: 97 | f.write( submit_template_file[i] ) 98 | 99 | #os.system("sbatch submit_"+str(njob)+".slm") 100 | os.system("sh submit_"+str(njob)+".slm") 101 | 102 | print("6- Now submitting the job in folder: ", os.getcwd()) 103 | 104 | # Change directory to the main directory 105 | os.chdir("../../") 106 | print("7- Finished submitting job, now we are back in directory:", os.getcwd(),'\n\n\n') 107 | 108 | print("\nDone!\n") 109 | 110 | 111 | -------------------------------------------------------------------------------- /8_cube_file_timeoverlaps/3_BA2_PbI4/submit_template.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ###SBATCH --partition=scavenger --qos=scavenger 3 | ###SBATCH --clusters=faculty 4 | #SBATCH --partition=debug --qos=debug 5 | #SBATCH --clusters=ub-hpc 6 | #SBATCH --constraint=CPU-Gold-6130 7 | #SBATCH --time=1:00:00 8 | #SBATCH --nodes=1 9 | #SBATCH --requeue 10 | #SBATCH --ntasks-per-node=32 11 | #SBATCH --cpus-per-task=1 12 | #SBATCH --mem=128000 13 | #SBATCH --mail-user=bsmith24@buffalo.edu 14 | 15 | # Uncomment this part for use in CCR, 16 | # for now we want to test it as a simple shell script for one job 17 | 18 | # echo "SLURM_JOBID="$SLURM_JOBID 19 | # echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 20 | # echo "SLURM_NNODES="$SLURM_NNODES 21 | # echo "SLURMTMPDIR="$SLURMTMPDIR 22 | # echo "working directory="$SLURM_SUBMIT_DIR 23 | # 24 | # module load cuda/6.5 25 | # module load vmd/v1.9 26 | # module load openmpi/3.0.3/gcc-7.3.0 27 | # export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 28 | # 29 | # if [ -n "$SLURM_CPUS_PER_TASK" ]; then 30 | # omp_threads=$SLURM_CPUS_PER_TASK 31 | # else 32 | # omp_threads=1 33 | # fi 34 | # export OMP_NUM_THREADS=$omp_threads 35 | 36 | 37 | nprocs=25 38 | 39 | cp2k_exe=cp2k.psmp 40 | gaussian_exe=g16 41 | dftb_exe=/util/academic/dftbplus/19.1-arpack/bin/dftb+ 42 | 43 | path=/full/path/to/step2 44 | res=$path/res 45 | MO_images_directory=$path/MO_images_directory 46 | 47 | # Just in case you want to plot the MO images with VMD 48 | path_to_tcl_file=$path/cube.tcl 49 | 50 | min_band=132 51 | max_band=141 52 | ks_orbital_homo_index=136 53 | states_to_be_plotted=0 54 | 55 | job_init_step= 56 | nsteps_this_job= 57 | njob= 58 | 59 | 60 | python -c "from libra_py.workflows.nbra import step2_many_body 61 | params = { } 62 | 63 | params[\"es_software\"]=\"cp2k\" 64 | params[\"es_software_input_template\"]=\"cp2k_input_template.inp\" 65 | params[\"es_software_exe\"]=\"$cp2k_exe\" 66 | 67 | params[\"nprocs\"]=\"$nprocs\" 68 | params[\"project_name\"]=\"cspbi3_cubic\" 69 | params[\"trajectory_xyz_filename\"]=\"cspbi3_cubic.xyz\" 70 | params[\"logfile_directory\"]=\"logfiles\" 71 | #params[\"number_of_states\"]=5 72 | #params[\"tolerance\"]=0.0 73 | params[\"isUKS\"]=0 74 | params[\"min_band\"]=int(\"$min_band\") 75 | params[\"max_band\"]=\"$max_band\" 76 | params[\"ks_orbital_homo_index\"]=\"$ks_orbital_homo_index\" 77 | params[\"istep\"]=\"$job_init_step\" 78 | params[\"nsteps_this_job\"]=\"$nsteps_this_job\" 79 | params[\"njob\"]=\"$njob\" 80 | params[\"res_dir\"]=\"$res\" 81 | #params[\"dt\"]=41.341374575751 82 | 83 | params[\"completion_level\"]=0 84 | 85 | #params[\"do_phase_corrections\"]=1 86 | #params[\"perform_state_reordering\"]=1 87 | #params[\"do_state_reordering\"]=2 88 | #params[\"state_reordering_alpha\"]=0.0 89 | 90 | params[\"do_cube_visualization\"]=0 91 | params[\"path_to_tcl_file\"] = \"$path_to_tcl_file\" 92 | params[\"states_to_be_plotted\"]=\"$states_to_be_plotted\" 93 | params[\"MO_images_directory\"] = \"$MO_images_directory\" 94 | 95 | print( params ) 96 | 97 | step2_many_body.run_step2_many_body( params ) 98 | " 99 | 100 | -------------------------------------------------------------------------------- /9_nacs/1_c3n4/cp2k_input_template.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PROJECT C3N4-QD 3 | RUN_TYPE ENERGY 4 | PRINT_LEVEL MEDIUM 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD Quickstep 8 | 9 | &PROPERTIES 10 | &TDDFPT 11 | NSTATES 5 # number of excited states 12 | MAX_ITER 200 # maximum number of Davidson iterations 13 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 14 | &MGRID 15 | CUTOFF 300 # separate cutoff for TDDFPT calc 16 | &END 17 | 18 | RESTART .FALSE. 19 | WFN_RESTART_FILE_NAME RESTART.tdwfn 20 | 21 | &END TDDFPT 22 | &END PROPERTIES 23 | 24 | &PRINT 25 | &FORCES 26 | &END 27 | &TOTAL_NUMBERS ON 28 | &END TOTAL_NUMBERS 29 | &END PRINT 30 | 31 | &DFT 32 | 33 | &POISSON 34 | PERIODIC XYZ 35 | POISSON_SOLVER PERIODIC 36 | &END POISSON 37 | 38 | &PRINT 39 | &PDOS SILENT 40 | COMPONENTS T 41 | NLUMO -1 42 | &END PDOS 43 | &MO_CUBES 44 | NLUMO -1 45 | NHOMO 20 46 | WRITE_CUBE .TRUE. 47 | STRIDE 2 2 2 48 | &END 49 | &END PRINT 50 | 51 | BASIS_SET_FILE_NAME BASIS_MOLOPT 52 | POTENTIAL_FILE_NAME POTENTIAL 53 | WFN_RESTART_FILE_NAME RESTART.wfn 54 | 55 | &MGRID 56 | CUTOFF 300 57 | REL_CUTOFF 60 58 | &END MGRID 59 | 60 | &QS 61 | EPS_DEFAULT 1.0E-16 62 | &END QS 63 | 64 | &SCF 65 | SCF_GUESS RESTART 66 | EPS_SCF 1.0E-6 67 | MAX_SCF 300 68 | 69 | ADDED_MOS 40 70 | &DIAGONALIZATION 71 | ALGORITHM STANDARD 72 | &END DIAGONALIZATION 73 | &MIXING 74 | METHOD BROYDEN_MIXING 75 | ALPHA 0.5 76 | BETA 0.5 77 | NBROYDEN 8 78 | &END MIXING 79 | &END SCF 80 | 81 | &XC 82 | &XC_FUNCTIONAL PBE 83 | &END XC_FUNCTIONAL 84 | &END XC 85 | 86 | &END DFT 87 | 88 | &SUBSYS 89 | 90 | &KIND C 91 | ELEMENT C 92 | BASIS_SET ORB DZVP-MOLOPT-GTH 93 | POTENTIAL GTH-PBE-q4 94 | &END KIND 95 | &KIND H 96 | ELEMENT H 97 | BASIS_SET ORB DZVP-MOLOPT-GTH 98 | POTENTIAL GTH-PBE-q1 99 | &END KIND 100 | &KIND N 101 | BASIS_SET DZVP-MOLOPT-GTH 102 | POTENTIAL GTH-PBE-q5 103 | &END KIND 104 | 105 | &CELL 106 | ABC 35.0 35.0 35.0 107 | PERIODIC NONE 108 | &END CELL 109 | &TOPOLOGY 110 | COORD_FILE_NAME coord.xyz 111 | COORD_FILE_FORMAT XYZ 112 | &END 113 | &END SUBSYS 114 | &END FORCE_EVAL 115 | 116 | -------------------------------------------------------------------------------- /9_nacs/1_c3n4/output.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/9_nacs/1_c3n4/output.tar.bz2 -------------------------------------------------------------------------------- /9_nacs/1_c3n4/run.py: -------------------------------------------------------------------------------- 1 | ## This is inplace of the notebook for now -- to be converted to a notebook later 2 | 3 | from liblibra_core import * 4 | 5 | import multiprocessing as mp 6 | import numpy as np 7 | import math 8 | import sys 9 | import os 10 | 11 | 12 | from libra_py import CP2K_methods 13 | from libra_py import Gaussian_methods 14 | from libra_py import DFTB_methods 15 | from libra_py.workflows.nbra import step2_many_body 16 | 17 | ########################### creating directories ############################### 18 | 19 | os.system("rm -r wd") 20 | os.mkdir('wd') 21 | os.system("rm -r res") 22 | os.mkdir('res') 23 | 24 | ######################### creating and submitting jobs ######################### 25 | trajectory_xyz_file = "C3N4-QD-pos-1.xyz" 26 | 27 | # CP2K 28 | es_software_input_template = "cp2k_input_template.inp" 29 | es_software = "cp2k" 30 | 31 | # Gaussian 32 | #es_software_input_template = "gaussian_input_template.gjf" 33 | #es_software = "gaussian" 34 | 35 | # dftb+ 36 | #es_software_input_template = "dftb_input_template.hsd" 37 | #waveplot_input_template = "waveplot_in.hsd" 38 | #es_software = "dftb+" 39 | 40 | istep = 1 41 | fstep = 15 42 | njobs = 3 43 | 44 | for njob in range( njobs ): 45 | 46 | job_init_step, job_final_step = step2_many_body.curr_and_final_step_job( istep, fstep, njobs, njob ) 47 | nsteps_this_job = job_final_step - job_init_step + 1 48 | 49 | print( '\n1- We are before creating job ', njob, ' in directory:', os.getcwd() ) 50 | # Here we create the jobs through auxiliary_functions.cp2k_distribute 51 | if es_software.lower() == "cp2k": 52 | CP2K_methods.cp2k_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, njob ) 53 | 54 | elif es_software.lower() == "gaussian": 55 | Gaussian_methods.gaussian_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, njob ) 56 | 57 | elif es_software.lower() == "dftb+": 58 | DFTB_methods.dftb_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, waveplot_input_template, njob ) 59 | 60 | #sys.exit(0) 61 | 62 | print('2- Finished distributing for job ',njob,'\nNow we are in directory', os.getcwd()) 63 | os.chdir("wd/job"+str(njob)+"/") 64 | 65 | print('3- Now we have changed directory to :', os.getcwd(),'To submit job', njob) 66 | os.mkdir("cubefiles") 67 | os.mkdir("logfiles") 68 | 69 | print("4- The initial step for the job ", njob, " is: ", job_init_step, 'with final step: ', job_final_step) 70 | print("5- nsteps_this_job is: ", nsteps_this_job) 71 | St_ks_job = [] 72 | S_ks_job = [] 73 | debug = [] 74 | 75 | ############################ 76 | os.system("cp ../../submit_template.slm submit_"+str(njob)+".slm") 77 | # Now, open the submit_template file in this job folder 78 | # Add the values to the params for this job 79 | f = open( "submit_"+str(njob)+".slm" ) 80 | submit_template_file = f.readlines() 81 | submit_template_file_size = len( submit_template_file ) 82 | f.close() 83 | 84 | f = open( "submit_"+str(njob)+".slm" , 'w' ); f.close() 85 | for i in range( submit_template_file_size ): 86 | 87 | f = open( "submit_"+str(njob)+".slm" , 'a' ) 88 | 89 | submit_template_file_line = submit_template_file[i].split() 90 | if not submit_template_file_line: 91 | continue 92 | 93 | elif submit_template_file_line[0] == "job_init_step=": 94 | f.write( "declare -i job_init_step=%i" % (job_init_step) ) 95 | f.write("\n") 96 | 97 | elif submit_template_file_line[0] == "nsteps_this_job=": 98 | f.write( "declare -i nsteps_this_job=%i" % (nsteps_this_job) ) 99 | f.write("\n") 100 | 101 | elif submit_template_file_line[0] == "njob=": 102 | f.write( "declare -i njob=%i" % (njob) ) 103 | f.write("\n") 104 | 105 | else: 106 | f.write( submit_template_file[i] ) 107 | 108 | os.system("sbatch submit_"+str(njob)+".slm") 109 | #os.system("sh submit_"+str(njob)+".slm") 110 | 111 | print("6- Now submitting the job in folder: ", os.getcwd()) 112 | 113 | # Change directory to the main directory 114 | os.chdir("../../") 115 | print("7- Finished submitting job, now we are back in directory:", os.getcwd(),'\n\n\n') 116 | 117 | print("\nDone!\n") 118 | 119 | 120 | -------------------------------------------------------------------------------- /9_nacs/1_c3n4/submit_template.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ###SBATCH --partition=scavenger --qos=scavenger 3 | ###SBATCH --clusters=faculty 4 | ###SBATCH --partition=debug --qos=debug 5 | #SBATCH --partition=valhalla --qos=valhalla 6 | #SBATCH --clusters=faculty 7 | #SBATCH --time=10:00:00 8 | #SBATCH --nodes=1 9 | #SBATCH --requeue 10 | #SBATCH --ntasks-per-node=9 11 | #SBATCH --cpus-per-task=1 12 | #SBATCH --mem=78000 13 | ###SBATCH --mail-user=alexeyak@buffalo.edu 14 | echo "SLURM_JOBID="$SLURM_JOBID 15 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 16 | echo "SLURM_NNODES="$SLURM_NNODES 17 | echo "SLURMTMPDIR="$SLURMTMPDIR 18 | echo "working directory="$SLURM_SUBMIT_DIR 19 | 20 | 21 | module load cuda/6.5 22 | module load vmd/v1.9 23 | module load cp2k 24 | 25 | #module load openmpi/3.0.3/gcc-7.3.0 26 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 27 | 28 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 29 | omp_threads=$SLURM_CPUS_PER_TASK 30 | else 31 | omp_threads=1 32 | fi 33 | export OMP_NUM_THREADS=$omp_threads 34 | 35 | nprocs=9 36 | 37 | cp2k_exe=cp2k.popt #/panasas/scratch/grp-alexeyak/brendan/cp2k_install/cp2k-7.1/exe/local/cp2k.popt 38 | gaussian_exe=g16 39 | dftb_exe=/util/academic/dftbplus/20.2.1-arpack/bin/dftb+ 40 | 41 | #path=/panasas/scratch/grp-alexeyak/brendan/Tutorials_CP2K/step2 42 | path=/projects/academic/cyberwksp21/Instructors_material/alexeyak/cp2k/5_nacs/1_c3n4 43 | res=$path/res 44 | MO_images_directory=$path/MO_images_directory 45 | path_to_tcl_file=$path/cube.tcl 46 | 47 | min_band=100 48 | max_band=118 49 | ks_orbital_homo_index=108 50 | states_to_be_plotted=0 51 | 52 | job_init_step= 53 | nsteps_this_job= 54 | njob= 55 | 56 | 57 | python -c "from libra_py.workflows.nbra import step2_many_body 58 | params = { } 59 | 60 | params[\"es_software\"]=\"cp2k\" 61 | params[\"es_software_input_template\"]=\"cp2k_input_template.inp\" 62 | params[\"es_software_exe\"]=\"$cp2k_exe\" 63 | params[\"waveplot_exe\"]=\"/util/academic/dftbplus/20.2.1-arpack/bin/waveplot\" 64 | 65 | params[\"nprocs\"]=\"$nprocs\" 66 | params[\"project_name\"]=\"C3N4-QD\" 67 | params[\"trajectory_xyz_filename\"]=\"C3N4-QD-pos-1.xyz\" 68 | params[\"logfile_directory\"]=\"logfiles\" 69 | params[\"number_of_states\"]=5 70 | params[\"tolerance\"]=0.0 71 | params[\"isUKS\"]=0 72 | params[\"min_band\"]=int(\"$min_band\") 73 | params[\"max_band\"]=\"$max_band\" 74 | params[\"ks_orbital_homo_index\"]=\"$ks_orbital_homo_index\" 75 | params[\"istep\"]=\"$job_init_step\" 76 | params[\"nsteps_this_job\"]=\"$nsteps_this_job\" 77 | params[\"njob\"]=\"$njob\" 78 | params[\"res_dir\"]=\"$res\" 79 | params[\"dt\"]=41.341374575751 80 | 81 | params[\"completion_level\"]=0 82 | 83 | params[\"do_phase_corrections\"]=0 84 | params[\"perform_state_reordering\"]=0 85 | params[\"do_state_reordering\"]=0 86 | params[\"state_reordering_alpha\"]=0.0 87 | 88 | params[\"do_cube_visualization\"]=0 89 | params[\"path_to_tcl_file\"] = \"$path_to_tcl_file\" 90 | params[\"states_to_be_plotted\"]=\"$states_to_be_plotted\" 91 | params[\"MO_images_directory\"] = \"$MO_images_directory\" 92 | 93 | print( params ) 94 | 95 | step2_many_body.run_step2_many_body( params ) 96 | " 97 | 98 | -------------------------------------------------------------------------------- /9_nacs/2_adamantane/check_step2_progress.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | def check(prefix,suffix,mini,maxi): 4 | # The function creates the continuity regions of existing files 5 | # prefix - prefix of the file to be found 6 | # suffix - suffix of the file to be found 7 | # mini - minimal index of the file to be found 8 | # maxi - maximal index of the file to be found 9 | 10 | 11 | res = [] 12 | lst = [] 13 | stop = 0 14 | i = mini 15 | while i<=maxi: 16 | file_path = prefix + str(i) + suffix 17 | if os.path.exists(file_path): 18 | lst.append(i) 19 | else: 20 | if len(lst)>0: 21 | res.append(lst) 22 | lst = [] 23 | 24 | i = i + 1 25 | 26 | 27 | for lst in res: 28 | print( "range("+str(lst[0])+","+str(lst[-1]+1)+") nelts = "+str(lst[-1]+1-lst[0]) ) 29 | 30 | # Edit parameters of the function called below 31 | # argument #1 - prefix of the file to be found 32 | # argument #2 - suffix of the file to be found 33 | # argument #3 - minimal index of the file to be found 34 | # argument #4 - maximal index of the file to be found 35 | print ("\n") 36 | check(os.getcwd()+"/res/S_ks_","_re",0,5000) 37 | print ("\nFinished Checking\n") 38 | -------------------------------------------------------------------------------- /9_nacs/2_adamantane/clean.sh: -------------------------------------------------------------------------------- 1 | rm -rf sl* 2 | rm -rf _* 3 | rm -rf wd 4 | rm -rf res 5 | rm -rf MO* 6 | -------------------------------------------------------------------------------- /9_nacs/2_adamantane/cp2k_input_template.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PROJECT c10h16 3 | RUN_TYPE ENERGY 4 | PRINT_LEVEL MEDIUM 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD Quickstep 8 | 9 | &PROPERTIES 10 | &TDDFPT 11 | NSTATES 10 # number of excited states 12 | MAX_ITER 200 # maximum number of Davidson iterations 13 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 14 | &MGRID 15 | CUTOFF 400 # separate cutoff for TDDFPT calc 16 | &END 17 | 18 | RESTART .FALSE. 19 | WFN_RESTART_FILE_NAME RESTART.tdwfn 20 | 21 | &END TDDFPT 22 | &END PROPERTIES 23 | 24 | &PRINT 25 | &FORCES 26 | &END 27 | &TOTAL_NUMBERS ON 28 | &END TOTAL_NUMBERS 29 | &END PRINT 30 | 31 | &DFT 32 | 33 | &POISSON 34 | PERIODIC none 35 | POISSON_SOLVER wavelet 36 | &END POISSON 37 | 38 | &PRINT 39 | &PDOS SILENT 40 | COMPONENTS T 41 | NLUMO -1 42 | &END PDOS 43 | &MO_CUBES 44 | NLUMO -1 45 | NHOMO 20 46 | WRITE_CUBE .TRUE. 47 | STRIDE 2 2 2 48 | &END 49 | &END PRINT 50 | 51 | BASIS_SET_FILE_NAME BASIS_MOLOPT 52 | POTENTIAL_FILE_NAME POTENTIAL 53 | WFN_RESTART_FILE_NAME RESTART.wfn 54 | 55 | &MGRID 56 | CUTOFF 400 57 | REL_CUTOFF 60 58 | &END MGRID 59 | 60 | &QS 61 | EPS_DEFAULT 1.0E-16 62 | &END QS 63 | 64 | &SCF 65 | SCF_GUESS RESTART 66 | EPS_SCF 1.0E-6 67 | MAX_SCF 300 68 | 69 | ADDED_MOS 20 70 | &DIAGONALIZATION 71 | ALGORITHM STANDARD 72 | &END DIAGONALIZATION 73 | &MIXING 74 | METHOD BROYDEN_MIXING 75 | ALPHA 0.5 76 | BETA 0.5 77 | NBROYDEN 8 78 | &END MIXING 79 | &END SCF 80 | 81 | &XC 82 | &XC_FUNCTIONAL PBE 83 | &END XC_FUNCTIONAL 84 | &END XC 85 | 86 | &END DFT 87 | 88 | &SUBSYS 89 | 90 | &KIND C 91 | ELEMENT C 92 | BASIS_SET ORB DZVP-MOLOPT-GTH 93 | POTENTIAL GTH-PBE-q4 94 | &END KIND 95 | &KIND H 96 | ELEMENT H 97 | BASIS_SET ORB DZVP-MOLOPT-GTH 98 | POTENTIAL GTH-PBE-q1 99 | &END KIND 100 | 101 | &CELL 102 | PERIODIC NONE 103 | A 15.0 0.00 0.00 104 | B 0.00 15.0 0.00 105 | C 0.00 0.00 15.0 106 | &END CELL 107 | &TOPOLOGY 108 | COORD_FILE_NAME coord.xyz 109 | COORD_FILE_FORMAT XYZ 110 | &END 111 | &END SUBSYS 112 | &END FORCE_EVAL 113 | 114 | -------------------------------------------------------------------------------- /9_nacs/2_adamantane/output.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/9_nacs/2_adamantane/output.tar.bz2 -------------------------------------------------------------------------------- /9_nacs/2_adamantane/run.py: -------------------------------------------------------------------------------- 1 | ## This is inplace of the notebook for now -- to be converted to a notebook later 2 | 3 | from liblibra_core import * 4 | 5 | import multiprocessing as mp 6 | import numpy as np 7 | import math 8 | import sys 9 | import os 10 | 11 | 12 | from libra_py import CP2K_methods 13 | from libra_py import Gaussian_methods 14 | from libra_py import DFTB_methods 15 | from libra_py.workflows.nbra import step2_many_body 16 | 17 | ########################### creating directories ############################### 18 | 19 | os.system("rm -r wd") 20 | os.mkdir('wd') 21 | os.system("rm -r res") 22 | os.mkdir('res') 23 | 24 | ######################### creating and submitting jobs ######################### 25 | trajectory_xyz_file = "c10h16-pos-1.xyz" 26 | 27 | # CP2K 28 | es_software_input_template = "cp2k_input_template.inp" 29 | es_software = "cp2k" 30 | 31 | # Gaussian 32 | #es_software_input_template = "gaussian_input_template.gjf" 33 | #es_software = "gaussian" 34 | 35 | # dftb+ 36 | #es_software_input_template = "dftb_input_template.hsd" 37 | #waveplot_input_template = "waveplot_in.hsd" 38 | #es_software = "dftb+" 39 | 40 | istep = 150 41 | fstep = 200 42 | njobs = 10 43 | 44 | for njob in range( njobs ): 45 | 46 | job_init_step, job_final_step = step2_many_body.curr_and_final_step_job( istep, fstep, njobs, njob ) 47 | nsteps_this_job = job_final_step - job_init_step + 1 48 | 49 | print( '\n1- We are before creating job ', njob, ' in directory:', os.getcwd() ) 50 | # Here we create the jobs through auxiliary_functions.cp2k_distribute 51 | if es_software.lower() == "cp2k": 52 | CP2K_methods.cp2k_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, njob ) 53 | 54 | elif es_software.lower() == "gaussian": 55 | Gaussian_methods.gaussian_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, njob ) 56 | 57 | elif es_software.lower() == "dftb+": 58 | DFTB_methods.dftb_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, waveplot_input_template, njob ) 59 | 60 | #sys.exit(0) 61 | 62 | print('2- Finished distributing for job ',njob,'\nNow we are in directory', os.getcwd()) 63 | os.chdir("wd/job"+str(njob)+"/") 64 | 65 | print('3- Now we have changed directory to :', os.getcwd(),'To submit job', njob) 66 | os.mkdir("cubefiles") 67 | os.mkdir("logfiles") 68 | 69 | print("4- The initial step for the job ", njob, " is: ", job_init_step, 'with final step: ', job_final_step) 70 | print("5- nsteps_this_job is: ", nsteps_this_job) 71 | St_ks_job = [] 72 | S_ks_job = [] 73 | debug = [] 74 | 75 | ############################ 76 | os.system("cp ../../submit_template.slm submit_"+str(njob)+".slm") 77 | # Now, open the submit_template file in this job folder 78 | # Add the values to the params for this job 79 | f = open( "submit_"+str(njob)+".slm" ) 80 | submit_template_file = f.readlines() 81 | submit_template_file_size = len( submit_template_file ) 82 | f.close() 83 | 84 | f = open( "submit_"+str(njob)+".slm" , 'w' ); f.close() 85 | for i in range( submit_template_file_size ): 86 | 87 | f = open( "submit_"+str(njob)+".slm" , 'a' ) 88 | 89 | submit_template_file_line = submit_template_file[i].split() 90 | if not submit_template_file_line: 91 | continue 92 | 93 | elif submit_template_file_line[0] == "job_init_step=": 94 | f.write( "declare -i job_init_step=%i" % (job_init_step) ) 95 | f.write("\n") 96 | 97 | elif submit_template_file_line[0] == "nsteps_this_job=": 98 | f.write( "declare -i nsteps_this_job=%i" % (nsteps_this_job) ) 99 | f.write("\n") 100 | 101 | elif submit_template_file_line[0] == "njob=": 102 | f.write( "declare -i njob=%i" % (njob) ) 103 | f.write("\n") 104 | 105 | else: 106 | f.write( submit_template_file[i] ) 107 | 108 | os.system("sbatch submit_"+str(njob)+".slm") 109 | #os.system("sh submit_"+str(njob)+".slm") 110 | 111 | print("6- Now submitting the job in folder: ", os.getcwd()) 112 | 113 | # Change directory to the main directory 114 | os.chdir("../../") 115 | print("7- Finished submitting job, now we are back in directory:", os.getcwd(),'\n\n\n') 116 | 117 | print("\nDone!\n") 118 | 119 | 120 | -------------------------------------------------------------------------------- /9_nacs/2_adamantane/submit_template.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ###SBATCH --partition=scavenger --qos=scavenger 3 | ###SBATCH --clusters=faculty 4 | ###SBATCH --partition=debug --qos=debug 5 | #SBATCH --partition=valhalla --qos=valhalla 6 | #SBATCH --clusters=faculty 7 | #SBATCH --time=01:00:00 8 | #SBATCH --nodes=1 9 | #SBATCH --requeue 10 | #SBATCH --ntasks-per-node=9 11 | #SBATCH --cpus-per-task=1 12 | #SBATCH --mem=28000 13 | ###SBATCH --mail-user=alexeyak@buffalo.edu 14 | echo "SLURM_JOBID="$SLURM_JOBID 15 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 16 | echo "SLURM_NNODES="$SLURM_NNODES 17 | echo "SLURMTMPDIR="$SLURMTMPDIR 18 | echo "working directory="$SLURM_SUBMIT_DIR 19 | 20 | 21 | module load cuda/6.5 22 | module load vmd/v1.9 23 | module load cp2k 24 | 25 | #module load openmpi/3.0.3/gcc-7.3.0 26 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 27 | 28 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 29 | omp_threads=$SLURM_CPUS_PER_TASK 30 | else 31 | omp_threads=1 32 | fi 33 | export OMP_NUM_THREADS=$omp_threads 34 | 35 | nprocs=9 36 | 37 | cp2k_exe=cp2k.popt #/panasas/scratch/grp-alexeyak/brendan/cp2k_install/cp2k-7.1/exe/local/cp2k.popt 38 | gaussian_exe=g16 39 | dftb_exe=/util/academic/dftbplus/19.1-arpack/bin/dftb+ 40 | 41 | #path=/panasas/scratch/grp-alexeyak/brendan/Tutorials_CP2K/step2 42 | path=/projects/academic/cyberwksp21/Instructors_material/alexeyak/cp2k/5_nacs/2_adamantane 43 | res=$path/res 44 | MO_images_directory=$path/MO_images_directory 45 | path_to_tcl_file=$path/cube.tcl 46 | 47 | min_band=10 48 | max_band=40 49 | ks_orbital_homo_index=28 50 | states_to_be_plotted=0 51 | 52 | job_init_step= 53 | nsteps_this_job= 54 | njob= 55 | 56 | 57 | python -c "from libra_py.workflows.nbra import step2_many_body 58 | params = { } 59 | 60 | params[\"es_software\"]=\"cp2k\" 61 | params[\"es_software_input_template\"]=\"cp2k_input_template.inp\" 62 | params[\"es_software_exe\"]=\"$cp2k_exe\" 63 | 64 | params[\"nprocs\"]=\"$nprocs\" 65 | params[\"project_name\"]=\"c10h16\" 66 | params[\"trajectory_xyz_filename\"]=\"c10h16-pos-1.xyz\" 67 | params[\"logfile_directory\"]=\"logfiles\" 68 | params[\"number_of_states\"]=10 69 | params[\"tolerance\"]=0.0 70 | params[\"isUKS\"]=0 71 | params[\"min_band\"]=int(\"$min_band\") 72 | params[\"max_band\"]=\"$max_band\" 73 | params[\"ks_orbital_homo_index\"]=\"$ks_orbital_homo_index\" 74 | params[\"istep\"]=\"$job_init_step\" 75 | params[\"nsteps_this_job\"]=\"$nsteps_this_job\" 76 | params[\"njob\"]=\"$njob\" 77 | params[\"res_dir\"]=\"$res\" 78 | params[\"dt\"]=41.341374575751 79 | 80 | params[\"completion_level\"]=0 81 | 82 | params[\"do_phase_corrections\"]=1 83 | params[\"perform_state_reordering\"]=0 84 | params[\"do_state_reordering\"]=2 85 | params[\"state_reordering_alpha\"]=0.0 86 | 87 | params[\"do_cube_visualization\"]=0 88 | params[\"path_to_tcl_file\"] = \"$path_to_tcl_file\" 89 | params[\"states_to_be_plotted\"]=\"$states_to_be_plotted\" 90 | params[\"MO_images_directory\"] = \"$MO_images_directory\" 91 | 92 | print( params ) 93 | 94 | step2_many_body.run_step2_many_body( params ) 95 | " 96 | 97 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CP2K tutorials for electronic structure calculations 2 | 3 | This repository contains input examples for calculations associated with CP2k package, including 4 | the NonAdiabatic Molecular Dynamics (NA-MD) calculations via CP2K/Libra interface. 5 | 6 | 7 | ## 1. General instructions 8 | 9 | This repository summarizes inputs for different types of electronic structure calculations. 10 | The same files are also available in other places as well 11 | ([project_cp2k_libra](https://github.com/AkimovLab/Project_Libra_CP2K), 12 | [project_perovskite_crystal_symmetry](https://github.com/AkimovLab/Project_CsPbI3_MB_vs_SP)) for use in 13 | nonadiabatic dynamics. However, here we provide detailed instructions on how to use CP2K and how the 14 | functionality and timings change with different inputs. 15 | 16 | Here we use CP2K v6.1 compiled with Intel parallel studio 2019. For TD-DFT with hybrid functionals, 17 | we will use CP2K v7.1 which is compiled with GCC-8.3 compiler. This is because 18 | in lower versions of CP2K the TD-DFT calculation does not converge for hybrid functional due to 19 | a [problem](https://groups.google.com/g/cp2k/c/SEglKzKlVLQ/m/MyTavEqYBQAJ) with 20 | converging ADMM calculations. It is also worth noting that the computed results are done using Intel(R) Xeon(R) E5-2699 v4 @ 2.20GHz CPUs. 21 | 22 | For CP2K installation we recommend the use of `./install_too_chain.sh` in the `tools/toolchain` folder of CP2K. 23 | For compilation with Intel parallel studio you can use 24 | the instructions given in [XConfigure website](https://xconfigure.readthedocs.io/en/latest/cp2k/). 25 | 26 | 27 | Here, we use a 2D perovskite of (BA)2PbI4 as a test and which its [cif](http://crystallography.net/cod/2102937.cif) 28 | file is available from the [crystallography website](http://crystallography.net/). We will use the unit 29 | cell with 156 atoms and a 2x2x2 supercell with 1248 atoms and check the performance of CP2K calculations functionality. 30 | 31 | 32 | ## 2. Types of calculations 33 | 34 | * geometry preparation 35 | * energy (single-point) calculations 36 | * convergence with respect to basis set parameters 37 | * geometry and cell optimization 38 | * single-point calculations at the TD-DFT level 39 | * single-point calculations with hybrid density functionals 40 | * single-point calculations of huge systems 41 | * molecular dynamics 42 | * time-overlap calculations using cube files 43 | * nonadiabatic coupling calculations 44 | 45 | The `legacy` folder contains a number of recent tutorials by Mohammad Shakiba and Brendan Smith, but 46 | they are yet to be organized and revised. These tutorials contain detailed and very useful instructions 47 | which will eventually be migrated to the main folder here. 48 | 49 | 50 | 51 | * [3. Extra resources] 52 | 53 | Here, we provide links to the repositories with the codes used in the following publications: 54 | 55 | * [Nonadiabatic Dynamics in Si and CdSe Nanoclusters: Many-Body vs Single-Particle Treatment of Excited States](https://pubs.acs.org/doi/10.1021/acs.jctc.0c01009), [Technical details](https://github.com/AkimovLab/Project_Libra_CP2K) 56 | 57 | * [Crystal Symmetry and Static Electron Correlation Greatly Accelerate Nonradiative Dynamics in Lead Halide Perovskites](https://pubs.acs.org/doi/abs/10.1021/acs.jpclett.0c03799), [Technical details](https://github.com/AkimovLab/Project_CsPbI3_MB_vs_SP) 58 | 59 | 60 | We highly welcome improving the functionality of the input files in this repository. 61 | So, please feel free to share your inputs and timings with us if you used these inputs. 62 | 63 | ## 3. CP2K Installation 64 | 65 | The instructions on how the CP2K is compiled with Intel Parallel Studio can be found in [this link](https://github.com/compchem-cybertraining/Tutorials_CP2K/blob/master/INSTALLATION.md). 66 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/compute_dynamical_properties/clean.sh: -------------------------------------------------------------------------------- 1 | rm MB* 2 | rm SP* 3 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/excitation_analysis/clean.sh: -------------------------------------------------------------------------------- 1 | rm *Ad* 2 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/excitation_analysis/cp2k_all_logfiles: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/legacy/cp2k_libra_workflow/excitation_analysis/cp2k_all_logfiles -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/excitation_analysis/excitation_analysis.py: -------------------------------------------------------------------------------- 1 | from libra_py import data_stat 2 | from libra_py import CP2K_methods 3 | from libra_py.workflows.nbra import step2_many_body 4 | import os 5 | import sys 6 | import multiprocessing as mp 7 | import numpy as np 8 | import glob 9 | import matplotlib.pyplot as plt 10 | import matplotlib.colors 11 | import math 12 | import time 13 | 14 | 15 | 16 | 17 | ############################################################### 18 | """ 19 | 1. Number of states, tolerance, curr_step 20 | """ 21 | params = { } 22 | params["number_of_states"] = 10 23 | params["tolerance"] = 0.0 24 | thermal = False #True 25 | 26 | 27 | 28 | 29 | 30 | 31 | ############################################################### 32 | """ 33 | 2. Extract CI-like coefficients 34 | """ 35 | 36 | if thermal == True: 37 | logfiles = glob.glob('all_logfiles/*.log') 38 | 39 | elif thermal == False: 40 | logfiles = glob.glob('../tddft/*.log') 41 | 42 | ci_coeffs = [] 43 | for logfile in logfiles: 44 | params.update({"logfile_name": logfile}) 45 | excitation_energies, ci_basis_raw, ci_coefficients_raw_unnorm, spin_components = CP2K_methods.read_cp2k_tddfpt_log_file( params ) 46 | ci_coefficients_raw_norm = step2_many_body.normalize_ci_coefficients(ci_coefficients_raw_unnorm) 47 | for j in range(len(ci_coefficients_raw_norm)): 48 | for k in range(len(ci_coefficients_raw_norm[j])): 49 | ci_coefficients_raw_norm[j][k] = ci_coefficients_raw_norm[j][k]**2 50 | ci_coeffs.append(ci_coefficients_raw_norm) 51 | 52 | 53 | 54 | 55 | 56 | 57 | ############################################################### 58 | """ 59 | 3. Post process the Ci-like coefficients, plot 60 | """ 61 | 62 | nsteps = len(ci_coeffs) 63 | nstates = params["number_of_states"] 64 | nsds = 5 65 | coeffs = [] 66 | coeffs_avg = [] 67 | coeffs_error = [] 68 | 69 | plt.figure(num=None, figsize=(3.21, 2.41), dpi=300, edgecolor='black', frameon=True) 70 | plt.subplot(1,1,1) 71 | 72 | 73 | if thermal == True: 74 | plt.title("Adamantane, 300 K", fontsize=10) 75 | else: 76 | plt.title("Adamantane, 0 K", fontsize=10) 77 | 78 | 79 | plt.ylim(0,1) 80 | plt.xlabel('State Index', fontsize=10) 81 | plt.ylabel('< c$_{i}^2$ >', fontsize=10) 82 | plt.xticks([0,2,4,6,8,10]) 83 | 84 | for state in range(nstates): 85 | 86 | coeffs.append( [] ) 87 | coeffs_avg.append( [] ) 88 | coeffs_error.append( [] ) 89 | 90 | for sd in range( nsds ): 91 | 92 | coeffs[state].append( [] ) 93 | coeffs_avg[state].append( [] ) 94 | coeffs_error[state].append( [] ) 95 | 96 | for step in range( nsteps ): 97 | if len( ci_coeffs[step][state] ) < nsds and sd > len( ci_coeffs[step][state] )-1: 98 | coeffs[state][sd].append( 0.0 ) 99 | else: 100 | coeffs[state][sd].append( ci_coeffs[step][state][sd] ) 101 | 102 | mb_coeff_avg, mb_coeff_std = data_stat.scalar_stat( coeffs[state][sd] ) 103 | coeffs_avg[state][sd].append( mb_coeff_avg ) 104 | coeffs_error[state][sd].append( 1.96 * mb_coeff_std / math.sqrt(nsteps) ) 105 | 106 | if sd == 0: 107 | print("std = ", mb_coeff_std) 108 | 109 | if sd == 0: 110 | plt.plot( state+1, mb_coeff_avg, color="black", marker='s', markerfacecolor='green', markeredgewidth=0.4, markersize=5) 111 | plt.errorbar( state+1, mb_coeff_avg, yerr=coeffs_error[state][sd], linestyle="None", color='black') 112 | 113 | elif sd == 1: 114 | plt.plot( state+1, mb_coeff_avg, color="black", marker='s', markerfacecolor='blue', markeredgewidth=0.4, markersize=5) 115 | plt.errorbar( state+1, mb_coeff_avg, yerr=coeffs_error[state][sd], linestyle="None", color='black') 116 | 117 | elif sd == 2: 118 | plt.plot( state+1, mb_coeff_avg, color="black", marker='s', markerfacecolor='red', markeredgewidth=0.4, markersize=5) 119 | plt.errorbar( state+1, mb_coeff_avg, yerr=coeffs_error[state][sd], linestyle="None", color='black') 120 | 121 | elif sd == 3: 122 | plt.plot( state+1, mb_coeff_avg, color="black", marker='s', markerfacecolor='purple', markeredgewidth=0.4, markersize=5) 123 | plt.errorbar( state+1, mb_coeff_avg, yerr=coeffs_error[state][sd], linestyle="None", color='black') 124 | 125 | else: 126 | plt.plot( state+1, mb_coeff_avg, color="black", marker='s', markerfacecolor='cyan', markeredgewidth=0.4, markersize=5) 127 | plt.errorbar( state+1, mb_coeff_avg, yerr=coeffs_error[state][sd], linestyle="None", color='black') 128 | 129 | plt.tight_layout() 130 | if thermal == True: 131 | plt.savefig('Adamantane_300K.png', dpi=300) 132 | else: 133 | plt.savefig('Adamantane_0K.png', dpi=300) 134 | 135 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/md/clean.sh: -------------------------------------------------------------------------------- 1 | rm o* 2 | rm sl* 3 | rm c10* 4 | rm *wfc* 5 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/md/coord.xyz: -------------------------------------------------------------------------------- 1 | 26 2 | XYZ file 3 | C 9.178580 5.928680 6.784230 4 | C 8.288780 6.827330 5.895700 5 | C 9.184490 7.712870 5.000010 6 | C 10.068360 6.815530 4.104270 7 | C 10.956860 5.916830 4.994050 8 | C 9.160840 4.144480 5.000060 9 | C 10.062460 5.030020 5.889820 10 | C 7.388480 5.940480 5.005880 11 | C 8.271070 5.041840 4.110200 12 | C 9.166750 5.928710 3.215770 13 | H 8.541821 5.298140 7.443030 14 | H 9.819710 6.559260 7.438760 15 | H 7.653340 7.473351 6.539620 16 | H 8.552010 8.373790 4.367380 17 | H 9.825700 8.365280 5.632710 18 | H 10.712270 7.453100 3.460340 19 | H 11.619880 6.547200 5.626580 20 | H 11.607130 5.277700 4.357070 21 | H 9.789130 3.483580 4.363250 22 | H 8.523830 3.492070 5.636970 23 | H 10.702130 4.383980 6.529520 24 | H 6.729700 5.310070 5.642790 25 | H 6.733950 6.579590 4.373250 26 | H 7.622920 4.404290 3.470520 27 | H 9.795130 5.289790 2.556990 28 | H 8.534019 6.567690 2.561230 29 | 30 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/md/cp2k_input_template.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PROJECT c10h16 3 | RUN_TYPE MD 4 | PRINT_LEVEL MEDIUM 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD Quickstep 8 | 9 | &PRINT 10 | &FORCES 11 | &END 12 | &TOTAL_NUMBERS ON 13 | &END TOTAL_NUMBERS 14 | &END PRINT 15 | 16 | &DFT 17 | 18 | BASIS_SET_FILE_NAME BASIS_MOLOPT 19 | POTENTIAL_FILE_NAME POTENTIAL 20 | WFN_RESTART_FILE_NAME RESTART.wfn 21 | 22 | &MGRID 23 | CUTOFF 400 24 | REL_CUTOFF 60 25 | &END MGRID 26 | 27 | &QS 28 | EPS_DEFAULT 1.0E-16 29 | &END QS 30 | 31 | &PRINT 32 | ! turn off printing the charges on each atom unless you need it. 33 | ! this will decrease the size of the log file 34 | &MULLIKEN OFF 35 | &END 36 | &HIRSHFELD OFF 37 | &END 38 | ! printing out the pdos for each element and each MD step 39 | ! this will append all the pdos for an element in one file 40 | ! for all the MD steps 41 | &PDOS SILENT 42 | COMPONENTS T 43 | NLUMO -1 44 | APPEND .TRUE. 45 | &EACH 46 | MD 1 47 | &END 48 | &END PDOS 49 | ! This can be useful to print out just the energies of 50 | ! the KS orbitals. You can visualize the evolution of the energy levels 51 | ! by extracting these values using read_energies_from_cp2k_md_log_file function 52 | ! from CP2K_methods.py in libra_py folder. 53 | &MO_CUBES 54 | NLUMO -1 55 | NHOMO -1 56 | WRITE_CUBE .FALSE. 57 | !STRIDE 2 2 2 58 | &END 59 | &END PRINT 60 | 61 | &SCF 62 | SCF_GUESS RESTART 63 | EPS_SCF 1.0E-6 64 | MAX_SCF 300 65 | 66 | ADDED_MOS 20 67 | &DIAGONALIZATION 68 | ALGORITHM STANDARD 69 | &END DIAGONALIZATION 70 | &MIXING 71 | METHOD BROYDEN_MIXING 72 | ALPHA 0.5 73 | BETA 0.5 74 | NBROYDEN 8 75 | &END MIXING 76 | &END SCF 77 | 78 | &XC 79 | &XC_FUNCTIONAL PBE 80 | &END XC_FUNCTIONAL 81 | &END XC 82 | 83 | &END DFT 84 | 85 | &SUBSYS 86 | 87 | &KIND C 88 | ELEMENT C 89 | BASIS_SET ORB DZVP-MOLOPT-GTH 90 | POTENTIAL GTH-PBE-q4 91 | &END KIND 92 | &KIND H 93 | ELEMENT H 94 | BASIS_SET ORB DZVP-MOLOPT-GTH 95 | POTENTIAL GTH-PBE-q1 96 | &END KIND 97 | 98 | &CELL 99 | PERIODIC NONE 100 | A 15.0 0.00 0.00 101 | B 0.00 15.0 0.00 102 | C 0.00 0.00 15.0 103 | &END CELL 104 | &TOPOLOGY 105 | COORD_FILE_NAME coord.xyz 106 | COORD_FILE_FORMAT XYZ 107 | &END 108 | &END SUBSYS 109 | &END FORCE_EVAL 110 | 111 | 112 | &MOTION 113 | &MD 114 | ENSEMBLE NVT 115 | TEMPERATURE [K] 300 116 | TIMESTEP [fs] 1.0 117 | STEPS 1000 118 | COMVEL_TOL 0.0 119 | &THERMOSTAT 120 | REGION GLOBAL 121 | TYPE CSVR 122 | &CSVR 123 | TIMECON 16 124 | &END 125 | &END THERMOSTAT 126 | &END 127 | &PRINT 128 | &TRAJECTORY 129 | &EACH 130 | MD 1 131 | &END EACH 132 | &END TRAJECTORY 133 | &VELOCITIES ON 134 | &END VELOCITIES 135 | &FORCES ON 136 | &END FORCES 137 | &RESTART 138 | BACKUP_COPIES 1 139 | &EACH 140 | MD 1 141 | &END EACH 142 | &END RESTART 143 | &END PRINT 144 | &END 145 | 146 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/md/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=general-compute --qos=general-compute 3 | #SBATCH --clusters=ub-hpc 4 | #SBATCH --constraint=CPU-Gold-6130 5 | 6 | ###SBATCH --partition=valhalla --qos=valhalla 7 | ###SBATCH --clusters=faculty 8 | ###SBATCH --requeue 9 | 10 | #SBATCH --time=1:00:00 11 | #SBATCH --nodes=1 12 | #SBATCH --ntasks-per-node=32 13 | #SBATCH --cpus-per-task=1 14 | #SBATCH --mem=128000 15 | #SBATCH --mail-user=bsmith24@buffalo.edu 16 | echo "SLURM_JOBID="$SLURM_JOBID 17 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 18 | echo "SLURM_NNODES="$SLURM_NNODES 19 | echo "SLURMTMPDIR="$SLURMTMPDIR 20 | echo "working directory="$SLURM_SUBMIT_DIR 21 | 22 | module load openmpi/3.0.3/gcc-7.3.0 23 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 24 | 25 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 26 | omp_threads=$SLURM_CPUS_PER_TASK 27 | else 28 | omp_threads=1 29 | fi 30 | export OMP_NUM_THREADS=$omp_threads 31 | 32 | nprocs=32 33 | cp2k_exe=/panasas/scratch/grp-alexeyak/brendan/cp2k_install/cp2k-7.1/exe/local/cp2k.popt 34 | 35 | mpirun -np $nprocs $cp2k_exe -i cp2k_input_template.inp -o out.log 36 | 37 | 38 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/namd/clean.sh: -------------------------------------------------------------------------------- 1 | rm o 2 | rm sl* 3 | rm -rf fssh 4 | rm -rf ida 5 | rm -rf msdm 6 | rm -rf bllz 7 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/namd/fit/cleah.sh: -------------------------------------------------------------------------------- 1 | rm En* 2 | rm o* 3 | rm sl* 4 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/namd/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=valhalla --qos=valhalla 3 | #SBATCH --clusters=faculty 4 | #SBATCH --time=2:00:00 5 | #SBATCH --nodes=3 6 | #SBATCH --ntasks-per-node=24 7 | #SBATCH --cpus-per-task=1 8 | #SBATCH --mem=128000 9 | #SBATCH --mail-user=bsmith24@buffalo.edu 10 | echo "SLURM_JOBID="$SLURM_JOBID 11 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 12 | echo "SLURM_NNODES="$SLURM_NNODES 13 | echo "SLURMTMPDIR="$SLURMTMPDIR 14 | echo "working directory="$SLURM_SUBMIT_DIR 15 | 16 | python test.py 17 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/pdos/clean.sh: -------------------------------------------------------------------------------- 1 | rm *DOS* 2 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/pdos/cp2k_all_pdosfiles: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/legacy/cp2k_libra_workflow/pdos/cp2k_all_pdosfiles -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step2/.gitignore: -------------------------------------------------------------------------------- 1 | res 2 | wd -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step2/check_step2_progress.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | def check(prefix,suffix,mini,maxi): 4 | # The function creates the continuity regions of existing files 5 | # prefix - prefix of the file to be found 6 | # suffix - suffix of the file to be found 7 | # mini - minimal index of the file to be found 8 | # maxi - maximal index of the file to be found 9 | 10 | 11 | res = [] 12 | lst = [] 13 | stop = 0 14 | i = mini 15 | while i<=maxi: 16 | file_path = prefix + str(i) + suffix 17 | if os.path.exists(file_path): 18 | lst.append(i) 19 | else: 20 | if len(lst)>0: 21 | res.append(lst) 22 | lst = [] 23 | 24 | i = i + 1 25 | 26 | 27 | for lst in res: 28 | print( "range("+str(lst[0])+","+str(lst[-1]+1)+") nelts = "+str(lst[-1]+1-lst[0]) ) 29 | 30 | # Edit parameters of the function called below 31 | # argument #1 - prefix of the file to be found 32 | # argument #2 - suffix of the file to be found 33 | # argument #3 - minimal index of the file to be found 34 | # argument #4 - maximal index of the file to be found 35 | print ("\n") 36 | check(os.getcwd()+"/res/S_ks_","_re",0,5000) 37 | print ("\nFinished Checking\n") 38 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step2/clean.sh: -------------------------------------------------------------------------------- 1 | rm -rf sl* 2 | rm -rf _* 3 | rm -rf wd 4 | rm -rf res 5 | rm -rf MO* 6 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step2/cp2k_input_template.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PROJECT c10h16 3 | RUN_TYPE ENERGY 4 | PRINT_LEVEL MEDIUM 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD Quickstep 8 | 9 | &PROPERTIES 10 | &TDDFPT 11 | NSTATES 10 # number of excited states 12 | MAX_ITER 200 # maximum number of Davidson iterations 13 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 14 | &MGRID 15 | CUTOFF 400 # separate cutoff for TDDFPT calc 16 | &END 17 | 18 | RESTART .FALSE. 19 | WFN_RESTART_FILE_NAME RESTART.tdwfn 20 | 21 | &END TDDFPT 22 | &END PROPERTIES 23 | 24 | &PRINT 25 | &FORCES 26 | &END 27 | &TOTAL_NUMBERS ON 28 | &END TOTAL_NUMBERS 29 | &END PRINT 30 | 31 | &DFT 32 | 33 | &POISSON 34 | PERIODIC none 35 | POISSON_SOLVER wavelet 36 | &END POISSON 37 | 38 | &PRINT 39 | &PDOS SILENT 40 | COMPONENTS T 41 | NLUMO -1 42 | &END PDOS 43 | &MO_CUBES 44 | NLUMO -1 45 | NHOMO 20 46 | WRITE_CUBE .TRUE. 47 | STRIDE 2 2 2 48 | &END 49 | &END PRINT 50 | 51 | BASIS_SET_FILE_NAME BASIS_MOLOPT 52 | POTENTIAL_FILE_NAME POTENTIAL 53 | WFN_RESTART_FILE_NAME RESTART.wfn 54 | 55 | &MGRID 56 | CUTOFF 400 57 | REL_CUTOFF 60 58 | &END MGRID 59 | 60 | &QS 61 | EPS_DEFAULT 1.0E-16 62 | &END QS 63 | 64 | &SCF 65 | SCF_GUESS RESTART 66 | EPS_SCF 1.0E-6 67 | MAX_SCF 300 68 | 69 | ADDED_MOS 20 70 | &DIAGONALIZATION 71 | ALGORITHM STANDARD 72 | &END DIAGONALIZATION 73 | &MIXING 74 | METHOD BROYDEN_MIXING 75 | ALPHA 0.5 76 | BETA 0.5 77 | NBROYDEN 8 78 | &END MIXING 79 | &END SCF 80 | 81 | &XC 82 | &XC_FUNCTIONAL PBE 83 | &END XC_FUNCTIONAL 84 | &END XC 85 | 86 | &END DFT 87 | 88 | &SUBSYS 89 | 90 | &KIND C 91 | ELEMENT C 92 | BASIS_SET ORB DZVP-MOLOPT-GTH 93 | POTENTIAL GTH-PBE-q4 94 | &END KIND 95 | &KIND H 96 | ELEMENT H 97 | BASIS_SET ORB DZVP-MOLOPT-GTH 98 | POTENTIAL GTH-PBE-q1 99 | &END KIND 100 | 101 | &CELL 102 | PERIODIC NONE 103 | A 15.0 0.00 0.00 104 | B 0.00 15.0 0.00 105 | C 0.00 0.00 15.0 106 | &END CELL 107 | &TOPOLOGY 108 | COORD_FILE_NAME coord.xyz 109 | COORD_FILE_FORMAT XYZ 110 | &END 111 | &END SUBSYS 112 | &END FORCE_EVAL 113 | 114 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step2/cp2k_tutorial_res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/legacy/cp2k_libra_workflow/step2/cp2k_tutorial_res -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step2/cp2k_tutorial_wd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/legacy/cp2k_libra_workflow/step2/cp2k_tutorial_wd -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step2/run.py: -------------------------------------------------------------------------------- 1 | ## This is inplace of the notebook for now -- to be converted to a notebook later 2 | 3 | from liblibra_core import * 4 | 5 | import multiprocessing as mp 6 | import numpy as np 7 | import math 8 | import sys 9 | import os 10 | 11 | 12 | from libra_py import CP2K_methods 13 | from libra_py import Gaussian_methods 14 | from libra_py import DFTB_methods 15 | from libra_py.workflows.nbra import step2_many_body 16 | 17 | ########################### creating directories ############################### 18 | 19 | os.system("rm -r wd") 20 | os.mkdir('wd') 21 | os.system("rm -r res") 22 | os.mkdir('res') 23 | 24 | ######################### creating and submitting jobs ######################### 25 | trajectory_xyz_file = "c10h16-pos-1.xyz" 26 | 27 | # CP2K 28 | es_software_input_template = "cp2k_input_template.inp" 29 | es_software = "cp2k" 30 | 31 | # Gaussian 32 | #es_software_input_template = "gaussian_input_template.gjf" 33 | #es_software = "gaussian" 34 | 35 | # dftb+ 36 | #es_software_input_template = "dftb_input_template.hsd" 37 | #waveplot_input_template = "waveplot_in.hsd" 38 | #es_software = "dftb+" 39 | 40 | istep = 150 41 | fstep = 200 42 | njobs = 10 43 | 44 | for njob in range( njobs ): 45 | 46 | job_init_step, job_final_step = step2_many_body.curr_and_final_step_job( istep, fstep, njobs, njob ) 47 | nsteps_this_job = job_final_step - job_init_step + 1 48 | 49 | print( '\n1- We are before creating job ', njob, ' in directory:', os.getcwd() ) 50 | # Here we create the jobs through auxiliary_functions.cp2k_distribute 51 | if es_software.lower() == "cp2k": 52 | CP2K_methods.cp2k_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, njob ) 53 | 54 | elif es_software.lower() == "gaussian": 55 | Gaussian_methods.gaussian_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, njob ) 56 | 57 | elif es_software.lower() == "dftb+": 58 | DFTB_methods.dftb_distribute( job_init_step, job_final_step, nsteps_this_job, trajectory_xyz_file, es_software_input_template, waveplot_input_template, njob ) 59 | 60 | #sys.exit(0) 61 | 62 | print('2- Finished distributing for job ',njob,'\nNow we are in directory', os.getcwd()) 63 | os.chdir("wd/job"+str(njob)+"/") 64 | 65 | print('3- Now we have changed directory to :', os.getcwd(),'To submit job', njob) 66 | #os.mkdir("cubefiles") 67 | #os.mkdir("logfiles") 68 | 69 | print("4- The initial step for the job ", njob, " is: ", job_init_step, 'with final step: ', job_final_step) 70 | print("5- nsteps_this_job is: ", nsteps_this_job) 71 | St_ks_job = [] 72 | S_ks_job = [] 73 | debug = [] 74 | 75 | ############################ 76 | os.system("cp ../../submit_template.slm submit_"+str(njob)+".slm") 77 | # Now, open the submit_template file in this job folder 78 | # Add the values to the params for this job 79 | f = open( "submit_"+str(njob)+".slm" ) 80 | submit_template_file = f.readlines() 81 | submit_template_file_size = len( submit_template_file ) 82 | f.close() 83 | 84 | f = open( "submit_"+str(njob)+".slm" , 'w' ); f.close() 85 | for i in range( submit_template_file_size ): 86 | 87 | f = open( "submit_"+str(njob)+".slm" , 'a' ) 88 | 89 | submit_template_file_line = submit_template_file[i].split() 90 | if not submit_template_file_line: 91 | continue 92 | 93 | elif submit_template_file_line[0] == "job_init_step=": 94 | f.write( "declare -i job_init_step=%i" % (job_init_step) ) 95 | f.write("\n") 96 | 97 | elif submit_template_file_line[0] == "nsteps_this_job=": 98 | f.write( "declare -i nsteps_this_job=%i" % (nsteps_this_job) ) 99 | f.write("\n") 100 | 101 | elif submit_template_file_line[0] == "njob=": 102 | f.write( "declare -i njob=%i" % (njob) ) 103 | f.write("\n") 104 | 105 | else: 106 | f.write( submit_template_file[i] ) 107 | 108 | os.system("sbatch submit_"+str(njob)+".slm") 109 | # just in case you want to run it without using the submit file through bash 110 | #os.system("sh submit_"+str(njob)+".slm") 111 | 112 | print("6- Now submitting the job in folder: ", os.getcwd()) 113 | 114 | # Change directory to the main directory 115 | os.chdir("../../") 116 | print("7- Finished submitting job, now we are back in directory:", os.getcwd(),'\n\n\n') 117 | 118 | print("\nDone!\n") 119 | 120 | 121 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step2/submit_template.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ###SBATCH --partition=scavenger --qos=scavenger 3 | ###SBATCH --clusters=faculty 4 | ###SBATCH --partition=debug --qos=debug 5 | #SBATCH --partition=general-compute --qos=general-compute 6 | #SBATCH --clusters=ub-hpc 7 | #SBATCH --constraint=CPU-Gold-6130 8 | #SBATCH --time=1:00:00 9 | #SBATCH --nodes=1 10 | #SBATCH --requeue 11 | #SBATCH --ntasks-per-node=32 12 | #SBATCH --cpus-per-task=1 13 | #SBATCH --mem=128000 14 | #SBATCH --mail-user=bsmith24@buffalo.edu 15 | echo "SLURM_JOBID="$SLURM_JOBID 16 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 17 | echo "SLURM_NNODES="$SLURM_NNODES 18 | echo "SLURMTMPDIR="$SLURMTMPDIR 19 | echo "working directory="$SLURM_SUBMIT_DIR 20 | 21 | module load cuda/6.5 22 | module load vmd/v1.9 23 | module load openmpi/3.0.3/gcc-7.3.0 24 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 25 | 26 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 27 | omp_threads=$SLURM_CPUS_PER_TASK 28 | else 29 | omp_threads=1 30 | fi 31 | export OMP_NUM_THREADS=$omp_threads 32 | 33 | nprocs=32 34 | 35 | cp2k_exe=/panasas/scratch/grp-alexeyak/brendan/cp2k_install/cp2k-7.1/exe/local/cp2k.popt 36 | gaussian_exe=g16 37 | dftb_exe=/util/academic/dftbplus/19.1-arpack/bin/dftb+ 38 | 39 | path=/panasas/scratch/grp-alexeyak/brendan/Tutorials_CP2K/step2 40 | res=$path/res 41 | MO_images_directory=$path/MO_images_directory 42 | path_to_tcl_file=$path/cube.tcl 43 | 44 | min_band=10 45 | max_band=40 46 | # We do not need this one and it is for building the basis 47 | ks_orbital_homo_index=28 48 | states_to_be_plotted=0 49 | 50 | job_init_step= 51 | nsteps_this_job= 52 | njob= 53 | 54 | # The commented lines are for the master branch (v 4.9.0, 4.9.1) 55 | # It is better not to use them and use the followng with the newer versions or the devel branch 56 | # since it is optimized and the data will not be lost if the job is suddenly terminated 57 | # Computation of the NACs in both single-particle and many-body can be done in a post-processing 58 | # fashion and independently after all the jobs are done. 59 | 60 | # A complete explanation of all the following parameters can be found in this link: 61 | # https://github.com/AkimovLab/Project_Libra_CP2K/tree/master/Cd33Se33/step2 62 | 63 | python -c "from libra_py.workflows.nbra import step2_many_body 64 | params = { } 65 | 66 | params[\"es_software\"]=\"cp2k\" 67 | params[\"es_software_input_template\"]=\"cp2k_input_template.inp\" 68 | params[\"es_software_exe\"]=\"$cp2k_exe\" 69 | 70 | params[\"nprocs\"]=\"$nprocs\" 71 | params[\"project_name\"]=\"c10h16\" 72 | params[\"trajectory_xyz_filename\"]=\"c10h16-pos-1.xyz\" 73 | params[\"logfile_directory\"]=\"logfiles\" 74 | #params[\"number_of_states\"]=10 75 | #params[\"tolerance\"]=0.0 76 | params[\"isUKS\"]=0 77 | params[\"min_band\"]=int(\"$min_band\") 78 | params[\"max_band\"]=\"$max_band\" 79 | #params[\"ks_orbital_homo_index\"]=\"$ks_orbital_homo_index\" 80 | params[\"istep\"]=\"$job_init_step\" 81 | params[\"nsteps_this_job\"]=\"$nsteps_this_job\" 82 | params[\"njob\"]=\"$njob\" 83 | params[\"res_dir\"]=\"$res\" 84 | #params[\"dt\"]=41.341374575751 85 | 86 | params[\"completion_level\"]=0 87 | 88 | #params[\"do_phase_corrections\"]=1 89 | #params[\"perform_state_reordering\"]=1 90 | #params[\"do_state_reordering\"]=2 91 | #params[\"state_reordering_alpha\"]=0.0 92 | 93 | params[\"do_cube_visualization\"]=0 94 | params[\"path_to_tcl_file\"] = \"$path_to_tcl_file\" 95 | params[\"states_to_be_plotted\"]=\"$states_to_be_plotted\" 96 | params[\"MO_images_directory\"] = \"$MO_images_directory\" 97 | 98 | print( params ) 99 | 100 | step2_many_body.run_step2_many_body( params ) 101 | " 102 | 103 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/README.md: -------------------------------------------------------------------------------- 1 | # THIS TUTORIAL IS DEPRECATED - PLEASE USE THE ONE [HERE](https://github.com/compchem-cybertraining/Tutorials_Libra/tree/master/6_dynamics/2_nbra_workflows/4_step3/2_build_MB_basis) 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/clean.sh: -------------------------------------------------------------------------------- 1 | rm -r res_mb_sp 2 | rm sl* 3 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/cp2k_step3_res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/compchem-cybertraining/Tutorials_CP2K/62d8461684b2707f46dd5eb0b63c68c515b4c34f/legacy/cp2k_libra_workflow/step3/cp2k_step3_res -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/Hvib_sd_150_im: -------------------------------------------------------------------------------- 1 | 0.0000000 -0.00042772969 -0.00046351798 0.00016986797 0.00047324893 7.0203580e-05 -2.3894872e-05 0.00012392859 2 | 0.00042772969 0.0000000 -0.010559388 0.0051715752 -0.00068218403 0.00029226660 -0.00013743852 0.00011483937 3 | 0.00046351798 0.010559388 0.0000000 -0.0053711054 -0.00054323690 0.00033092530 -0.00053294299 0.00027634582 4 | -0.00016986797 -0.0051715752 0.0053711054 0.0000000 -0.0028554588 -7.3470005e-05 -0.00036658674 0.00051785329 5 | -0.00047324893 0.00068218403 0.00054323690 0.0028554588 0.0000000 0.00040570605 -0.00054273514 5.3507734e-05 6 | -7.0203580e-05 -0.00029226660 -0.00033092530 7.3470005e-05 -0.00040570605 0.0000000 -0.00086354785 -0.0012414001 7 | 2.3894872e-05 0.00013743852 0.00053294299 0.00036658674 0.00054273514 0.00086354785 0.0000000 0.0052083804 8 | -0.00012392859 -0.00011483937 -0.00027634582 -0.00051785329 -5.3507734e-05 0.0012414001 -0.0052083804 0.0000000 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/Hvib_sd_150_re: -------------------------------------------------------------------------------- 1 | -0.92324338 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 2 | 0.0000000 -0.86374244 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 3 | 0.0000000 0.0000000 -0.85968717 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 4 | 0.0000000 0.0000000 0.0000000 -0.85768163 0.0000000 0.0000000 0.0000000 0.0000000 5 | 0.0000000 0.0000000 0.0000000 0.0000000 -0.84942215 0.0000000 0.0000000 0.0000000 6 | 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 -0.81825046 0.0000000 0.0000000 7 | 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 -0.81168386 0.0000000 8 | 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 -0.80600735 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/Hvib_sd_151_im: -------------------------------------------------------------------------------- 1 | 0.0000000 0.00083956221 -0.00019364860 -0.00013341747 0.00034254444 1.0711634e-05 9.2710048e-05 6.1532951e-05 2 | -0.00083956221 0.0000000 0.0025026891 0.0038531992 0.00020512651 -0.00010602869 -0.00043192086 2.1620531e-05 3 | 0.00019364860 -0.0025026891 0.0000000 0.011222375 0.00019458132 0.00017017724 0.00042915196 0.00028432369 4 | 0.00013341747 -0.0038531992 -0.011222375 0.0000000 0.0030933608 2.1287495e-05 -9.1233128e-05 -0.00010363471 5 | -0.00034254444 -0.00020512651 -0.00019458132 -0.0030933608 0.0000000 0.00010487586 0.00053320642 -2.5203504e-05 6 | -1.0711634e-05 0.00010602869 -0.00017017724 -2.1287495e-05 -0.00010487586 0.0000000 -0.00017568606 -0.00052433315 7 | -9.2710048e-05 0.00043192086 -0.00042915196 9.1233128e-05 -0.00053320642 0.00017568606 0.0000000 -0.0021596176 8 | -6.1532951e-05 -2.1620531e-05 -0.00028432369 0.00010363471 2.5203504e-05 0.00052433315 0.0021596176 0.0000000 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/Hvib_sd_151_re: -------------------------------------------------------------------------------- 1 | -0.92180319 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 2 | 0.0000000 -0.86406074 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 3 | 0.0000000 0.0000000 -0.85808482 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 4 | 0.0000000 0.0000000 0.0000000 -0.85605722 0.0000000 0.0000000 0.0000000 0.0000000 5 | 0.0000000 0.0000000 0.0000000 0.0000000 -0.84766616 0.0000000 0.0000000 0.0000000 6 | 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 -0.81567555 0.0000000 0.0000000 7 | 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 -0.81325559 0.0000000 8 | 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 -0.80622880 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/Hvib_sd_152_im: -------------------------------------------------------------------------------- 1 | 0.0000000 0.00078035884 0.00015918474 -2.1857924e-06 0.00013484759 0.00011239114 9.1885565e-05 -2.1635302e-05 2 | -0.00078035884 0.0000000 -0.00037888418 0.0024609312 -0.00019259930 -0.00046673693 -0.00011041498 6.4477141e-05 3 | -0.00015918474 0.00037888418 0.0000000 -0.0010994207 -0.00011293488 -0.00037954987 -0.00036687391 -0.00023243480 4 | 2.1857924e-06 -0.0024609312 0.0010994207 0.0000000 0.0042548816 -7.9978429e-05 -0.00034622617 0.00022211155 5 | -0.00013484759 0.00019259930 0.00011293488 -0.0042548816 0.0000000 0.00045916962 0.00087861195 -7.6219184e-06 6 | -0.00011239114 0.00046673693 0.00037954987 7.9978429e-05 -0.00045916962 0.0000000 0.011102359 -0.0016536783 7 | -9.1885565e-05 0.00011041498 0.00036687391 0.00034622617 -0.00087861195 -0.011102359 0.0000000 -0.0019317156 8 | 2.1635302e-05 -6.4477141e-05 0.00023243480 -0.00022211155 7.6219184e-06 0.0016536783 0.0019317156 0.0000000 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/Hvib_sd_152_re: -------------------------------------------------------------------------------- 1 | -0.92039247 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 2 | 0.0000000 -0.86447396 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 3 | 0.0000000 0.0000000 -0.85690855 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 4 | 0.0000000 0.0000000 0.0000000 -0.85377990 0.0000000 0.0000000 0.0000000 0.0000000 5 | 0.0000000 0.0000000 0.0000000 0.0000000 -0.84597789 0.0000000 0.0000000 0.0000000 6 | 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 -0.81566020 0.0000000 0.0000000 7 | 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 -0.81332227 0.0000000 8 | 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 -0.80687817 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/S_sd_150_re: -------------------------------------------------------------------------------- 1 | 1.0000000 4.1512602e-16 -1.7731365e-16 2.9537849e-16 -3.8899819e-16 -5.9900904e-17 -5.2121578e-16 -3.8469229e-16 2 | 4.1512652e-16 1.0000000 4.2834355e-17 6.7535312e-16 3.7778137e-16 7.0800844e-16 7.2629321e-17 5.2045569e-16 3 | -1.7731375e-16 4.2834359e-17 1.0000000 6.5796303e-16 1.7060829e-16 1.8213369e-16 3.7397778e-17 3.6543537e-16 4 | 2.9537837e-16 6.7535309e-16 6.5796305e-16 1.0000000 5.5235547e-16 1.6053537e-16 7.7452196e-17 2.7006560e-16 5 | -3.8899827e-16 3.7778133e-16 1.7060822e-16 5.5235550e-16 1.0000000 3.4060003e-16 7.2566120e-17 4.1165034e-16 6 | -5.9900848e-17 7.0800843e-16 1.8213348e-16 1.6053536e-16 3.4060004e-16 1.0000000 4.9126873e-16 -1.8749580e-16 7 | -5.2121635e-16 7.2629336e-17 3.7397782e-17 7.7452299e-17 7.2566042e-17 4.9126875e-16 1.0000000 3.1724113e-16 8 | -3.8469229e-16 5.2045553e-16 3.6543521e-16 2.7006571e-16 4.1165036e-16 -1.8749581e-16 3.1724126e-16 1.0000000 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/S_sd_151_re: -------------------------------------------------------------------------------- 1 | 1.0000000 4.0871054e-17 -1.7957884e-16 2.3071113e-16 1.7005160e-16 -2.7338299e-16 1.0346209e-15 -2.9386633e-16 2 | 4.0870861e-17 1.0000000 -5.9591133e-16 -8.5793651e-16 -1.2779096e-16 -2.3915102e-16 1.6693876e-16 -3.3598268e-16 3 | -1.7957890e-16 -5.9591141e-16 1.0000000 -1.7808527e-16 -7.0070880e-17 -2.2288635e-16 5.7121539e-16 4.0489054e-16 4 | 2.3071117e-16 -8.5793657e-16 -1.7808529e-16 1.0000000 2.4481568e-16 4.7481248e-17 -6.1320424e-16 6.3453673e-17 5 | 1.7005151e-16 -1.2779116e-16 -7.0071027e-17 2.4481579e-16 1.0000000 3.2327977e-16 -8.7805062e-17 -1.1618687e-16 6 | -2.7338280e-16 -2.3915103e-16 -2.2288593e-16 4.7481237e-17 3.2327978e-16 1.0000000 -5.1581533e-16 -1.5859061e-16 7 | 1.0346210e-15 1.6693889e-16 5.7121539e-16 -6.1320468e-16 -8.7805155e-17 -5.1581524e-16 1.0000000 -1.2419112e-16 8 | -2.9386569e-16 -3.3598269e-16 4.0489058e-16 6.3453673e-17 -1.1618693e-16 -1.5859064e-16 -1.2419112e-16 1.0000000 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/S_sd_152_re: -------------------------------------------------------------------------------- 1 | 1.0000000 -8.3079377e-17 8.6665842e-17 1.1281021e-16 2.1125225e-17 -1.1273865e-16 -2.2530198e-16 4.4315440e-18 2 | -8.3078732e-17 1.0000000 4.2901154e-17 7.2935280e-17 1.3107424e-16 1.5691446e-16 -6.6798066e-16 6.1936214e-17 3 | 8.6665792e-17 4.2901172e-17 1.0000000 3.7672181e-16 -2.9177725e-17 2.8316531e-16 2.2384109e-16 -2.1787000e-16 4 | 1.1281026e-16 7.2935256e-17 3.7672181e-16 1.0000000 2.0468182e-16 8.3620595e-17 4.0289893e-16 1.5287680e-16 5 | 2.1124870e-17 1.3107464e-16 -2.9177265e-17 2.0468200e-16 1.0000000 1.3553368e-16 5.8784930e-17 8.0374427e-18 6 | -1.1273847e-16 1.5691466e-16 2.8316539e-16 8.3620704e-17 1.3553368e-16 1.0000000 2.9826801e-16 -1.3470526e-16 7 | -2.2530244e-16 -6.6798093e-16 2.2384155e-16 4.0289890e-16 5.8784904e-17 2.9826802e-16 1.0000000 -1.2394989e-16 8 | 4.4315176e-18 6.1936293e-17 -2.1787006e-16 1.5287680e-16 8.0374427e-18 -1.3470518e-16 -1.2394990e-16 1.0000000 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/S_sd_153_re: -------------------------------------------------------------------------------- 1 | 1.0000000 3.6229261e-16 8.5789901e-16 4.1159645e-17 7.4578973e-16 3.2304606e-17 2.5764070e-16 -1.9677332e-16 2 | 3.6229295e-16 1.0000000 8.9247374e-17 4.0277769e-16 3.0252822e-16 -3.5635966e-16 1.1911386e-17 1.8040253e-16 3 | 8.5789904e-16 8.9247344e-17 1.0000000 3.4217387e-17 -1.5917227e-16 -2.2988054e-16 8.0782704e-16 2.5337932e-18 4 | 4.1159561e-17 4.0277761e-16 3.4217305e-17 1.0000000 6.7485682e-17 5.0897842e-17 2.7627385e-17 1.5246212e-16 5 | 7.4578998e-16 3.0252811e-16 -1.5917347e-16 6.7485366e-17 1.0000000 -1.7277760e-16 7.7334777e-16 2.8427569e-16 6 | 3.2304233e-17 -3.5635966e-16 -2.2988054e-16 5.0897856e-17 -1.7277761e-16 1.0000000 2.8528970e-16 -4.5405114e-16 7 | 2.5764030e-16 1.1911563e-17 8.0782781e-16 2.7627611e-17 7.7334790e-16 2.8528969e-16 1.0000000 -3.5108245e-17 8 | -1.9677317e-16 1.8040240e-16 2.5337932e-18 1.5246201e-16 2.8427527e-16 -4.5405116e-16 -3.5108298e-17 1.0000000 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/St_sd_150_re: -------------------------------------------------------------------------------- 1 | 0.99756131 0.012342140 0.024092387 -0.0053353397 -0.019699192 -0.0030992951 0.00014834393 -0.0058246611 2 | -0.023022034 0.86837954 0.46130473 -0.16229444 0.019576294 -0.016459781 0.0085633230 -0.0065057650 3 | -0.014230720 -0.41173273 0.86662403 0.27148352 0.029651553 -0.010769210 0.020432525 -0.017197708 4 | 0.0087091394 0.26528516 -0.17259299 0.93847863 0.11841016 0.0033322814 0.013011198 -0.023088120 5 | 0.019428458 -0.036825858 -0.015262618 -0.11767573 0.98987646 -0.017194493 0.020576809 -0.0036509416 6 | 0.0027050522 0.0077044684 0.016591294 -0.0027421300 0.016348794 0.99437642 0.041338105 0.050034144 7 | -0.0018272553 -0.0027999282 -0.023630558 -0.017297751 -0.024295877 -0.030058989 0.96748978 -0.21725484 8 | 0.0044216049 0.0029890157 0.0056502308 0.019727365 0.00077301323 -0.052603319 0.21336777 0.96257908 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/St_sd_151_re: -------------------------------------------------------------------------------- 1 | 0.99655905 -0.033489716 0.011079319 0.0051492488 -0.014768740 -0.0022792645 -0.0034505919 -0.0035280448 2 | 0.035924274 0.97656143 -0.14291631 -0.13367987 0.0033793194 0.013838839 0.016754782 0.0014101933 3 | -0.0049313141 0.064003010 0.87490227 -0.47306196 0.022928594 -0.026369401 -0.011552743 -0.016493388 4 | -0.0058815469 0.18489799 0.45479042 0.85833718 -0.13034696 0.013450658 -0.0020241331 0.0026494696 5 | 0.013552421 0.020338932 0.039016342 0.12540838 0.98788839 -0.033274022 -0.014832402 -0.0018568938 6 | -0.0013936395 0.0050725156 -0.012299353 0.015210682 -0.024603013 -0.86748524 0.47261923 -0.10216315 7 | 0.0042145630 -0.018955914 0.023929023 -0.0095671780 0.029252462 0.45809371 0.87367900 0.12439419 8 | 0.0015594253 0.0031977526 0.0070141515 -0.0059189230 -0.0039406891 -0.14551438 -0.054160390 0.97578494 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/step3/user_defined_basis/res_mb_sp/St_sd_152_re: -------------------------------------------------------------------------------- 1 | 0.99712089 -0.031971572 -0.0067733021 0.00092266025 -0.0061516244 -0.0057536549 -0.0024626218 0.00010543562 2 | 0.032547555 0.99159123 0.017746993 -0.10065433 0.017484575 0.020555424 -0.00073393464 -0.00096141421 3 | 0.0063879001 -0.013578694 0.99648698 0.046428125 0.0010119442 0.018530599 0.011563004 0.011099556 4 | 0.00074194157 0.10281249 -0.044470655 0.97579795 -0.17530533 0.0096162511 0.017434358 -0.0088001667 5 | 0.0049974115 0.0015606975 -0.0083253755 0.17648315 0.98122318 -0.027790699 -0.030146308 -0.0031138030 6 | 0.0035387087 -0.018033822 -0.012850126 0.0030037312 0.010172891 0.88003826 -0.46243984 0.051253607 7 | 0.0051343658 -0.0098629118 -0.018769688 -0.011191204 0.042496267 0.45548977 0.87966678 0.096390163 8 | -0.0016833451 0.0043694780 -0.0081178725 0.0095637479 -0.0037439740 -0.085470522 -0.063321754 0.98902122 9 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/tddft/clean.sh: -------------------------------------------------------------------------------- 1 | rm sl* 2 | rm c10* 3 | rm *wfc* 4 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/tddft/coord.xyz: -------------------------------------------------------------------------------- 1 | 26 2 | XYZ file 3 | C 9.178580 5.928680 6.784230 4 | C 8.288780 6.827330 5.895700 5 | C 9.184490 7.712870 5.000010 6 | C 10.068360 6.815530 4.104270 7 | C 10.956860 5.916830 4.994050 8 | C 9.160840 4.144480 5.000060 9 | C 10.062460 5.030020 5.889820 10 | C 7.388480 5.940480 5.005880 11 | C 8.271070 5.041840 4.110200 12 | C 9.166750 5.928710 3.215770 13 | H 8.541821 5.298140 7.443030 14 | H 9.819710 6.559260 7.438760 15 | H 7.653340 7.473351 6.539620 16 | H 8.552010 8.373790 4.367380 17 | H 9.825700 8.365280 5.632710 18 | H 10.712270 7.453100 3.460340 19 | H 11.619880 6.547200 5.626580 20 | H 11.607130 5.277700 4.357070 21 | H 9.789130 3.483580 4.363250 22 | H 8.523830 3.492070 5.636970 23 | H 10.702130 4.383980 6.529520 24 | H 6.729700 5.310070 5.642790 25 | H 6.733950 6.579590 4.373250 26 | H 7.622920 4.404290 3.470520 27 | H 9.795130 5.289790 2.556990 28 | H 8.534019 6.567690 2.561230 29 | 30 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/tddft/cp2k_input_template.inp: -------------------------------------------------------------------------------- 1 | &GLOBAL 2 | PROJECT c10h16 3 | RUN_TYPE ENERGY 4 | PRINT_LEVEL MEDIUM 5 | &END GLOBAL 6 | &FORCE_EVAL 7 | METHOD Quickstep 8 | 9 | &PROPERTIES 10 | &TDDFPT 11 | NSTATES 10 # number of excited states 12 | MAX_ITER 200 # maximum number of Davidson iterations 13 | CONVERGENCE [eV] 1.0e-5 # convergence on maximum energy change between iterations 14 | &MGRID 15 | CUTOFF 400 # separate cutoff for TDDFPT calc 16 | &END 17 | ! If the name of the tdwfn file is not correct then the CP2K will crash. 18 | ! Make sure you have the correct file name. Another thing is that whether 19 | ! it works or not depends on the version of CP2K. 20 | RESTART .FALSE. 21 | WFN_RESTART_FILE_NAME RESTART.tdwfn 22 | 23 | &END TDDFPT 24 | &END PROPERTIES 25 | 26 | &PRINT 27 | &FORCES 28 | &END 29 | &TOTAL_NUMBERS ON 30 | &END TOTAL_NUMBERS 31 | &END PRINT 32 | 33 | &DFT 34 | 35 | &POISSON 36 | PERIODIC none 37 | POISSON_SOLVER wavelet 38 | &END POISSON 39 | 40 | &PRINT 41 | &PDOS SILENT 42 | COMPONENTS T 43 | NLUMO -1 44 | &END PDOS 45 | &MO_CUBES 46 | NLUMO -1 47 | NHOMO 30 48 | WRITE_CUBE .FALSE. 49 | STRIDE 2 2 2 50 | &END 51 | &END PRINT 52 | 53 | BASIS_SET_FILE_NAME BASIS_MOLOPT 54 | POTENTIAL_FILE_NAME POTENTIAL 55 | WFN_RESTART_FILE_NAME RESTART.wfn 56 | 57 | &MGRID 58 | CUTOFF 400 59 | REL_CUTOFF 60 60 | &END MGRID 61 | 62 | &QS 63 | EPS_DEFAULT 1.0E-16 64 | &END QS 65 | 66 | &SCF 67 | SCF_GUESS RESTART 68 | EPS_SCF 1.0E-6 69 | MAX_SCF 300 70 | 71 | ADDED_MOS 20 72 | &DIAGONALIZATION 73 | ALGORITHM STANDARD 74 | &END DIAGONALIZATION 75 | &MIXING 76 | METHOD BROYDEN_MIXING 77 | ALPHA 0.5 78 | BETA 0.5 79 | NBROYDEN 8 80 | &END MIXING 81 | &END SCF 82 | 83 | &XC 84 | &XC_FUNCTIONAL PBE 85 | &END XC_FUNCTIONAL 86 | &END XC 87 | 88 | &END DFT 89 | 90 | &SUBSYS 91 | 92 | &KIND C 93 | ELEMENT C 94 | BASIS_SET ORB DZVP-MOLOPT-GTH 95 | POTENTIAL GTH-PBE-q4 96 | &END KIND 97 | &KIND H 98 | ELEMENT H 99 | BASIS_SET ORB DZVP-MOLOPT-GTH 100 | POTENTIAL GTH-PBE-q1 101 | &END KIND 102 | 103 | &CELL 104 | PERIODIC NONE 105 | A 15.0 0.00 0.00 106 | B 0.00 15.0 0.00 107 | C 0.00 0.00 15.0 108 | &END CELL 109 | &TOPOLOGY 110 | COORD_FILE_NAME coord.xyz 111 | COORD_FILE_FORMAT XYZ 112 | &END 113 | &END SUBSYS 114 | &END FORCE_EVAL 115 | 116 | -------------------------------------------------------------------------------- /legacy/cp2k_libra_workflow/tddft/submit.slm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #SBATCH --partition=debug --qos=debug 3 | #SBATCH --clusters=ub-hpc 4 | #SBATCH --constraint=CPU-Gold-6130 5 | 6 | ###SBATCH --partition=valhalla --qos=valhalla 7 | ###SBATCH --clusters=faculty 8 | ###SBATCH --requeue 9 | 10 | #SBATCH --time=1:00:00 11 | #SBATCH --nodes=1 12 | #SBATCH --ntasks-per-node=32 13 | #SBATCH --cpus-per-task=1 14 | #SBATCH --mem=128000 15 | #SBATCH --mail-user=bsmith24@buffalo.edu 16 | echo "SLURM_JOBID="$SLURM_JOBID 17 | echo "SLURM_JOB_NODELIST="$SLURM_JOB_NODELIST 18 | echo "SLURM_NNODES="$SLURM_NNODES 19 | echo "SLURMTMPDIR="$SLURMTMPDIR 20 | echo "working directory="$SLURM_SUBMIT_DIR 21 | 22 | module load openmpi/3.0.3/gcc-7.3.0 23 | export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so 24 | 25 | if [ -n "$SLURM_CPUS_PER_TASK" ]; then 26 | omp_threads=$SLURM_CPUS_PER_TASK 27 | else 28 | omp_threads=1 29 | fi 30 | export OMP_NUM_THREADS=$omp_threads 31 | 32 | nprocs=32 33 | cp2k_exe=/panasas/scratch/grp-alexeyak/brendan/cp2k_install/cp2k-7.1/exe/local/cp2k.popt 34 | 35 | mpirun -np $nprocs $cp2k_exe -i cp2k_input_template.inp -o out.log 36 | 37 | 38 | --------------------------------------------------------------------------------