(git:1f9fd2c)
Loading...
Searching...
No Matches
transport.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 routines for DFT+NEGF calculations (coupling with the quantum transport code OMEN)
10!> \par History
11!> 12.2012 created external_scf_method [Hossein Bani-Hashemian]
12!> 05.2013 created rotines to work with C-interoperable matrices [Hossein Bani-Hashemian]
13!> 07.2013 created transport_env routines [Hossein Bani-Hashemian]
14!> 11.2014 switch to CSR matrices [Hossein Bani-Hashemian]
15!> 12.2014 merged [Hossein Bani-Hashemian]
16!> 04.2016 added imaginary DM and current density cube [Hossein Bani-Hashemian]
17!> \author Mohammad Hossein Bani-Hashemian
18! **************************************************************************************************
20 USE iso_c_binding, ONLY: c_associated,&
21 c_bool,&
22 c_double,&
23 c_f_procpointer,&
24 c_int,&
25 c_loc,&
26 c_null_ptr,&
27 c_ptr
30 USE bibliography, ONLY: bruck2014,&
31 cite_reference
33 USE cp_dbcsr_api, ONLY: &
35 dbcsr_csr_create, dbcsr_csr_create_from_dbcsr, dbcsr_csr_dbcsr_blkrow_dist, &
36 dbcsr_csr_print_sparsity, dbcsr_csr_type, dbcsr_deallocate_matrix, dbcsr_desymmetrize, &
37 dbcsr_has_symmetry, dbcsr_set, dbcsr_type, dbcsr_type_no_symmetry
42 USE cp_output_handling, ONLY: cp_p_file,&
52 USE kinds, ONLY: dp
56 USE physcon, ONLY: boltzmann,&
57 e_charge,&
58 evolt,&
59 h_bar
60 USE pw_env_types, ONLY: pw_env_get,&
62 USE pw_methods, ONLY: pw_zero
64 USE pw_types, ONLY: pw_c1d_gs_type,&
69 USE qs_kind_types, ONLY: get_qs_kind,&
74 USE qs_rho_types, ONLY: qs_rho_get,&
83#include "./base/base_uses.f90"
84
85 IMPLICIT NONE
86 PRIVATE
87
88 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'transport'
89
91 PUBLIC :: qs_scf_post_transport
92
93!> interface between C/C++ and FORTRAN
94 INTERFACE c_func_interface
95! **************************************************************************************************
96!> \brief C routine that takes the S and H matrices as input and outputs a P matrix
97!> \param cp2k_transport_params transport parameters read form a CP2K input file
98!> \param s_mat C-interoperable overlap matrix
99!> \param ks_mat C-interoperable Kohn-Sham matrix
100!> \param p_mat C-interoperable density matrix
101!> \param imagp_mat C-interoperable imaginary density matrix
102!> \author Mohammad Hossein Bani-Hashemian
103! **************************************************************************************************
104 SUBROUTINE c_scf_routine(cp2k_transport_params, s_mat, ks_mat, p_mat, imagp_mat) BIND(C)
105 IMPORT :: c_int, c_ptr, cp2k_csr_interop_type, cp2k_transport_parameters
106 TYPE(cp2k_transport_parameters), VALUE, INTENT(IN) :: cp2k_transport_params
107 TYPE(cp2k_csr_interop_type), VALUE, INTENT(IN) :: s_mat
108 TYPE(cp2k_csr_interop_type), VALUE, INTENT(IN) :: ks_mat
109 TYPE(cp2k_csr_interop_type), INTENT(INOUT) :: p_mat
110 TYPE(cp2k_csr_interop_type), INTENT(INOUT) :: imagp_mat
111 END SUBROUTINE c_scf_routine
112 END INTERFACE c_func_interface
113
114CONTAINS
115
116! **************************************************************************************************
117!> \brief creates the transport environment
118!> \param[inout] qs_env the qs_env containing the transport_env
119!> \author Mohammad Hossein Bani-Hashemian
120! **************************************************************************************************
121 SUBROUTINE transport_env_create(qs_env)
122 TYPE(qs_environment_type), POINTER :: qs_env
123
124 CHARACTER(LEN=*), PARAMETER :: routinen = 'transport_env_create'
125
126 INTEGER :: handle
127 TYPE(dft_control_type), POINTER :: dft_control
128 TYPE(section_vals_type), POINTER :: input
129 TYPE(transport_env_type), POINTER :: transport_env
130
131 CALL timeset(routinen, handle)
132
133 CALL get_qs_env(qs_env, &
134 transport_env=transport_env, &
135 dft_control=dft_control, &
136 input=input)
137
138 cpassert(.NOT. ASSOCIATED(transport_env))
139
140 ALLOCATE (transport_env)
141
142 CALL transport_init_read_input(input, transport_env)
143 CALL transport_set_contact_params(qs_env, transport_env)
144
145 CALL set_qs_env(qs_env, transport_env=transport_env)
146
147 CALL timestop(handle)
148
149 END SUBROUTINE transport_env_create
150
151! **************************************************************************************************
152!> \brief intitializes all fields of transport_env using the parameters read from
153!> the corresponding input section
154!> \param[inout] input the input file
155!> \param[inout] transport_env the transport_env to be initialized
156!> \author Mohammad Hossein Bani-Hashemian
157! **************************************************************************************************
158 SUBROUTINE transport_init_read_input(input, transport_env)
159 TYPE(section_vals_type), POINTER :: input
160 TYPE(transport_env_type), INTENT(INOUT) :: transport_env
161
162 CHARACTER(len=*), PARAMETER :: routinen = 'transport_init_read_input'
163
164 INTEGER :: contact_bandwidth, contact_injsign, &
165 contact_natoms, contact_start, handle, &
166 i, n_contacts, stride_contacts
167 INTEGER, DIMENSION(:), POINTER :: i_vals
168 LOGICAL :: contact_explicit, injecting_contact, &
169 obc_equilibrium, one_circle
170 TYPE(section_vals_type), POINTER :: beyn_section, contact_section, &
171 pexsi_section, transport_section
172
173 CALL timeset(routinen, handle)
174
175 transport_section => section_vals_get_subs_vals(input, "DFT%TRANSPORT")
176 contact_section => section_vals_get_subs_vals(transport_section, "CONTACT")
177 beyn_section => section_vals_get_subs_vals(transport_section, "BEYN")
178 pexsi_section => section_vals_get_subs_vals(transport_section, "PEXSI")
179 CALL section_vals_get(contact_section, explicit=contact_explicit, n_repetition=n_contacts)
180
181 NULLIFY (i_vals)
182! read from input
183 CALL section_vals_val_get(transport_section, "TRANSPORT_METHOD", i_val=transport_env%params%method)
184 CALL section_vals_val_get(transport_section, "INJECTION_METHOD", i_val=transport_env%params%injection_method)
185 CALL section_vals_val_get(transport_section, "REAL_AXIS_INTEGRATION_METHOD", &
186 i_val=transport_env%params%rlaxis_integration_method)
187 CALL section_vals_val_get(transport_section, "QT_FORMALISM", i_val=transport_env%params%qt_formalism)
188 CALL section_vals_val_get(transport_section, "LINEAR_SOLVER", i_val=transport_env%params%linear_solver)
189 CALL section_vals_val_get(transport_section, "MATRIX_INVERSION_METHOD", &
190 i_val=transport_env%params%matrixinv_method)
191 CALL section_vals_val_get(transport_section, "CONTACT_FILLING", i_val=transport_env%params%transport_neutral)
192 CALL section_vals_val_get(transport_section, "N_KPOINTS", i_val=transport_env%params%n_kpoint)
193 CALL section_vals_val_get(transport_section, "NUM_INTERVAL", i_val=transport_env%params%num_interval)
194 CALL section_vals_val_get(transport_section, "TASKS_PER_ENERGY_POINT", &
195 i_val=transport_env%params%tasks_per_energy_point)
196 CALL section_vals_val_get(transport_section, "TASKS_PER_POLE", i_val=transport_env%params%tasks_per_pole)
197 CALL section_vals_val_get(transport_section, "NUM_POLE", i_val=transport_env%params%num_pole)
198 CALL section_vals_val_get(transport_section, "GPUS_PER_POINT", i_val=transport_env%params%gpus_per_point)
199 CALL section_vals_val_get(transport_section, "N_POINTS_INV", i_val=transport_env%params%n_points_inv)
200 CALL section_vals_val_get(transport_section, "COLZERO_THRESHOLD", r_val=transport_env%params%colzero_threshold)
201 CALL section_vals_val_get(transport_section, "EPS_LIMIT", r_val=transport_env%params%eps_limit)
202 CALL section_vals_val_get(transport_section, "EPS_LIMIT_CC", r_val=transport_env%params%eps_limit_cc)
203 CALL section_vals_val_get(transport_section, "EPS_DECAY", r_val=transport_env%params%eps_decay)
204 CALL section_vals_val_get(transport_section, "EPS_SINGULARITY_CURVATURES", &
205 r_val=transport_env%params%eps_singularity_curvatures)
206 CALL section_vals_val_get(transport_section, "EPS_MU", r_val=transport_env%params%eps_mu)
207 CALL section_vals_val_get(transport_section, "EPS_EIGVAL_DEGEN", r_val=transport_env%params%eps_eigval_degen)
208 CALL section_vals_val_get(transport_section, "EPS_FERMI", r_val=transport_env%params%eps_fermi)
209 CALL section_vals_val_get(transport_section, "ENERGY_INTERVAL", r_val=transport_env%params%energy_interval)
210 CALL section_vals_val_get(transport_section, "MIN_INTERVAL", r_val=transport_env%params%min_interval)
211 CALL section_vals_val_get(transport_section, "TEMPERATURE", r_val=transport_env%params%temperature)
212 CALL section_vals_val_get(transport_section, "DENSITY_MIXING", r_val=transport_env%params%dens_mixing)
213 CALL section_vals_val_get(transport_section, "CSR_SCREENING", l_val=transport_env%csr_screening)
214
215 ! logical*1 to logical*4 , l_val is logical*1 and c_bool is equivalent to logical*4
216 CALL section_vals_val_get(transport_section, "OBC_EQUILIBRIUM", l_val=obc_equilibrium)
217 IF (obc_equilibrium) THEN
218 transport_env%params%obc_equilibrium = .true.
219 ELSE
220 transport_env%params%obc_equilibrium = .false.
221 END IF
222
223 CALL section_vals_val_get(transport_section, "CUTOUT", i_vals=i_vals)
224 transport_env%params%cutout = i_vals
225
226 CALL section_vals_val_get(beyn_section, "TASKS_PER_INTEGRATION_POINT", &
227 i_val=transport_env%params%tasks_per_integration_point)
228 CALL section_vals_val_get(beyn_section, "N_POINTS_BEYN", i_val=transport_env%params%n_points_beyn)
229 CALL section_vals_val_get(beyn_section, "N_RAND", r_val=transport_env%params%n_rand_beyn)
230 CALL section_vals_val_get(beyn_section, "N_RAND_CC", r_val=transport_env%params%n_rand_cc_beyn)
231 CALL section_vals_val_get(beyn_section, "SVD_CUTOFF", r_val=transport_env%params%svd_cutoff)
232 CALL section_vals_val_get(beyn_section, "ONE_CIRCLE", l_val=one_circle)
233 IF (one_circle) THEN
234 transport_env%params%ncrc_beyn = 1
235 ELSE
236 transport_env%params%ncrc_beyn = 2
237 END IF
238
239 CALL section_vals_val_get(pexsi_section, "ORDERING", i_val=transport_env%params%ordering)
240 CALL section_vals_val_get(pexsi_section, "ROW_ORDERING", i_val=transport_env%params%row_ordering)
241 CALL section_vals_val_get(pexsi_section, "VERBOSITY", i_val=transport_env%params%verbosity)
242 CALL section_vals_val_get(pexsi_section, "NP_SYMB_FACT", i_val=transport_env%params%pexsi_np_symb_fact)
243
244 IF (contact_explicit) THEN
245 transport_env%params%num_contacts = n_contacts
246 stride_contacts = 5
247 transport_env%params%stride_contacts = stride_contacts
248 ALLOCATE (transport_env%contacts_data(stride_contacts*n_contacts))
249
250 DO i = 1, n_contacts
251 CALL section_vals_val_get(contact_section, "BANDWIDTH", i_rep_section=i, i_val=contact_bandwidth)
252 CALL section_vals_val_get(contact_section, "START", i_rep_section=i, i_val=contact_start)
253 CALL section_vals_val_get(contact_section, "N_ATOMS", i_rep_section=i, i_val=contact_natoms)
254 CALL section_vals_val_get(contact_section, "INJECTION_SIGN", i_rep_section=i, i_val=contact_injsign)
255 CALL section_vals_val_get(contact_section, "INJECTING_CONTACT", i_rep_section=i, l_val=injecting_contact)
256
257 IF (contact_natoms <= 0) cpabort("Number of atoms in contact region needs to be defined.")
258
259 transport_env%contacts_data((i - 1)*stride_contacts + 1) = contact_bandwidth
260 transport_env%contacts_data((i - 1)*stride_contacts + 2) = contact_start - 1 ! C indexing
261 transport_env%contacts_data((i - 1)*stride_contacts + 3) = contact_natoms
262 transport_env%contacts_data((i - 1)*stride_contacts + 4) = contact_injsign
263
264 IF (injecting_contact) THEN
265 transport_env%contacts_data((i - 1)*stride_contacts + 5) = 1
266 ELSE
267 transport_env%contacts_data((i - 1)*stride_contacts + 5) = 0
268 END IF
269 END DO
270 transport_env%params%contacts_data = c_loc(transport_env%contacts_data(1))
271 ELSE
272 cpabort("No contact region is defined.")
273 END IF
274
275 CALL timestop(handle)
276
277 END SUBROUTINE transport_init_read_input
278
279! **************************************************************************************************
280!> \brief initializes the transport environment
281!> \param ks_env ...
282!> \param[inout] transport_env the transport env to be initialized
283!> \param[in] template_matrix template matrix to keep the sparsity of matrices fixed
284!> \author Mohammad Hossein Bani-Hashemian
285! **************************************************************************************************
286 SUBROUTINE transport_initialize(ks_env, transport_env, template_matrix)
287 TYPE(qs_ks_env_type), POINTER :: ks_env
288 TYPE(transport_env_type), INTENT(INOUT) :: transport_env
289 TYPE(dbcsr_type), INTENT(IN) :: template_matrix
290
291 CHARACTER(len=*), PARAMETER :: routinen = 'transport_initialize'
292
293 INTEGER :: handle, numnodes, unit_nr
294 TYPE(cp_logger_type), POINTER :: logger
295
296 CALL timeset(routinen, handle)
297
298 CALL cite_reference(bruck2014)
299
300 logger => cp_get_default_logger()
301 IF (logger%para_env%is_source()) THEN
302 unit_nr = cp_logger_get_default_unit_nr(logger, local=.true.)
303 ELSE
304 unit_nr = -1
305 END IF
306
307 numnodes = logger%para_env%num_pe
308
309 IF (dbcsr_has_symmetry(template_matrix)) THEN
310 CALL dbcsr_copy(transport_env%template_matrix_sym, template_matrix)
311 CALL dbcsr_desymmetrize(transport_env%template_matrix_sym, transport_env%template_matrix_nosym)
312 ELSE
313 CALL dbcsr_copy(transport_env%template_matrix_nosym, template_matrix)
314 CALL dbcsr_copy(transport_env%template_matrix_sym, template_matrix)
315 END IF
316
317 ALLOCATE (transport_env%dm_imag)
318 CALL dbcsr_create(transport_env%dm_imag, "imaginary DM", &
319 template=template_matrix, matrix_type=dbcsr_type_no_symmetry)
320 CALL dbcsr_set(transport_env%dm_imag, 0.0_dp)
321
322 CALL dbcsr_create(transport_env%csr_sparsity, "CSR sparsity", &
323 template=transport_env%template_matrix_sym)
324 CALL dbcsr_copy(transport_env%csr_sparsity, transport_env%template_matrix_sym)
325
326 CALL cp_dbcsr_to_csr_screening(ks_env, transport_env%csr_sparsity)
327
328 IF (.NOT. transport_env%csr_screening) CALL dbcsr_set(transport_env%csr_sparsity, 1.0_dp)
329 CALL dbcsr_csr_create_from_dbcsr(transport_env%template_matrix_nosym, &
330 transport_env%s_matrix, &
331 dbcsr_csr_dbcsr_blkrow_dist, &
332 csr_sparsity=transport_env%csr_sparsity, &
333 numnodes=numnodes)
334
335 CALL dbcsr_csr_print_sparsity(transport_env%s_matrix, unit_nr)
336
337 CALL dbcsr_convert_dbcsr_to_csr(transport_env%template_matrix_nosym, transport_env%s_matrix)
338
339 CALL dbcsr_csr_create(transport_env%ks_matrix, transport_env%s_matrix)
340 CALL dbcsr_csr_create(transport_env%p_matrix, transport_env%s_matrix)
341 CALL dbcsr_csr_create(transport_env%imagp_matrix, transport_env%s_matrix)
342
343 CALL timestop(handle)
344
345 END SUBROUTINE transport_initialize
346
347! **************************************************************************************************
348!> \brief SCF calcualtion with an externally evaluated density matrix
349!> \param[inout] transport_env transport environment
350!> \param[in] matrix_s DBCSR overlap matrix
351!> \param[in] matrix_ks DBCSR Kohn-Sham matrix
352!> \param[inout] matrix_p DBCSR density matrix
353!> \param[in] nelectron_spin number of electrons
354!> \param[in] natoms number of atoms
355!> \param[in] energy_diff scf energy difference
356!> \param[in] iscf the current scf iteration
357!> \param[in] extra_scf whether or not an extra scf step will be performed
358!> \par History
359!> 12.2012 created [Hossein Bani-Hashemian]
360!> 12.2014 revised [Hossein Bani-Hashemian]
361!> \author Mohammad Hossein Bani-Hashemian
362! **************************************************************************************************
363 SUBROUTINE external_scf_method(transport_env, matrix_s, matrix_ks, matrix_p, &
364 nelectron_spin, natoms, energy_diff, iscf, extra_scf)
365
366 TYPE(transport_env_type), INTENT(INOUT) :: transport_env
367 TYPE(dbcsr_type), INTENT(IN) :: matrix_s, matrix_ks
368 TYPE(dbcsr_type), INTENT(INOUT) :: matrix_p
369 INTEGER, INTENT(IN) :: nelectron_spin, natoms
370 REAL(dp), INTENT(IN) :: energy_diff
371 INTEGER, INTENT(IN) :: iscf
372 LOGICAL, INTENT(IN) :: extra_scf
373
374 CHARACTER(len=*), PARAMETER :: routinen = 'external_scf_method'
375
376 TYPE(cp2k_csr_interop_type) :: imagp_mat, ks_mat, p_mat, s_mat
377
378 PROCEDURE(c_scf_routine), POINTER :: c_method
379 INTEGER :: handle
380
381 CALL timeset(routinen, handle)
382
383 CALL c_f_procpointer(transport_env%ext_c_method_ptr, c_method)
384 IF (.NOT. c_associated(transport_env%ext_c_method_ptr)) &
385 CALL cp_abort(__location__, &
386 "MISSING C/C++ ROUTINE: The TRANSPORT section is meant to be used together with an external "// &
387 "program, e.g. the quantum transport code OMEN, that provides CP2K with a density matrix.")
388
389 transport_env%params%n_occ = nelectron_spin
390 transport_env%params%n_atoms = natoms
391 transport_env%params%energy_diff = energy_diff
392 transport_env%params%evoltfactor = evolt
393 transport_env%params%e_charge = e_charge
394 transport_env%params%boltzmann = boltzmann
395 transport_env%params%h_bar = h_bar
396 transport_env%params%iscf = iscf
397 transport_env%params%extra_scf = LOGICAL(extra_scf, C_BOOL) ! C_BOOL and Fortran logical don't have the same size
398
399 CALL csr_interop_nullify(s_mat)
400 CALL csr_interop_nullify(ks_mat)
401 CALL csr_interop_nullify(p_mat)
402 CALL csr_interop_nullify(imagp_mat)
403
404 CALL dbcsr_copy(transport_env%template_matrix_sym, matrix_s, keep_sparsity=.true.)
405 CALL convert_dbcsr_to_csr_interop(transport_env%template_matrix_sym, transport_env%s_matrix, s_mat)
406
407 CALL dbcsr_copy(transport_env%template_matrix_sym, matrix_ks, keep_sparsity=.true.)
408 CALL convert_dbcsr_to_csr_interop(transport_env%template_matrix_sym, transport_env%ks_matrix, ks_mat)
409
410 CALL dbcsr_copy(transport_env%template_matrix_sym, matrix_p, keep_sparsity=.true.)
411 CALL convert_dbcsr_to_csr_interop(transport_env%template_matrix_sym, transport_env%p_matrix, p_mat)
412
413 CALL dbcsr_copy(transport_env%template_matrix_sym, matrix_s, keep_sparsity=.true.)
414 CALL convert_dbcsr_to_csr_interop(transport_env%template_matrix_sym, transport_env%imagp_matrix, imagp_mat)
415
416 CALL c_method(transport_env%params, s_mat, ks_mat, p_mat, imagp_mat)
417
418 CALL convert_csr_interop_to_dbcsr(p_mat, transport_env%p_matrix, transport_env%template_matrix_nosym)
419 CALL dbcsr_copy(matrix_p, transport_env%template_matrix_nosym)
420
421 CALL convert_csr_interop_to_dbcsr(imagp_mat, transport_env%imagp_matrix, transport_env%template_matrix_nosym)
422 CALL dbcsr_copy(transport_env%dm_imag, transport_env%template_matrix_nosym)
423
424 CALL timestop(handle)
425
426 END SUBROUTINE external_scf_method
427
428! **************************************************************************************************
429!> \brief converts a DBCSR matrix to a C-interoperable CSR matrix
430!> \param[in] dbcsr_mat DBCSR matrix to be converted
431!> \param[inout] csr_mat auxiliary CSR matrix
432!> \param[inout] csr_interop_mat C-interoperable CSR matrix
433!> \author Mohammad Hossein Bani-Hashemian
434! **************************************************************************************************
435 SUBROUTINE convert_dbcsr_to_csr_interop(dbcsr_mat, csr_mat, csr_interop_mat)
436
437 TYPE(dbcsr_type), INTENT(IN) :: dbcsr_mat
438 TYPE(dbcsr_csr_type), INTENT(INOUT) :: csr_mat
439 TYPE(cp2k_csr_interop_type), INTENT(INOUT) :: csr_interop_mat
440
441 CHARACTER(LEN=*), PARAMETER :: routinen = 'convert_dbcsr_to_csr_interop'
442
443 INTEGER :: handle
444 INTEGER, ALLOCATABLE, DIMENSION(:) :: nrows_local_all, first_row_all
445 INTEGER(C_INT), DIMENSION(:), POINTER :: colind_local, rowptr_local, nzerow_local
446 REAL(c_double), DIMENSION(:), POINTER :: nzvals_local
447 TYPE(cp_logger_type), POINTER :: logger
448
449 CALL timeset(routinen, handle)
450
451 logger => cp_get_default_logger()
452
453! dbcsr to csr
454 CALL dbcsr_convert_dbcsr_to_csr(dbcsr_mat, csr_mat)
455
456! csr to csr_interop
457 rowptr_local => csr_mat%rowptr_local
458 colind_local => csr_mat%colind_local
459 nzerow_local => csr_mat%nzerow_local
460 nzvals_local => csr_mat%nzval_local%r_dp ! support real double percision for now
461
462 IF (SIZE(rowptr_local) == 0) THEN
463 csr_interop_mat%rowptr_local = c_null_ptr
464 ELSE
465 csr_interop_mat%rowptr_local = c_loc(rowptr_local(1))
466 END IF
467
468 IF (SIZE(colind_local) == 0) THEN
469 csr_interop_mat%colind_local = c_null_ptr
470 ELSE
471 csr_interop_mat%colind_local = c_loc(colind_local(1))
472 END IF
473
474 IF (SIZE(nzerow_local) == 0) THEN
475 csr_interop_mat%nzerow_local = c_null_ptr
476 ELSE
477 csr_interop_mat%nzerow_local = c_loc(nzerow_local(1))
478 END IF
479
480 IF (SIZE(nzvals_local) == 0) THEN
481 csr_interop_mat%nzvals_local = c_null_ptr
482 ELSE
483 csr_interop_mat%nzvals_local = c_loc(nzvals_local(1))
484 END IF
485
486 associate(mp_group => logger%para_env, mepos => logger%para_env%mepos, num_pe => logger%para_env%num_pe)
487 ALLOCATE (nrows_local_all(0:num_pe - 1), first_row_all(0:num_pe - 1))
488 CALL mp_group%allgather(csr_mat%nrows_local, nrows_local_all)
489 CALL cumsum_i(nrows_local_all, first_row_all)
490
491 IF (mepos == 0) THEN
492 csr_interop_mat%first_row = 0
493 ELSE
494 csr_interop_mat%first_row = first_row_all(mepos - 1)
495 END IF
496 END associate
497 csr_interop_mat%nrows_total = csr_mat%nrows_total
498 csr_interop_mat%ncols_total = csr_mat%ncols_total
499 csr_interop_mat%nze_local = csr_mat%nze_local
500 IF (csr_mat%nze_total > huge(csr_interop_mat%nze_total)) THEN
501 cpabort("overflow in nze")
502 END IF
503 csr_interop_mat%nze_total = int(csr_mat%nze_total, kind=kind(csr_interop_mat%nze_total))
504 csr_interop_mat%nrows_local = csr_mat%nrows_local
505 csr_interop_mat%data_type = csr_mat%nzval_local%data_type
506
507 CALL timestop(handle)
508
509 CONTAINS
510! **************************************************************************************************
511!> \brief cumulative sum of a 1d array of integers
512!> \param[in] arr input array
513!> \param[out] cumsum cumulative sum of the input array
514! **************************************************************************************************
515 SUBROUTINE cumsum_i(arr, cumsum)
516 INTEGER, DIMENSION(:), INTENT(IN) :: arr
517 INTEGER, DIMENSION(SIZE(arr)), INTENT(OUT) :: cumsum
518
519 INTEGER :: i
520
521 cumsum(1) = arr(1)
522 DO i = 2, SIZE(arr)
523 cumsum(i) = cumsum(i - 1) + arr(i)
524 END DO
525 END SUBROUTINE cumsum_i
526
527 END SUBROUTINE convert_dbcsr_to_csr_interop
528
529! **************************************************************************************************
530!> \brief converts a C-interoperable CSR matrix to a DBCSR matrix
531!> \param[in] csr_interop_mat C-interoperable CSR matrix
532!> \param[inout] csr_mat auxiliary CSR matrix
533!> \param[inout] dbcsr_mat DBCSR matrix
534!> \author Mohammad Hossein Bani-Hashemian
535! **************************************************************************************************
536 SUBROUTINE convert_csr_interop_to_dbcsr(csr_interop_mat, csr_mat, dbcsr_mat)
537
538 TYPE(cp2k_csr_interop_type), INTENT(IN) :: csr_interop_mat
539 TYPE(dbcsr_csr_type), INTENT(INOUT) :: csr_mat
540 TYPE(dbcsr_type), INTENT(INOUT) :: dbcsr_mat
541
542 CHARACTER(LEN=*), PARAMETER :: routinen = 'convert_csr_interop_to_dbcsr'
543
544 INTEGER :: data_type, handle, ncols_total, &
545 nrows_local, nrows_total, nze_local, &
546 nze_total
547 INTEGER, DIMENSION(:), POINTER :: colind_local, nzerow_local, rowptr_local
548 REAL(dp), DIMENSION(:), POINTER :: nzvals_local
549
550 CALL timeset(routinen, handle)
551
552! csr_interop to csr
553 CALL csr_interop_matrix_get_info(csr_interop_mat, &
554 nrows_total=nrows_total, ncols_total=ncols_total, nze_local=nze_local, &
555 nze_total=nze_total, nrows_local=nrows_local, data_type=data_type, &
556 rowptr_local=rowptr_local, colind_local=colind_local, &
557 nzerow_local=nzerow_local, nzvals_local=nzvals_local)
558
559 csr_mat%nrows_total = nrows_total
560 csr_mat%ncols_total = ncols_total
561 csr_mat%nze_local = nze_local
562 csr_mat%nze_total = nze_total
563 csr_mat%nrows_local = nrows_local
564 csr_mat%nzval_local%data_type = data_type
565
566 csr_mat%rowptr_local = rowptr_local
567 csr_mat%colind_local = colind_local
568 csr_mat%nzerow_local = nzerow_local
569 csr_mat%nzval_local%r_dp = nzvals_local
570
571! csr to dbcsr
572 CALL dbcsr_convert_csr_to_dbcsr(dbcsr_mat, csr_mat)
573
574 CALL timestop(handle)
575
576 END SUBROUTINE convert_csr_interop_to_dbcsr
577
578! **************************************************************************************************
579!> \brief extraxts zeff (effective nuclear charges per atom) and nsgf (the size
580!> of spherical Gaussian basis functions per atom) from qs_env and initializes
581!> the corresponding arrays in transport_env%params
582!> \param[in] qs_env qs environment
583!> \param[inout] transport_env transport environment
584!> \author Mohammad Hossein Bani-Hashemian
585! **************************************************************************************************
586 SUBROUTINE transport_set_contact_params(qs_env, transport_env)
587 TYPE(qs_environment_type), POINTER :: qs_env
588 TYPE(transport_env_type), INTENT(INOUT) :: transport_env
589
590 INTEGER :: i, iat, ikind, natom, nkind
591 INTEGER, DIMENSION(:), POINTER :: atom_list
592 REAL(kind=dp) :: zeff
593 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
594 TYPE(atomic_kind_type), POINTER :: atomic_kind
595 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
596 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
597
598 CALL get_qs_env(qs_env, nkind=nkind, natom=natom)
599 CALL get_qs_env(qs_env, particle_set=particle_set, &
600 qs_kind_set=qs_kind_set, &
601 atomic_kind_set=atomic_kind_set)
602
603 ALLOCATE (transport_env%nsgf(natom))
604 ALLOCATE (transport_env%zeff(natom))
605 CALL get_particle_set(particle_set, qs_kind_set, nsgf=transport_env%nsgf)
606
607 ! reference charges
608 DO ikind = 1, nkind
609 CALL get_qs_kind(qs_kind_set(ikind), zeff=zeff)
610 atomic_kind => atomic_kind_set(ikind)
611 CALL get_atomic_kind(atomic_kind, atom_list=atom_list)
612 DO iat = 1, SIZE(atom_list)
613 i = atom_list(iat)
614 transport_env%zeff(i) = zeff
615 END DO
616 END DO
617
618 IF (natom == 0) THEN
619 transport_env%params%nsgf = c_null_ptr
620 transport_env%params%zeff = c_null_ptr
621 ELSE
622 transport_env%params%nsgf = c_loc(transport_env%nsgf(1))
623 transport_env%params%zeff = c_loc(transport_env%zeff(1))
624 END IF
625
626 END SUBROUTINE transport_set_contact_params
627
628!**************************************************************************************************
629!> \brief evaluates current density using the imaginary part of the density matrix and prints it
630!> into cube files
631!> \param[in] input the input
632!> \param[in] qs_env qs environment
633!> \author Mohammad Hossein Bani-Hashemian
634! **************************************************************************************************
635 SUBROUTINE transport_current(input, qs_env)
636 TYPE(section_vals_type), POINTER :: input
637 TYPE(qs_environment_type), POINTER :: qs_env
638
639 CHARACTER(len=*), PARAMETER :: routinen = 'transport_current'
640
641 CHARACTER(len=14) :: ext
642 CHARACTER(len=2) :: sdir
643 INTEGER :: dir, handle, unit_nr
644 LOGICAL :: do_current_cube, do_transport, mpi_io
645 TYPE(cp_logger_type), POINTER :: logger
646 TYPE(current_env_type) :: current_env
647 TYPE(dbcsr_type), POINTER :: zero
648 TYPE(dft_control_type), POINTER :: dft_control
649 TYPE(particle_list_type), POINTER :: particles
650 TYPE(pw_c1d_gs_type) :: gs
651 TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g
652 TYPE(pw_env_type), POINTER :: pw_env
653 TYPE(pw_pool_type), POINTER :: auxbas_pw_pool
654 TYPE(pw_r3d_rs_type) :: rs
655 TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r
656 TYPE(qs_rho_type), POINTER :: rho
657 TYPE(qs_subsys_type), POINTER :: subsys
658 TYPE(section_vals_type), POINTER :: dft_section
659 TYPE(transport_env_type), POINTER :: transport_env
660
661 CALL timeset(routinen, handle)
662
663 logger => cp_get_default_logger()
664 dft_section => section_vals_get_subs_vals(input, "DFT")
665 CALL get_qs_env(qs_env=qs_env, &
666 subsys=subsys, &
667 pw_env=pw_env, &
668 transport_env=transport_env, &
669 do_transport=do_transport, &
670 dft_control=dft_control, &
671 rho=rho)
672 CALL qs_subsys_get(subsys, particles=particles)
673 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
674 CALL qs_rho_get(rho, rho_r=rho_r, rho_g=rho_g)
675
676 do_current_cube = btest(cp_print_key_should_output(logger%iter_info, input, &
677 "DFT%TRANSPORT%PRINT%CURRENT"), cp_p_file)
678
679 ! check if transport is active i.e. the imaginary dm has been actually passed to cp2k by the external code
680 IF (do_transport) THEN
681 IF (c_associated(transport_env%ext_c_method_ptr)) THEN
682
683 ! calculate_jrho_resp uses sab_all which is not associated in DFTB environment
684 IF (dft_control%qs_control%dftb) cpabort("Current is not available for DFTB.")
685 IF (dft_control%qs_control%xtb) cpabort("Current is not available for xTB.")
686
687 ! now do the current
688 IF (do_current_cube) THEN
689 current_env%gauge = -1
690 current_env%gauge_init = .false.
691
692 CALL auxbas_pw_pool%create_pw(rs)
693 CALL auxbas_pw_pool%create_pw(gs)
694
695 NULLIFY (zero)
696 ALLOCATE (zero)
697 CALL dbcsr_create(zero, template=transport_env%dm_imag)
698 CALL dbcsr_copy(zero, transport_env%dm_imag)
699 CALL dbcsr_set(zero, 0.0_dp)
700
701 DO dir = 1, 3
702 CALL pw_zero(rs)
703 CALL pw_zero(gs)
704 CALL calculate_jrho_resp(zero, transport_env%dm_imag, &
705 zero, zero, dir, dir, rs, gs, qs_env, current_env, &
706 retain_rsgrid=.true.)
707 SELECT CASE (dir)
708 CASE (1)
709 sdir = "-x"
710 CASE (2)
711 sdir = "-y"
712 CASE (3)
713 sdir = "-z"
714 END SELECT
715 ext = sdir//".cube"
716 mpi_io = .true.
717 unit_nr = cp_print_key_unit_nr(logger, dft_section, "TRANSPORT%PRINT%CURRENT", &
718 extension=ext, file_status="REPLACE", file_action="WRITE", &
719 log_filename=.false., mpi_io=mpi_io)
720 CALL cp_pw_to_cube(rs, unit_nr, "Transport current", particles=particles, &
721 stride=section_get_ivals(dft_section, "TRANSPORT%PRINT%CURRENT%STRIDE"), &
722 mpi_io=mpi_io)
723 CALL cp_print_key_finished_output(unit_nr, logger, dft_section, "TRANSPORT%PRINT%CURRENT", &
724 mpi_io=mpi_io)
725 END DO
726
727 CALL dbcsr_deallocate_matrix(zero)
728 CALL auxbas_pw_pool%give_back_pw(rs)
729 CALL auxbas_pw_pool%give_back_pw(gs)
730 END IF
731 END IF
732
733 END IF
734
735 CALL timestop(handle)
736
737 END SUBROUTINE transport_current
738
739!**************************************************************************************************
740!> \brief post scf calculations for transport
741!> \param[in] qs_env qs environment
742!> \author Mohammad Hossein Bani-Hashemian
743! **************************************************************************************************
744 SUBROUTINE qs_scf_post_transport(qs_env)
745 TYPE(qs_environment_type), POINTER :: qs_env
746
747 CHARACTER(len=*), PARAMETER :: routinen = 'qs_scf_post_transport'
748
749 INTEGER :: handle
750 TYPE(section_vals_type), POINTER :: input
751
752 CALL timeset(routinen, handle)
753
754 NULLIFY (input)
755
756 CALL get_qs_env(qs_env=qs_env, &
757 input=input)
758
759 CALL transport_current(input, qs_env)
760
761 CALL timestop(handle)
762
763 END SUBROUTINE qs_scf_post_transport
764
765END MODULE transport
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public bruck2014
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
logical function, public dbcsr_has_symmetry(matrix)
...
subroutine, public dbcsr_convert_dbcsr_to_csr(dbcsr_mat, csr_mat)
...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
subroutine, public dbcsr_convert_csr_to_dbcsr(dbcsr_mat, csr_mat)
...
subroutine, public dbcsr_desymmetrize(matrix_a, matrix_b)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_csr_create_from_dbcsr(dbcsr_mat, csr_mat, dist_format, csr_sparsity, numnodes)
...
subroutine, public dbcsr_set(matrix, alpha)
...
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
A wrapper around pw_to_cube() which accepts particle_list_type.
subroutine, public cp_pw_to_cube(pw, unit_nr, title, particles, zeff, stride, max_file_size_mb, zero_tails, silent, mpi_io)
...
objects that represent the structure of input sections and the data contained in an input section
integer function, dimension(:), pointer, public section_get_ivals(section_vals, keyword_name)
...
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
represent a simple array based list of the given type
Define methods related to particle_type.
subroutine, public get_particle_set(particle_set, qs_kind_set, first_sgf, last_sgf, nsgf, nmao, basis, ncgf)
Get the components of a particle set.
Define the data structure for the particle information.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public boltzmann
Definition physcon.F:129
real(kind=dp), parameter, public e_charge
Definition physcon.F:106
real(kind=dp), parameter, public h_bar
Definition physcon.F:103
real(kind=dp), parameter, public evolt
Definition physcon.F:183
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
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.
subroutine, public set_qs_env(qs_env, super_cell, mos, qmmm, qmmm_periodic, mimic, ewald_env, ewald_pw, mpools, rho_external, external_vxc, mask, scf_control, rel_control, qs_charges, ks_env, ks_qmmm_env, wf_history, scf_env, active_space, input, oce, rho_atom_set, rho0_atom_set, rho0_mpole, run_rtp, rtp, rhoz_set, rhoz_tot, ecoul_1c, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, efield, rhoz_cneo_set, linres_control, xas_env, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, ls_scf_env, do_transport, transport_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, harris_env, gcp_env, mp2_env, bs_env, kg_env, force, kpoints, wanniercentres, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Set the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
given the response wavefunctions obtained by the application of the (rxp), p, and ((dk-dl)xp) operato...
subroutine, public calculate_jrho_resp(mat_d0, mat_jp, mat_jp_rii, mat_jp_riii, ib, idir, current_rs, current_gs, qs_env, current_env, soft_valid, retain_rsgrid)
Calculation of the idir component of the response current density in the presence of a constant magne...
Type definitiona for linear response calculations.
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
types that represent a quickstep subsys
subroutine, public qs_subsys_get(subsys, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...
CP2K transport environment and related C-interoperable types.
subroutine, public csr_interop_nullify(csr_interop_mat)
nullifies (and zeroizes) a C-interoperable CSR matrix
subroutine, public csr_interop_matrix_get_info(csr_interop_mat, nrows_total, ncols_total, nze_local, nze_total, nrows_local, data_type, first_row, rowptr_local, colind_local, nzerow_local, nzvals_local)
gets the fields of a C-interoperable CSR matrix
routines for DFT+NEGF calculations (coupling with the quantum transport code OMEN)
Definition transport.F:19
subroutine, public transport_env_create(qs_env)
creates the transport environment
Definition transport.F:122
subroutine, public external_scf_method(transport_env, matrix_s, matrix_ks, matrix_p, nelectron_spin, natoms, energy_diff, iscf, extra_scf)
SCF calcualtion with an externally evaluated density matrix.
Definition transport.F:365
subroutine, public transport_initialize(ks_env, transport_env, template_matrix)
initializes the transport environment
Definition transport.F:287
subroutine, public qs_scf_post_transport(qs_env)
post scf calculations for transport
Definition transport.F:745
Provides all information about an atomic kind.
CP2K's C-interoperable CSR matrix This definition matches the respective type definition in the trans...
Definition libcp2k.h:275
Transport parameters read from a CP2K input file. This definition matches the respective type definit...
Definition libcp2k.h:215
type of a logger, at the moment it contains just a print level starting at which level it should be l...
contained for different pw related things
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Provides all information about a quickstep kind.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
keeps the density in various representations, keeping track of which ones are valid.