30 use,
intrinsic :: iso_fortran_env
61 type(grid_t),
intent(in) :: gr
62 type(namespace_t),
intent(in) :: namespace
63 class(space_t),
intent(in) :: space
64 type(target_t),
intent(inout) :: tg
65 type(td_t),
intent(in) :: td
66 type(restart_t),
intent(inout) :: restart
67 type(kpoints_t),
intent(in) :: kpoints
71 message(1) =
'Info: Using Superposition of States for TargetOperator'
92 message(1) =
'If "OCTTargetOperator = oct_tg_superposition", then you must'
93 message(2) =
'supply an "OCTTargetTransformStates" block to create the superposition.'
104 type(target_t),
intent(in) :: tg
105 type(namespace_t),
intent(in) :: namespace
106 class(space_t),
intent(in) :: space
107 type(grid_t),
intent(in) :: gr
108 character(len=*),
intent(in) :: dir
109 type(ions_t),
intent(in) :: ions
110 type(hamiltonian_elec_t),
intent(in) :: hm
111 type(output_t),
intent(in) :: outp
115 call output_states(outp, namespace, space, trim(dir), tg%st, gr, ions, hm, -1)
125 real(real64) function target_j1_gstransformation(tg, gr, psi) result(j1)
126 type(target_t),
intent(in) :: tg
127 type(grid_t),
intent(in) :: gr
128 type(states_elec_t),
intent(in) :: psi
132 complex(real64),
allocatable :: zpsi(:, :), zst(:, :)
134 push_sub(target_j1_gstransformation)
136 safe_allocate(zpsi(1:gr%np, 1:tg%st%d%dim))
137 safe_allocate(zst(1:gr%np, 1:tg%st%d%dim))
141 do ist = psi%st_start, psi%st_end
146 j1 = j1 + abs(
zmf_dotp(gr, psi%d%dim, zpsi, zst))**2
151 safe_deallocate_a(zpsi)
152 safe_deallocate_a(zst)
154 pop_sub(target_j1_gstransformation)
161 type(target_t),
intent(in) :: tg
162 type(grid_t),
intent(in) :: gr
163 type(states_elec_t),
intent(in) :: psi_in
164 type(states_elec_t),
intent(inout) :: chi_out
167 complex(real64) :: olap
168 complex(real64),
allocatable :: zpsi(:, :), zst(:, :), zchi(:, :)
172 safe_allocate(zpsi(1:gr%np, 1:tg%st%d%dim))
173 safe_allocate(zst(1:gr%np, 1:tg%st%d%dim))
174 safe_allocate(zchi(1:gr%np, 1:tg%st%d%dim))
176 do ik = 1, psi_in%nik
177 do ist = psi_in%st_start, psi_in%st_end
179 call states_elec_get_state(psi_in, gr, ist, ik, zpsi)
180 call states_elec_get_state(tg%st, gr, ist, ik, zst)
182 olap = zmf_dotp(gr, zst(:, 1), zpsi(:, 1))
183 zchi(1:gr%np, 1:tg%st%d%dim) = olap*zst(1:gr%np, 1:tg%st%d%dim)
185 call states_elec_set_state(chi_out, gr, ist, ik, zchi)
190 safe_deallocate_a(zpsi)
191 safe_deallocate_a(zst)
192 safe_deallocate_a(zchi)
This module implements a calculator for the density and defines related functions.
subroutine, public density_calc(st, gr, density, istin)
Computes the density from the orbitals in st.
real(real64), parameter, public m_zero
This module implements the underlying real-space grid.
subroutine, public io_mkdir(fname, namespace, parents)
logical pure function, public ion_dynamics_ions_move(this)
This module defines various routines, operating on mesh functions.
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
this module contains the low-level part of the output system
this module contains the output system
subroutine, public output_states(outp, namespace, space, dir, st, gr, ions, hm, iter)
logical function, public parse_is_defined(namespace, name)
This module handles reading and writing restart information for the states_elec_t.
subroutine, public states_elec_transform(st, namespace, space, restart, mesh, kpoints, prefix)