exercises:2019_conexs_newcastle:ex3
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
exercises:2019_conexs_newcastle:ex3 [2019/09/07 09:35] – abussy | exercises:2019_conexs_newcastle:ex3 [2019/09/12 09:30] – [Part 2: XAS calculations] abussy | ||
---|---|---|---|
Line 2: | Line 2: | ||
- | In this exercise we are going to compute near-edge X-ray absorption spectra of bulk MgS and MgO, performing all-electron calculations with GAPW method, using the Transition Potential | + | In this exercise we are going to compute near-edge X-ray absorption spectra of bulk MgS and MgO, performing all-electron calculations with GAPW method, using the Transition Potential |
- | Before | + | Before |
- | ====Part 1: optimizing geometry==== | + | =====Part 1: optimizing geometry===== |
The first step of the calculation is to optimize the geometry of the systems you are going to work with. It is also possible to use experimental geometries if available. | The first step of the calculation is to optimize the geometry of the systems you are going to work with. It is also possible to use experimental geometries if available. | ||
- | ===MgO=== | + | ====MgO==== |
To start the calculation, | To start the calculation, | ||
Line 99: | Line 99: | ||
</ | </ | ||
- | Since we are going to perform calculations for bulk structures, and both systems have only two atoms in their unit cells, it is not necessary to have a separate .xyz file with the atomic positions. | + | Since both systems have only two atoms in their unit cells it is not necessary to have a separate .xyz file with the atomic positions. |
Do not forget to put in your work directory the files '' | Do not forget to put in your work directory the files '' | ||
- | To run the calculation, type in your terminal: | + | To run the calculation |
- | < | ||
- | ./cp2k.sopt -i MgO_opt.inp -o MgO_opt.out & | ||
- | </ | ||
After the calculation is finished, you can check the files created in your directory. First open the output file '' | After the calculation is finished, you can check the files created in your directory. First open the output file '' | ||
Line 117: | Line 114: | ||
</ | </ | ||
- | If you found it, it means that the optimization of the geometry is done, and you can find the final atomic coordinates in the file '' | + | If you found it, it means that the optimization of the geometry is done, and you can find the final atomic coordinates in the file '' |
cp2k prints out the coordinates for each step of the calculation (they are indicated in the file by the index i, right below the number of atoms), so in order to use the optimized geometry in the following calculations, | cp2k prints out the coordinates for each step of the calculation (they are indicated in the file by the index i, right below the number of atoms), so in order to use the optimized geometry in the following calculations, | ||
+ | It is also important to check for warnings in your output file. In the end of the file you can find the following banner: | ||
- | ===MgS=== | + | < |
+ | ------------------------------------------------------------------------------- | ||
+ | |||
+ | The number of warnings for this run is : 0 | ||
+ | |||
+ | ------------------------------------------------------------------------------- | ||
+ | </ | ||
+ | |||
+ | which means that the calculation ran without problems. If the number is different than 0, search for the warning messages through out the output file. | ||
+ | |||
+ | ====MgS==== | ||
Now we are going to perform the same calculation, | Now we are going to perform the same calculation, | ||
Line 147: | Line 155: | ||
</ | </ | ||
- | These are the lengths of the vectors a, b and c of the MgS unit cell. Both systems have rhombohedral unit cells, so the angles $\alpha$, $\beta$ and $\gamma$ are the same. | + | In order to deal with a smaller number of atoms, we are declaring the structures of MgO and MgS using the rhombhedral unit cell, so the lengths of the lattice |
+ | |||
+ | The last modification that needs to be done is regarding the atomic types. In this case we do not have oxygen in the system anymore, so the subsection ''& | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | Now the input is ready and it can be run in the same way as before, just remember to change the file '' | ||
+ | |||
+ | After the calculation is finished, open the output file '' | ||
+ | |||
+ | =====Part 2: XAS calculations===== | ||
+ | To compute the absorption spectra, download or copy the input file bellow to the working directory. It is a general input that needs to be edited depending on which system you are working with. | ||
+ | |||
+ | <code - MgX_xas.inp> | ||
+ | |||
+ | & | ||
+ | PROJECT_NAME MgX ! TASK: change X to O or S | ||
+ | RUN_TYPE ENERGY | ||
+ | PRINT_LEVEL LOW | ||
+ | FLUSH_SHOULD_FLUSH .TRUE. | ||
+ | &END GLOBAL | ||
+ | |||
+ | & | ||
+ | METHOD QS | ||
+ | |||
+ | &DFT | ||
+ | !where to find all-electron basis sets and potentials | ||
+ | BASIS_SET_FILE_NAME | ||
+ | POTENTIAL_FILE_NAME | ||
+ | UKS | ||
+ | |||
+ | & | ||
+ | NGRIDS 5 | ||
+ | CUTOFF 400 | ||
+ | REL_CUTOFF 60 | ||
+ | &END MGRID | ||
+ | |||
+ | &QS | ||
+ | METHOD GAPW ! using GAPW for all-electron calculations | ||
+ | EXTRAPOLATION ASPC | ||
+ | EXTRAPOLATION_ORDER 3 | ||
+ | MAP_CONSISTENT | ||
+ | EPS_DEFAULT 1.0E-10 | ||
+ | ! algorithm to construct the atomic radial grid for GAPW | ||
+ | QUADRATURE | ||
+ | ! parameters needed for the GAPW method, look at the manual for more details | ||
+ | EPSFIT | ||
+ | EPSISO | ||
+ | EPSRHO0 | ||
+ | LMAXN0 | ||
+ | LMAXN1 | ||
+ | ALPHA0_H | ||
+ | &END QS | ||
+ | |||
+ | &SCF | ||
+ | MAX_SCF 30 | ||
+ | EPS_SCF 1.0E-5 | ||
+ | SCF_GUESS ATOMIC | ||
+ | ADDED_MOS 8 | ||
+ | |||
+ | & | ||
+ | | ||
+ | ALPHA 0.5 | ||
+ | &END MIXING | ||
+ | |||
+ | & | ||
+ | EPS_SCF 1.0E-5 | ||
+ | MAX_SCF 50 | ||
+ | &END OUTER_SCF | ||
+ | &END SCF | ||
+ | |||
+ | &XC | ||
+ | & | ||
+ | &END XC_FUNCTIONAL | ||
+ | |||
+ | & | ||
+ | | ||
+ | | ||
+ | &END XC_GRID | ||
+ | |||
+ | & | ||
+ | POTENTIAL_TYPE PAIR_POTENTIAL | ||
+ | & | ||
+ | PARAMETER_FILE_NAME dftd3.dat | ||
+ | TYPE DFTD3 | ||
+ | REFERENCE_FUNCTIONAL PBE | ||
+ | R_CUTOFF [angstrom] 16 | ||
+ | &END PAIR_POTENTIAL | ||
+ | &END VDW_POTENTIAL | ||
+ | &END XC | ||
+ | |||
+ | &XAS | ||
+ | RESTART .FALSE. | ||
+ | METHOD TP_HH ! transition potential half core hole | ||
+ | DIPOLE_FORM VELOCITY | ||
+ | STATE_TYPE 1s ! excitation from 1s orbital (K-edge calculation) | ||
+ | ATOMS_LIST 1 2 ! calculate absorption for 1st and 2nd atoms in the &COORD subsection | ||
+ | ADDED_MOS 8 | ||
+ | |||
+ | &SCF | ||
+ | | ||
+ | | ||
+ | |||
+ | & | ||
+ | METHOD BROYDEN_MIXING | ||
+ | ALPHA 0.5 | ||
+ | & | ||
+ | |||
+ | & | ||
+ | | ||
+ | | ||
+ | & | ||
+ | &END SCF | ||
+ | |||
+ | & | ||
+ | &END LOCALIZE | ||
+ | |||
+ | & | ||
+ | & | ||
+ | & | ||
+ | |||
+ | & | ||
+ | | ||
+ | & | ||
+ | | ||
+ | & | ||
+ | | ||
+ | & | ||
+ | |||
+ | & | ||
+ | | ||
+ | & | ||
+ | |||
+ | & | ||
+ | | ||
+ | & | ||
+ | &END PRINT | ||
+ | &END XAS | ||
+ | &END DFT | ||
+ | |||
+ | & | ||
+ | & | ||
+ | X | ||
+ | Mg x(Mg) y(Mg) z(Mg) | ||
+ | &END COORD | ||
+ | |||
+ | &CELL | ||
+ | PERIODIC XYZ | ||
+ | ALPHA_BETA_GAMMA 60 60 60 | ||
+ | ABC A B C | ||
+ | &END CELL | ||
+ | |||
+ | &KIND Mg | ||
+ | ELEMENT Mg | ||
+ | BASIS_SET Ahlrichs-pVDZ | ||
+ | POTENTIAL ALL ! all-electron calculations | ||
+ | LEBEDEV_GRID 80 | ||
+ | RADIAL_GRID 200 | ||
+ | &END KIND | ||
+ | |||
+ | &KIND X ! TASK: change X to O or S | ||
+ | ELEMENT X ! TASK: change X to O or S | ||
+ | BASIS_SET Ahlrichs-pVDZ | ||
+ | POTENTIAL ALL ! all-electron calculations | ||
+ | LEBEDEV_GRID 80 | ||
+ | RADIAL_GRID 200 | ||
+ | &END KIND | ||
+ | &END SUBSYS | ||
+ | &END FORCE_EVAL | ||
+ | </ | ||
+ | |||
+ | ====MgS==== | ||
+ | |||
+ | To compute the absorption spectra for the bulk MgS, first rename the input file changing the '' | ||
+ | |||
+ | < | ||
+ | cp MgX_xas.inp MgS_xas.inp | ||
+ | </ | ||
+ | |||
+ | Now change all the '' | ||
+ | The next step is to add the optimized coordinates of the system, that you can find them in the '' | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | To run this calculation proceed as you did before. | ||
+ | |||
+ | This calculation should take longer than the geometry optimization to run. Once it is finished, check the number of warnings and if the calculation converged. Sometimes it does not converge within the maximum number of iterations we set in the input file. If this is the case, you can increase the number using the keyword '' | ||
+ | |||
+ | You can check in the working directory that some files were created. The absorption energies and intensities (oscillator strength) are written in the files named '' | ||
+ | |||
+ | The file looks like | ||
+ | |||
+ | < | ||
+ | Absorption spectrum for atom 1, index of excited core MO is 2, # of lines 9 | ||
+ | 11 531.57449433 | ||
+ | 12 549.96927153 | ||
+ | 13 550.01480014 | ||
+ | 14 550.01480014 | ||
+ | 15 574.27304606 | ||
+ | 16 574.27304607 | ||
+ | 17 574.27591527 | ||
+ | 18 694.86428215 | ||
+ | </ | ||
+ | |||
+ | and the first column corresponds to the index of the KS virtual state, the second to the energy in eV, the third, fourth and fifth to the intensities projected onto x, y and z, respectively, | ||
+ | |||
+ | To convolute the spectra with gaussian functions, download the files {{exercises: | ||
+ | |||
+ | < | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | As an output you are going to get two files: '' | ||
+ | |||
+ | In order to obtain the spectrum for atom 2, you can open the file '' | ||
+ | absorption spectrum. | ||
+ | |||
+ | |||
+ | =====Part 3: $\Delta$SCF calculations===== | ||
+ | |||
+ | Now, to finally finish the calculation, | ||
+ | |||
+ | < | ||
+ | METHOD DSCF | ||
+ | </ | ||
+ | |||
+ | instead of '' | ||
+ | |||
+ | After the calculation is done, look for the message | ||
+ | |||
+ | < | ||
+ | Ionization potential of the excited atom: -92.73815588900608 | ||
+ | </ | ||
+ | |||
+ | in the output file. The energy is given in Hartree, and to convert it to electron volts multiply the value by 27.211. This is the energy of the first transition, and you can use this value to rigidly shift your absorption spectrum. | ||
+ | |||
+ | =====Part 4: Changing basis set===== | ||
+ | |||
+ | Before performing the XAS calculations for the MgO system and compare the Mg absorption spectra, you can try to change the basis set you are using to run the absorption calculations to analyze differences it can bring to the description of the process. Try to perform the calculations using: | ||
+ | |||
+ | * pc-0 (smaller basis set) | ||
+ | * pob-TZVP (basis set for solid-state calculations) | ||
+ | * DZVP-all | ||
+ | * Ahlrichs-def2-SVP | ||
+ | |||
+ | < | ||
- | The last modification that needs to be done is regarding | + | You can check the tutorial [[exercises: |
- | ====Part 2: XAS calculations==== | + | |
- | ====Part 3: $\Delta$SCF calculations==== |
exercises/2019_conexs_newcastle/ex3.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1