User Tools

Site Tools


exercises:2019_conexs_newcastle:ex2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
exercises:2019_conexs_newcastle:ex2 [2019/09/09 11:02] – [Part 2: Higher quality hybrid functional calculation] abussyexercises:2019_conexs_newcastle:ex2 [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 10: Line 10:
  
 You can find documentation for the XAS_TDP method [[ http://htmlpreview.github.io/?https://github.com/abussy/CONEXS/blob/master/xas_tdp_docs/CP2K_INPUT/FORCE_EVAL/DFT/XAS_TDP.html | here]] and refer to the {{:exercises:2019_conexs_newcastle:xas_tdp_conexs.pdf|slides}}. You can find documentation for the XAS_TDP method [[ http://htmlpreview.github.io/?https://github.com/abussy/CONEXS/blob/master/xas_tdp_docs/CP2K_INPUT/FORCE_EVAL/DFT/XAS_TDP.html | here]] and refer to the {{:exercises:2019_conexs_newcastle:xas_tdp_conexs.pdf|slides}}.
 +
 +**Remember** that the LR-TDDFT code is not yet included in the main CP2K code, hence you have to modify the ''module load'' line in the ''cp2k.sh'' file in order to load the correct version:
 +
 +<code>
 +module load CP2K/xas_tdp_libint2
 +</code>
 +
 +To make sure you are using the proper version, type ''module unload CP2K/6.1-foss-2017b'' before launching any calculation.
 ===== Part 1: the standard workflow ===== ===== Part 1: the standard workflow =====
  
Line 132: Line 140:
 </code> </code>
  
-Download this input and place it into your working directory. Make sure that the ''geometry.xyz'' file is also there. Because it is a relatively small system, we do not need to run CP2K in parallel. To launch the calculation, write in the terminal:+Download this input and place it into your working directory. Make sure that the ''geometry.xyz'' file is also there. Because it is a relatively small system, we do not need to run CP2K in parallel. To launch the calculation, write in the terminal (after modifying the paths in the ''cp2k.sh'' file):
  
 <code> <code>
-cp2k.sopt -i part1_gs.inp -o part1_gs.out &+sbatch cp2k.sh
 </code> </code>
  
Line 240: Line 248:
 </code> </code>
  
-You can download/copy the above file in your working directory. Note that the project name is the same as in ''part1_gs.inp''; this ensure that we can restart and skip the ground state calculation. Only a minimal &XAS_TDP section was added, with the CHECK_ONLY keyword and the &DONOR_STATES subsection. Note that the LOCALIZE keyword is commented for now. Run this input+You can download/copy the above file in your working directory. Note that the project name is the same as in ''part1_gs.inp''; this ensure that we can restart and skip the ground state calculation. Only a minimal &XAS_TDP section was added, with the CHECK_ONLY keyword and the &DONOR_STATES subsection. Note that the LOCALIZE keyword is commented for now. Adapt the paths in ''cp2k.sh'' and run this input.
- +
-<code> +
-cp2k.sopt -i part1_check.inp -o part1_check.out & +
-</code>+
  
 Once the calculation is over, open ''part1_check.out'' and look for ''XAS_TDP''. This will lead you to the relevant part of the output file, in which you can check the quality of the donor MOs. **Remember**: for the theory to apply correctly, the donor states need to be local in space and of 1s character. Look at the ''overlap'' and ''charge'' indicators, are we good to proceed ? Once the calculation is over, open ''part1_check.out'' and look for ''XAS_TDP''. This will lead you to the relevant part of the output file, in which you can check the quality of the donor MOs. **Remember**: for the theory to apply correctly, the donor states need to be local in space and of 1s character. Look at the ''overlap'' and ''charge'' indicators, are we good to proceed ?
  
-We are not, because the Aluminium atoms are equivalent under symmetry and the 2 lowest energy MOs will be arbitrary linear combinations of the 1s states. To get the needed donor state quality, uncomment the LOCALIZE keyword in the input file and rerun.+**No**, we are not, because the Aluminium atoms are equivalent under symmetry and the 2 lowest energy MOs will be arbitrary linear combinations of the 1s states. To get the needed donor state quality, uncomment the LOCALIZE keyword in the input file and rerun.
  
  
-==== Computing the XAS spectrum ====+==== Computing the XANES spectrum ====
 Now that we have a proper ground state and we know that the donor MOs are of good quality, we can do an actual XANES calculation on top. To do so, we, have to complete the &XAS_TDP section to include information about the integration grid, the dipole form and most importantly the kernel: Now that we have a proper ground state and we know that the donor MOs are of good quality, we can do an actual XANES calculation on top. To do so, we, have to complete the &XAS_TDP section to include information about the integration grid, the dipole form and most importantly the kernel:
  
Line 358: Line 362:
 </code> </code>
  
-You can run this XAS calculation the usual way+You can run this XAS calculation the usual way.
- +
-<code> +
-cp2k.sopt -i part1_xas.inp -o part1_xas.out & +
-</code>+
  
 Note that again, the program reuses the previous ground state calculation. The spectral data can be found in the ''part1.spectrum'' file. The excitation energies are given in eV and the oscillator strength are within the dipole approximation (arbitrary units). There are two blocks of data, one for each Al 1s. Note that the values are practically the same since the Al atoms are indistinguishable.  Note that again, the program reuses the previous ground state calculation. The spectral data can be found in the ''part1.spectrum'' file. The excitation energies are given in eV and the oscillator strength are within the dipole approximation (arbitrary units). There are two blocks of data, one for each Al 1s. Note that the values are practically the same since the Al atoms are indistinguishable. 
  
-If you wish, you can plot the XANES spectrum using this [[https://raw.githubusercontent.com/abussy/CONEXS/master/plot_spectrum.py | python script]]. Make sure the script is located in the same directory as your ''part1.spectrum'' file and type:+If you wish, you can plot the XANES spectrum using this [[https://raw.githubusercontent.com/abussy/CONEXS/master/plot_spectrum.py | python script]]. Make sure the script is located in the same directory as your ''part1.spectrum'' file and type: **Note: ** before using this script, you have to load a proper python installation by typing: ''module load Anaconda3/''
  
 <code> <code>
Line 452: Line 452:
          TAMM_DANCOFF                                                                                          TAMM_DANCOFF                                                                                
          DIPOLE_FORM LENGTH                                                                                    DIPOLE_FORM LENGTH                                                                          
-         GRID Al 300 300               Dense grid for integration                                   +         GRID Al 300 300              !Denser grid for integration                                   
  
          &KERNEL                                                                                               &KERNEL                                                                                     
Line 509: Line 509:
 where $P_{pq}$ is the density matrix, $\varphi_p,\varphi_q$ are atomic orbitals and $\chi_\mu, \chi_\nu$ are RI basis functions. Extending RI_RADIUS allows for a greater number of RI basis and a higher quality projection of the density, to which hybrid kernels have shown to be very sensitive. where $P_{pq}$ is the density matrix, $\varphi_p,\varphi_q$ are atomic orbitals and $\chi_\mu, \chi_\nu$ are RI basis functions. Extending RI_RADIUS allows for a greater number of RI basis and a higher quality projection of the density, to which hybrid kernels have shown to be very sensitive.
  
-With the keyword NPROCS_GRID set to 4, you can run the calculation on 8 cores and have simultaneous integration of the XC kernel for both Al atoms using all available resources:+With the keyword NPROCS_GRID set to 4, you can run the calculation on 8 cores and have simultaneous integration of the XC kernel for both Al atoms using all available resources. cp2k.popt -i hybrid.inp -o hybrid.out & 
 +</code> 
 + 
 +If you copy the ''plot_spectrum.py'' script from part one in your working directory, you can use it the same way to plot the XANES spetrum:
  
 <code> <code>
-mpirun -n 8 cp2k.popt -i hybrid.inp -o hybrid.out &+python plot_spectrum.py hybrid.spectrum Al 1s 1.0 1545 1570 1000
 </code> </code>
- 
-If you copy the ''plot_spectrum.py'' script from part one in your working directory, you can use it the same way to plot the XANES spetrum. 
  
 **If you have time, feel free to:** **If you have time, feel free to:**
exercises/2019_conexs_newcastle/ex2.1568026946.txt.gz · Last modified: 2020/08/21 10:15 (external edit)