|
PROGRESS
master
|
Module to compute the density matrix response and related quantities. More...
Data Types | |
| type | respdata_type |
Functions/Subroutines | |
| subroutine, public | prg_parse_response (RespData, filename) |
| The parser for the calculation of the DM response. More... | |
| subroutine, public | prg_compute_dipole (charges, coordinate, dipoleMoment, factor, verbose) |
| To compute the dipole moment of the system. The units of the dipole moment are determined by the units of the coordinates and charges that are given. More... | |
| subroutine, public | prg_write_dipole_tcl (dipoleMoment, file, factor, verbose) |
| To visualize a dipole moment using VMD. This will prg_generate a .tcl script that could be run using VMD To visualize with VMD: $ vmd -e dipole.tcl. More... | |
| subroutine, public | prg_compute_polarizability (rsp_bml, prt_bml, polarizability, factor, verbose) |
| To compute the polarizability of the system. The units of the directional polarizability are determined by the units of the perturbation and Hamiltonian. This equation can be found in [5] equation 4a. Note that in equation 4a of the reference there is a 2 that account for the double occupancy which is not present in this case cause the density matrix construction is done by taking the occupancy into account. More... | |
| subroutine, public | prg_pert_from_file (prt_bml, norb) |
| Read perturbation from file. More... | |
| subroutine, public | prg_compute_response_rs (ham_bml, prt_bml, rsp_bml, lambda, bndfil, threshold, verbose) |
| Computes the first order response density matrix using Rayleigh Schrodinger Perturbation theory The transformation hereby performed are: More... | |
| subroutine, public | prg_compute_response_fd (ham_bml, prt_bml, rsp_bml, prg_delta, bndfil, threshold, verbose) |
| Computes the first order response density matrix using finite differences. The transformation hereby performed are: More... | |
| subroutine, public | prg_pert_constant_field (field, intensity, coordinate, lambda, prt_bml, threshold, spindex, norbi, verbose, over_bml) |
| Apply a constant field perturbation through the dipole moment operator ( \( \hat{\mu} = e \hat{\textbf{r}} \)). In the matrix representation, this is: \( H^{(1)} = \lambda \frac{1}{2}(\,S \, e \textbf{r} \cdot \textbf{E} + \, e \textbf{r} \cdot \textbf{E}S) \). The symmetrization is done in order to preserve the Hermiticity of H. In this case the whole system will be affected by the field. In a latter version we will add the possibility of applying this field to a region of the system. In this implementation \( e= 1 \) and units can be transformed by using the parameter \( \lambda \). More... | |
| subroutine, public | prg_pert_sin_pot (direction, lx, coordinate, lambda, prt_bml, threshold, spindex, norbi, verbose, over_bml) |
| Apply a sinusoidal length dependent potential ( \( \sin(\tilde{\textbf{r}}_x) \)) where \( \textbf{r}_x \) is the x coordinate. The Hamiltonian gets modified as follows: \( H^{(1)} = \frac{1}{2}\lambda (S \sin(\tilde{\textbf{r}}_x) + \sin(\tilde{\textbf{r}}_x) S) \). \( \tilde{\textbf{r}}_x = 2\pi(\textbf{r}/l_x) - \pi \). The symmetrization is done in order to preserve the Hermiticity of H. Units can be transformed by using the parameter \( \lambda \). More... | |
| subroutine, public | prg_pert_cos_pot (direction, lx, coordinate, lambda, prt_bml, threshold, spindex, norbi, verbose, over_bml) |
| Apply a cosine length dependent potential ( \( \cos(\tilde{\textbf{r}}_x) \)) where \( \textbf{r}_x \) is the x coordinate. The Hamiltonian gets modified as follows: \( H^{(1)} = \frac{1}{2}\lambda (S \sin(\tilde{\textbf{r}}_x) + \sin(\tilde{\textbf{r}}_x) S) \). \( \tilde{\textbf{r}}_x = 2\pi(\textbf{r}/l_x) - \pi \). The symmetrization is done in order to preserve the Hermiticity of H. Units can be transformed by using the parameter \( \lambda \). More... | |
| subroutine, public | prg_compute_response_sp2 (ham_bml, prt_bml, rsp_bml, rho_bml, lambda, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, threshold, verbose) |
| Finds the first order response matrix from a Hamiltonian matrix. More... | |
| subroutine, public | prg_project_response (rsp_bml, over_bml, spindex, norbi, coordinates, rspfunc, verbose) |
| Project the response onto atomic positions. First order response to the perturbation ( \( \rho^{(1)} \)) projected onto the atomic position. Basically: \( rsp(i) = \sum_{\alpha \in i}\rho^{(1)}_{\alpha \alpha} \), where orbital \( \alpha \) belong to atom \( i \). More... | |
| subroutine, public | prg_canon_response_vector (P1_bml, H1_bml, Nocc, beta, evals, mu0, m, thresh, HDIM) |
| First-order Canonical Density Matrix Perturbation Theory. More... | |
| subroutine, public | prg_canon_response (P1_bml, H1_bml, Nocc, beta, evals, mu0, m, HDIM) |
| First-order Canonical Density Matrix Perturbation Theory. More... | |
| subroutine, public | prg_canon_response_orig (P1_bml, H1_bml, Nocc, beta, evals, mu0, m, thresh, HDIM) |
| First-order Canonical Density Matrix Perturbation Theory. More... | |
| subroutine, public | prg_canon_response_p1_dpdmu (P1_bml, dPdMu, H1_bml, Norbs, beta, Q_bml, evals, mu0, m, HDIM) |
| First-order Canonical Density Matrix Perturbation Theory. More... | |
Variables | |
| integer, parameter | dp = kind(1.0d0) |
| real(dp), parameter | pi = 3.14159265358979323846264338327950_dp |
Module to compute the density matrix response and related quantities.
Add the response scf
Change name response_SP2 to dm_prt_response
Change name response_rs to rs_prt_response
More information about the theory can be found at [3] and Niklasson2015
| subroutine, public prg_response_mod::prg_canon_response | ( | type(bml_matrix_t), intent(inout) | P1_bml, |
| type(bml_matrix_t), intent(inout) | H1_bml, | ||
| real(dp), intent(in) | Nocc, | ||
| real(dp), intent(in) | beta, | ||
| real(dp), dimension(hdim), intent(in) | evals, | ||
| real(dp), intent(in) | mu0, | ||
| integer, intent(in) | m, | ||
| integer, intent(in) | HDIM | ||
| ) |
First-order Canonical Density Matrix Perturbation Theory.
Assuming known mu0 and representation in H0's eigenbasis Q, where H0 and P0 become diagonal. (mu0, eigenvalues e and eigenvectors Q of H0 are assumed known) Based on PRL 92, 193001 (2004) and PRE 92, 063301 (2015).
| P1_bml | First-order canonical response output. |
| H1_bml | Perturbative hamiltonian input. |
| Nocc | Number of ocupied orbitals. |
| beta | Inverse electronic temperature. |
| evals | Eigenvalues of the system. |
| mu0 | Chemical potential. |
| m | Number of recursive steps. |
| HDIM | Number of orbitals - Hamiltonina zise. |
Definition at line 947 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_canon_response_orig | ( | type(bml_matrix_t), intent(inout) | P1_bml, |
| type(bml_matrix_t), intent(inout) | H1_bml, | ||
| real(dp), intent(in) | Nocc, | ||
| real(dp), intent(in) | beta, | ||
| real(dp), dimension(hdim), intent(in) | evals, | ||
| real(dp), intent(in) | mu0, | ||
| integer, intent(in) | m, | ||
| real(dp), intent(in) | thresh, | ||
| integer, intent(in) | HDIM | ||
| ) |
First-order Canonical Density Matrix Perturbation Theory.
Assuming known mu0 and representation in H0's eigenbasis Q, where H0 and P0 become diagonal. Original routine. (mu0, eigenvalues e and eigenvectors Q of H0 are assumed known) Based on PRL 92, 193001 (2004) and PRE 92, 063301 (2015).
| P1_bml | First-order canonical response output. |
| H1_bml | Perturbative hamiltonian input. |
| Nocc | Number of ocupied orbitals. |
| beta | Inverse electronic temperature. |
| evals | Eigenvalues of the system. |
| mu0 | Chemical potential. |
| m | Number of recursive steps. |
| HDIM | Number of orbitals - Hamiltonina zise. |
Definition at line 1038 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_canon_response_p1_dpdmu | ( | type(bml_matrix_t), intent(inout) | P1_bml, |
| real(dp), dimension(hdim), intent(inout) | dPdMu, | ||
| type(bml_matrix_t), intent(inout) | H1_bml, | ||
| integer, intent(in) | Norbs, | ||
| real(dp), intent(in) | beta, | ||
| type(bml_matrix_t) | Q_bml, | ||
| real(dp), dimension(hdim), intent(in) | evals, | ||
| real(dp), intent(in) | mu0, | ||
| integer, intent(in) | m, | ||
| integer, intent(in) | HDIM | ||
| ) |
First-order Canonical Density Matrix Perturbation Theory.
Assuming known mu0 and representation in H0's eigenbasis Q, where H0 and P0 become diagonal. (mu0, eigenvalues e and eigenvectors Q of H0 are assumed known) Based on PRL 92, 193001 (2004) and PRE 92, 063301 (2015)
Definition at line 1112 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_canon_response_vector | ( | type(bml_matrix_t), intent(inout) | P1_bml, |
| type(bml_matrix_t), intent(inout) | H1_bml, | ||
| real(dp), intent(in) | Nocc, | ||
| real(dp), intent(in) | beta, | ||
| real(dp), dimension(hdim), intent(in) | evals, | ||
| real(dp), intent(in) | mu0, | ||
| integer, intent(in) | m, | ||
| real(dp), intent(in) | thresh, | ||
| integer, intent(in) | HDIM | ||
| ) |
First-order Canonical Density Matrix Perturbation Theory.
Assuming known mu0 and representation in H0's eigenbasis Q, where H0 and P0 become diagonal. (mu0, eigenvalues e and eigenvectors Q of H0 are assumed known) Based on PRL 92, 193001 (2004) and PRE 92, 063301 (2015).
| P1_bml | First-order canonical response output. |
| H1_bml | Perturbative hamiltonian input. |
| Nocc | Number of ocupied orbitals. |
| beta | Inverse electronic temperature. |
| evals | Eigenvalues of the system. |
| mu0 | Chemical potential. |
| m | Number of recursive steps. |
| HDIM | Number of orbitals - Hamiltonina zise. |
Definition at line 849 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_compute_dipole | ( | real(dp), dimension(:), intent(in) | charges, |
| real(dp), dimension(:,:), intent(in) | coordinate, | ||
| real(dp), dimension(3), intent(inout) | dipoleMoment, | ||
| real(dp), intent(in) | factor, | ||
| integer | verbose | ||
| ) |
To compute the dipole moment of the system. The units of the dipole moment are determined by the units of the coordinates and charges that are given.
| charges | Charges on each atomic position. |
| coordinate | Coordinates of the atoms. |
| nats | Number of atoms. |
| dipoleMoment | Dipole moment vector. |
| factor | Unit conversion factor (use 1.0 is no conversion is required). |
| verbose | To give different verbosity levels. If coordinates are in \( \AA \) and charges are in fractions of electron, then transformation ea2debye form LATTE lib can be used to change units to Debye. |
Definition at line 122 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_compute_polarizability | ( | type(bml_matrix_t), intent(in) | rsp_bml, |
| type(bml_matrix_t), intent(in) | prt_bml, | ||
| real(dp), intent(inout) | polarizability, | ||
| real(dp), intent(in) | factor, | ||
| integer | verbose | ||
| ) |
To compute the polarizability of the system. The units of the directional polarizability are determined by the units of the perturbation and Hamiltonian. This equation can be found in [5] equation 4a. Note that in equation 4a of the reference there is a 2 that account for the double occupancy which is not present in this case cause the density matrix construction is done by taking the occupancy into account.
| charges | Charges on each atomic position. |
| coordinate | Coordinates of the atoms. |
| nats | Number of atoms. |
| dipoleMoment | Dipole moment vector. |
| factor | Unit conversion factor (use 1.0 is no conversion is required). |
| verbose | To give different verbosity levels. If coordinates are in \( \AA \) and charges are in fractions of electron, then transformation ea2debye form LATTE lib can be used to change units to Debye. |
Definition at line 200 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_compute_response_fd | ( | type(bml_matrix_t), intent(in) | ham_bml, |
| type(bml_matrix_t), intent(in) | prt_bml, | ||
| type(bml_matrix_t), intent(inout) | rsp_bml, | ||
| real(dp) | prg_delta, | ||
| real(dp), intent(in) | bndfil, | ||
| real(dp), intent(in) | threshold, | ||
| integer | verbose | ||
| ) |
Computes the first order response density matrix using finite differences. The transformation hereby performed are:
| ham_bml | Hamiltonian in bml format ( \( H^{(0)} \)). |
| prt_bml | Perturbation in bml format ( \( H^{(1)} \)). |
| rsp_bml | First order response to the perturbation ( \( \rho^{(1)} \)). |
| bndfil | Filing factor. |
| threshold | Threshold value for matrix elements. |
| verbose | Different levels of verbosity. |
Definition at line 380 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_compute_response_rs | ( | type(bml_matrix_t), intent(in) | ham_bml, |
| type(bml_matrix_t), intent(in) | prt_bml, | ||
| type(bml_matrix_t), intent(inout) | rsp_bml, | ||
| real(dp) | lambda, | ||
| real(dp), intent(in) | bndfil, | ||
| real(dp), intent(in) | threshold, | ||
| integer | verbose | ||
| ) |
Computes the first order response density matrix using Rayleigh Schrodinger Perturbation theory The transformation hereby performed are:
| ham_bml | Hamiltonian in bml format ( \( H^{(0)} \)). |
| prt_bml | Perturbation in bml format ( \( H^{(1)} \)). |
| rsp_bml | First order response to the perturbation ( \( \rho^{(1)} \)). |
| bndfil | Filing factor. |
| threshold | Threshold value for matrix elements. |
| verbose | Different levels of verbosity. |
Definition at line 250 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_compute_response_sp2 | ( | type(bml_matrix_t), intent(in) | ham_bml, |
| type(bml_matrix_t), intent(in) | prt_bml, | ||
| type(bml_matrix_t), intent(inout) | rsp_bml, | ||
| type(bml_matrix_t), intent(inout) | rho_bml, | ||
| real(dp) | lambda, | ||
| real(dp), intent(in) | bndfil, | ||
| integer, intent(in) | minsp2iter, | ||
| integer, intent(in) | maxsp2iter, | ||
| character(len=*), intent(in) | sp2conv, | ||
| real(dp), intent(in) | idemtol, | ||
| real(dp), intent(in) | threshold, | ||
| integer | verbose | ||
| ) |
Finds the first order response matrix from a Hamiltonian matrix.
Definition at line 653 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_parse_response | ( | type(respdata_type) | RespData, |
| character(len=*) | filename | ||
| ) |
The parser for the calculation of the DM response.
| RespData | Response data type. |
| filename | Name of the file to parse. |
Definition at line 45 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_pert_constant_field | ( | real(dp), dimension(3), intent(in) | field, |
| real(dp) | intensity, | ||
| real(dp), dimension(:,:), intent(in) | coordinate, | ||
| real(dp) | lambda, | ||
| type(bml_matrix_t), intent(inout) | prt_bml, | ||
| real(dp) | threshold, | ||
| integer, dimension(:), intent(in) | spindex, | ||
| integer, dimension(:), intent(in) | norbi, | ||
| integer, intent(in) | verbose, | ||
| type(bml_matrix_t), intent(in), optional | over_bml | ||
| ) |
Apply a constant field perturbation through the dipole moment operator ( \( \hat{\mu} = e \hat{\textbf{r}} \)). In the matrix representation, this is: \( H^{(1)} = \lambda \frac{1}{2}(\,S \, e \textbf{r} \cdot \textbf{E} + \, e \textbf{r} \cdot \textbf{E}S) \). The symmetrization is done in order to preserve the Hermiticity of H. In this case the whole system will be affected by the field. In a latter version we will add the possibility of applying this field to a region of the system. In this implementation \( e= 1 \) and units can be transformed by using the parameter \( \lambda \).
| field | Direction of the applied field ( \( \hat{\textbf{E}} \)). |
| intensity | Intensity of the field ( \( ||\textbf{E}|| \)).. |
| coordinate | Coordinates of the system ( \( \textbf{r}\)). |
| lambda | Constant to premultiply the perturbation ( \( \lambda\)). |
| prt_bml | Perturbation in bml format ( \( H^{(1)} \)). |
| threshold | Threshold value for bml format matrices. |
| spindex | Species index. It gives the species index of a particular atom. |
| norbi | Number of orbitals for each atomic site. |
| verbose | Different levels of verbosity. |
| over_bml | It has to be present for a nonorthogonal representation ( \( S \)). |
Definition at line 447 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_pert_cos_pot | ( | character | direction, |
| real(dp) | lx, | ||
| real(dp), dimension(:,:), intent(in) | coordinate, | ||
| real(dp) | lambda, | ||
| type(bml_matrix_t), intent(inout) | prt_bml, | ||
| real(dp) | threshold, | ||
| integer, dimension(:), intent(in) | spindex, | ||
| integer, dimension(:), intent(in) | norbi, | ||
| integer, intent(in) | verbose, | ||
| type(bml_matrix_t), intent(in), optional | over_bml | ||
| ) |
Apply a cosine length dependent potential ( \( \cos(\tilde{\textbf{r}}_x) \)) where \( \textbf{r}_x \) is the x coordinate. The Hamiltonian gets modified as follows: \( H^{(1)} = \frac{1}{2}\lambda (S \sin(\tilde{\textbf{r}}_x) + \sin(\tilde{\textbf{r}}_x) S) \). \( \tilde{\textbf{r}}_x = 2\pi(\textbf{r}/l_x) - \pi \). The symmetrization is done in order to preserve the Hermiticity of H. Units can be transformed by using the parameter \( \lambda \).
| direction | Direction of the potential gradient (x,y or z). |
| lx | Lenght of the box in x direction. |
| coordinate | Coordinates of the system ( \( \textbf{r}\)). |
| lambda | Constant to premultiply the perturbation ( \( \lambda\)). |
| prt_bml | Perturbation in bml format ( \( H^{(1)} \)). |
| threshold | Threshold value for bml format matrices. |
| norbi | Number of orbitals for each atomic site. |
| verbose | Different levels of verbosity. |
| over_bml | It has to be present for a nonorthogonal representation ( \( S \)). |
Definition at line 592 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_pert_from_file | ( | type(bml_matrix_t), intent(inout) | prt_bml, |
| integer | norb | ||
| ) |
Read perturbation from file.
Definition at line 225 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_pert_sin_pot | ( | character | direction, |
| real(dp) | lx, | ||
| real(dp), dimension(:,:), intent(in) | coordinate, | ||
| real(dp) | lambda, | ||
| type(bml_matrix_t), intent(inout) | prt_bml, | ||
| real(dp) | threshold, | ||
| integer, dimension(:), intent(in) | spindex, | ||
| integer, dimension(:), intent(in) | norbi, | ||
| integer, intent(in) | verbose, | ||
| type(bml_matrix_t), intent(in), optional | over_bml | ||
| ) |
Apply a sinusoidal length dependent potential ( \( \sin(\tilde{\textbf{r}}_x) \)) where \( \textbf{r}_x \) is the x coordinate. The Hamiltonian gets modified as follows: \( H^{(1)} = \frac{1}{2}\lambda (S \sin(\tilde{\textbf{r}}_x) + \sin(\tilde{\textbf{r}}_x) S) \). \( \tilde{\textbf{r}}_x = 2\pi(\textbf{r}/l_x) - \pi \). The symmetrization is done in order to preserve the Hermiticity of H. Units can be transformed by using the parameter \( \lambda \).
| direction | Direction of the potential gradient (x,y or z). |
| lx | Length of the box in x direction. |
| coordinate | Coordinates of the system ( \( \textbf{r}\)). |
| lambda | Constant to premultiply the perturbation ( \( \lambda\)). |
| prt_bml | Perturbation in bml format ( \( H^{(1)} \)). |
| threshold | Threshold value for bml format matrices. |
| norbi | Number of orbitals for each atomic site. |
| verbose | Different levels of verbosity. |
| over_bml | It has to be present for a nonorthogonal representation ( \( S \)). |
Definition at line 524 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_project_response | ( | type(bml_matrix_t), intent(inout) | rsp_bml, |
| type(bml_matrix_t), intent(in) | over_bml, | ||
| integer, dimension(:), intent(in) | spindex, | ||
| integer, dimension(:), intent(in) | norbi, | ||
| real(dp), dimension(:,:), intent(in) | coordinates, | ||
| real(dp), dimension(:), intent(inout), allocatable | rspfunc, | ||
| integer, intent(in) | verbose | ||
| ) |
Project the response onto atomic positions. First order response to the perturbation ( \( \rho^{(1)} \)) projected onto the atomic position. Basically: \( rsp(i) = \sum_{\alpha \in i}\rho^{(1)}_{\alpha \alpha} \), where orbital \( \alpha \) belong to atom \( i \).
| rsp_bml | First order response density matrix. |
| spindex | It gives the species index of a particular atom. |
| norbi | Number of orbitals of species i. |
| coordinates | Atomic coordinates. |
| rspfunc | Response function at atomic positions. |
| verbose | Different levels of verbosity. |
Definition at line 797 of file prg_response_mod.F90.
| subroutine, public prg_response_mod::prg_write_dipole_tcl | ( | real(dp), dimension(3), intent(in) | dipoleMoment, |
| character(*), intent(in) | file, | ||
| real(dp), intent(in) | factor, | ||
| integer | verbose | ||
| ) |
To visualize a dipole moment using VMD. This will prg_generate a .tcl script that could be run using VMD To visualize with VMD: $ vmd -e dipole.tcl.
| dipoleMoment | Dipole moment vector. |
| file | PDB/XYZ file to load for visualization. |
| factor | Arbitrary scale for visualization. |
| verbose | To give different verbosity levels. |
Definition at line 160 of file prg_response_mod.F90.
|
private |
Definition at line 18 of file prg_response_mod.F90.
|
private |
Definition at line 19 of file prg_response_mod.F90.