(git:e8f5963)
Loading...
Searching...
No Matches
floquet_main.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Floquet stuff
10!> \par History
11!> \author Shridhar Shanbhag (27.01.2026)
12! **************************************************************************************************
15 USE cp_cfm_diag, ONLY: cp_cfm_heevd
16 USE cp_cfm_types, ONLY: cp_cfm_create,&
29 USE kinds, ONLY: dp
30 USE mathconstants, ONLY: pi,&
31 z_zero
33 USE physcon, ONLY: a_bohr,&
34 evolt
38 USE qs_mo_types, ONLY: get_mo_set,&
40#include "./base/base_uses.f90"
41
42 IMPLICIT NONE
43
44 PRIVATE
45
46 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'floquet_main'
47
48 ! Public subroutines
49 PUBLIC :: floquet
50
51CONTAINS
52
53! **************************************************************************************************
54!> \brief ...
55!> \param qs_env ...
56!> \param bs_env ...
57! **************************************************************************************************
58 SUBROUTINE floquet(qs_env, bs_env)
59 TYPE(qs_environment_type), POINTER :: qs_env
60 TYPE(post_scf_bandstructure_type), POINTER :: bs_env
61
62 CHARACTER(LEN=*), PARAMETER :: routinen = 'floquet'
63
64 INTEGER :: handle, ikp, ikp_for_file, ispin, &
65 max_f_index, n_e, n_f_size, n_fbands, &
66 n_spin, nao, nkp, nkp_start, unit_nr
67 INTEGER, ALLOCATABLE, DIMENSION(:) :: indices
68 REAL(kind=dp) :: energy_step, energy_window
69 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: a_k, eigenvalues
70 REAL(kind=dp), DIMENSION(3) :: xkp
71 TYPE(cp_blacs_env_type), POINTER :: blacs_env
72 TYPE(cp_cfm_type) :: cfm_eigenvectors, floquet_copy, &
73 floquet_matrix
74 TYPE(cp_fm_struct_type), POINTER :: floquet_struct
75 TYPE(mo_set_type), DIMENSION(:), POINTER :: mos
76 TYPE(mp_para_env_type), POINTER :: para_env
77
78 CALL timeset(routinen, handle)
79
80 CALL get_qs_env(qs_env, &
81 blacs_env=blacs_env, &
82 para_env=para_env, &
83 mos=mos)
84 CALL get_mo_set(mo_set=mos(1), nao=nao)
85
86 unit_nr = bs_env%unit_nr
87 nkp = bs_env%nkp_bs_and_DOS
88 nkp_start = bs_env%nkp_only_DOS
89 n_spin = bs_env%n_spin
90 max_f_index = bs_env%max_floquet_index
91 n_fbands = 1 + 2*max_f_index
92 n_f_size = nao*n_fbands
93
94 energy_step = bs_env%energy_step_floquet
95 energy_window = 2*bs_env%energy_window_floquet
96
97 n_e = int(energy_window/energy_step)
98
99 IF (unit_nr > 0) THEN
100
101 WRITE (unit_nr, '(T2,A)') ' '
102 WRITE (unit_nr, '(T2,A)') repeat('-', 79)
103 WRITE (unit_nr, '(T2,A,A78)') '-', '-'
104 WRITE (unit_nr, '(T2,A,A51,A27)') '-', 'FLOQUET BANDSTRUCTURE CALCULATION', '-'
105 WRITE (unit_nr, '(T2,A,A78)') '-', '-'
106 WRITE (unit_nr, '(T2,A)') repeat('-', 79)
107 WRITE (unit_nr, '(T2,A)') ' '
108
109 WRITE (unit_nr, '(T2,A,T56,ES12.2E2)') &
110 "FLOQUET PARAMETERS Amplitude [V/m]:", bs_env%floquet_amplitude*evolt/a_bohr
111 WRITE (unit_nr, '(T2,A,T56,F12.4)') &
112 " Frequency [eV]:", bs_env%floquet_omega*evolt
113 WRITE (unit_nr, '(T2,A)') " "//repeat("-", 44)
114 WRITE (unit_nr, '(T2,A,T56,3F8.4)') &
115 " Polarisation:", bs_env%floquet_polarisation(1:3)
116 WRITE (unit_nr, '(T2,A,T56,3F8.4)') &
117 " Phase offsets:", pi*bs_env%floquet_phi(1:3)
118 WRITE (unit_nr, '(T2,A)') " "//repeat("-", 44)
119 WRITE (unit_nr, '(T2,A,T56,I12)') &
120 " Max Floquet index:", bs_env%max_floquet_index
121 WRITE (unit_nr, '(T2,A,T56,I12)') &
122 " Floquet Hamiltonian Size:", n_f_size
123 WRITE (unit_nr, '(T2,A)') " "//repeat("-", 44)
124 WRITE (unit_nr, '(T2,A,T56,F12.4)') &
125 " Energy window [eV]:", bs_env%energy_window_floquet*evolt
126 WRITE (unit_nr, '(T2,A,T56,F12.4)') &
127 " Energy step [eV]:", bs_env%energy_step_floquet*evolt
128 WRITE (unit_nr, '(T2,A,T56,F12.4)') &
129 " Broadening [eV]:", bs_env%broadening_floquet*evolt
130 WRITE (unit_nr, '(T2,A)') " "//repeat("-", 44)
131 WRITE (unit_nr, '(A)') ""
132
133 WRITE (unit_nr, '(T2,A)') &
134 "We construct the Floquet-Bloch Hamiltonian and diagonalise to obtain the"
135 WRITE (unit_nr, '(T2,A)') &
136 "eigenvalues which give us the quasi-energies stored in QUASI_ENERGIES.bs"
137 WRITE (unit_nr, '(A)') ""
138 WRITE (unit_nr, '(T2,A)') &
139 "The k-resolved density of states is obtained by computing the trace of"
140 WRITE (unit_nr, '(T2,A)') &
141 "the retarded Green's function and stored in FLOQUET_DOS.out"
142 WRITE (unit_nr, '(T2,A)') &
143 ωπω"DOS(,k) = -1/*Im[Tr_KS(G^R(,k))]"
144 WRITE (unit_nr, '(A)') ""
145 WRITE (unit_nr, '(T2,A)') "Calculations completed for:"
146 WRITE (unit_nr, '(2X,A,T12,A,T22,A)') "KPoint", "Spin", "Coordinate"
147 END IF
148
149 CALL cp_fm_struct_create(floquet_struct, &
150 nrow_global=n_f_size, &
151 ncol_global=n_f_size, &
152 context=blacs_env, &
153 para_env=para_env)
154
155 CALL cp_cfm_create(floquet_matrix, floquet_struct, set_zero=.true.)
156 CALL cp_cfm_create(floquet_copy, floquet_struct, set_zero=.true.)
157 CALL cp_cfm_create(cfm_eigenvectors, floquet_struct, set_zero=.true.)
158 ALLOCATE (eigenvalues(n_f_size), indices(nao))
159 ALLOCATE (a_k(n_e))
160 DO ikp = nkp_start + 1, nkp
161
162 xkp(1:3) = bs_env%kpoints_DOS%xkp(1:3, ikp)
163 ikp_for_file = ikp - nkp_start
164
165 DO ispin = 1, n_spin
166 ! Build the Floquet-Bloch Hamiltonian matrix H_F(k), with the equilibrium
167 ! band energies ε_{nk} on the diagonal (shifted by mħΩ per sector) and
168 ! the light-matter coupling blocks A . p_uv on the off-diagonals
169 CALL build_floquet_matrix(qs_env, bs_env, xkp, ispin, floquet_matrix)
170
171 ! Use a copy of the Floquet matrix for diagonalization, since
172 ! cp_cfm_heevd overwrites it (needed later for the Green's function)
173 CALL cp_cfm_to_cfm(floquet_matrix, floquet_copy)
174
175 ! Diagonalize the Floquet-Bloch matrix H_F(k) F_{α,k} = ε_α F_{α,k}
176 ! to obtain the quasi-energies ε_α (eigenvalues) and the
177 ! Floquet-Bloch coefficients F^{nu}_{α,k} (eigenvectors)
178 CALL cp_cfm_set_all(cfm_eigenvectors, z_zero)
179 CALL cp_cfm_heevd(floquet_copy, cfm_eigenvectors, eigenvalues)
180
181 ! Run a conversion check to ensure that MAX_FLOQUET_INDEX,
182 ! the size of the truncated matrix H_F(k), is sufficiently large.
183 CALL check_floquet_conversion(qs_env, bs_env, cfm_eigenvectors)
184
185 ! Write the quasi-energies ε_α folded into the first Floquet Brillouin
186 ! zone -ħΩ/2 < ε_α ≤ ħΩ/2 for this k-point and spin channel
187 CALL write_quasi_energy(qs_env, bs_env, ispin, ikp_for_file, xkp, eigenvalues)
188
189 ! Compute the physical spectral function
190 ! A_phys(k,ω) = -(1/π) Im[ Tr_KS G^R_{00}(k,ω) ]
191 ! from the zero-zero Floquet sector of the retarded Green's function
192 CALL calculate_floquet_spectral_function(qs_env, bs_env, floquet_matrix, a_k)
193
194 ! Write A_phys(k,ω) (or f(ω,μ)·A_phys for the occupied spectral weight)
195 ! to output for this k-point and spin channel
196 CALL write_floquet_spectral_function(qs_env, bs_env, ispin, ikp_for_file, xkp, a_k)
197
198 ! Write progress in the main output file
199 IF (unit_nr > 0) WRITE (unit_nr, '(2X,I6,T12,I4,T18,3F12.6)') ikp_for_file, ispin, xkp(1:3)
200
201 END DO
202 END DO
203
204 IF (unit_nr > 0) WRITE (unit_nr, '(A)') ""
205 DEALLOCATE (eigenvalues)
206 CALL cp_cfm_release(floquet_matrix)
207 CALL cp_cfm_release(floquet_copy)
208 CALL cp_cfm_release(cfm_eigenvectors)
209 CALL cp_fm_struct_release(floquet_struct)
210
211 CALL timestop(handle)
212
213 END SUBROUTINE floquet
214
215END MODULE floquet_main
methods related to the blacs parallel environment
used for collecting diagonalization schemes available for cp_cfm_type
Definition cp_cfm_diag.F:14
subroutine, public cp_cfm_heevd(matrix, eigenvectors, eigenvalues)
Perform a diagonalisation of a complex matrix.
Definition cp_cfm_diag.F:74
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_release(matrix)
Releases a full matrix.
subroutine, public cp_cfm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
Creates a new full matrix with the given structure.
subroutine, public cp_cfm_set_all(matrix, alpha, beta)
Set all elements of the full matrix to alpha. Besides, set all diagonal matrix elements to beta (if g...
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
Floquet stuff.
subroutine, public floquet(qs_env, bs_env)
...
Floquet stuff.
subroutine, public write_floquet_spectral_function(qs_env, bs_env, ispin, ikp_for_file, xkp, a_k)
...
subroutine, public check_floquet_conversion(qs_env, bs_env, cfm_eigenvectors)
...
subroutine, public calculate_floquet_spectral_function(qs_env, bs_env, floquet_matrix, a_k)
...
subroutine, public build_floquet_matrix(qs_env, bs_env, xkp, ispin, floquet_matrix)
...
subroutine, public write_quasi_energy(qs_env, bs_env, ispin, ikp_for_file, xkp, eigenvalues)
...
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
complex(kind=dp), parameter, public z_zero
Interface to the message passing library MPI.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public a_bohr
Definition physcon.F:136
real(kind=dp), parameter, public evolt
Definition physcon.F:183
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
Definition and initialisation of the mo data type.
Definition qs_mo_types.F:22
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count)
Get the components of a MO set data structure.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
Represent a complex full matrix.
keeps the information about the structure of a full matrix
stores all the informations relevant to an mpi environment