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 11:51] – [Part 3: $\Delta$SCF calculations] abussy | exercises:2019_conexs_newcastle:ex3 [2019/09/12 06:21] – [Part 4: Changing basis set] 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 121: | Line 118: | ||
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 output | + | It is also important to check for warnings in your output file. In the end of the file you can find the following banner: |
< | < | ||
Line 133: | Line 130: | ||
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. | 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=== | + | ====MgS==== |
Now we are going to perform the same calculation, | Now we are going to perform the same calculation, | ||
Line 158: | 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 ''& | 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 ''& | ||
Line 164: | Line 161: | ||
<note important> | <note important> | ||
- | Now the input is ready, and can be run in the same way as before, just changing | + | Now the input is ready and it can be run in the same way as before, just remember to change |
- | + | ||
- | < | + | |
- | ./cp2k.sopt -i MgS_opt.inp -o MgS_opt.out & | + | |
- | </ | + | |
After the calculation is finished, open the output file '' | After the calculation is finished, open the output file '' | ||
- | ====Part 2: XAS calculations==== | + | =====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. | 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. | ||
Line 179: | Line 172: | ||
&GLOBAL | &GLOBAL | ||
PROJECT_NAME MgX ! TASK: change X to O or S | PROJECT_NAME MgX ! TASK: change X to O or S | ||
- | RUN_TYPE ENERGY | + | RUN_TYPE ENERGY |
PRINT_LEVEL LOW | PRINT_LEVEL LOW | ||
FLUSH_SHOULD_FLUSH .TRUE. | FLUSH_SHOULD_FLUSH .TRUE. | ||
Line 312: | Line 305: | ||
ABC A B C | ABC A B C | ||
&END CELL | &END CELL | ||
- | |||
&KIND Mg | &KIND Mg | ||
Line 333: | Line 325: | ||
</ | </ | ||
- | ===MgO=== | + | ====MgS==== |
- | To compute the absorption spectra for the bulk MgO, first rename the input file changing the '' | + | To compute the absorption spectra for the bulk MgS, first rename the input file changing the '' |
< | < | ||
- | cp MgX_xas.inp | + | cp MgX_xas.inp |
</ | </ | ||
- | Now change all the '' | + | Now change all the '' |
The next step is to add the optimized coordinates of the system, that you can find them in the '' | The next step is to add the optimized coordinates of the system, that you can find them in the '' | ||
- | To run this calculation type in terminal: | + | <note important> |
- | < | + | To run this calculation proceed as you did before. |
- | ./cp2k.sopt -i MgO_xas.inp -o MgO_xas.out & | + | |
- | </ | + | |
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 '' | 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 '' | + | 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 | The file looks like | ||
Line 370: | Line 360: | ||
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, | 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: | + | To convolute the spectra with gaussian functions, download the files {{exercises: |
< | < | ||
Line 376: | Line 366: | ||
</ | </ | ||
- | As an output you are going to get two files: '' | + | As an output you are going to get two files: '' |
- | In order to obtain the spectrum for atom 2, you can open the file '' | + | In order to obtain the spectrum for atom 2, you can open the file '' |
absorption spectrum. | absorption spectrum. | ||
- | ===MgS=== | ||
- | The exact same procedure can be done for the MgS, but now replacing the '' | + | =====Part 3: $\Delta$SCF calculations===== |
- | + | Now, to finally finish the calculation, | |
- | ====Part 3: $\Delta$SCF calculations==== | + | |
- | + | ||
- | Now, to finally finish the calculation, | + | |
< | < | ||
Line 394: | Line 380: | ||
</ | </ | ||
- | For the MgO system, for example, run the calculation | + | instead of '' |
- | < | + | After the calculation |
- | ./cp2k.sopt -i MgO_dscf.inp -o MgO_dscf.out & | + | |
- | </ | + | |
- | + | ||
- | After the calculation | + | |
< | < | ||
- | Ionization potential of the excited atom: -49.38227966446617 | + | 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. | 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 | ||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | You can check the tutorial [[exercises: | ||
+ | |||
+ | |||
+ |
exercises/2019_conexs_newcastle/ex3.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1