55    type(states_elec_t) :: psi
 
   56    real(real64), 
allocatable :: q(:, :)
 
   57    real(real64), 
allocatable :: p(:, :)
 
   58    integer :: natoms, ndim
 
   65    type(opt_control_state_t), 
intent(inout) :: ocs
 
   69    safe_deallocate_a(ocs%q)
 
   70    safe_deallocate_a(ocs%p)
 
   71    call ocs%psi%nullify()
 
   78    type(opt_control_state_t), 
target, 
intent(in) :: ocs
 
   79    type(states_elec_t), 
pointer :: opt_control_point_qs
 
   81    push_sub(opt_control_point_qs)
 
   83    opt_control_point_qs => ocs%psi
 
   85    pop_sub(opt_control_point_qs)
 
   89    type(opt_control_state_t), 
target, 
intent(in) :: ocs
 
   90    real(real64), 
pointer :: opt_control_point_q(:, :)
 
   92    push_sub(opt_control_point_q)
 
   94    opt_control_point_q => ocs%q
 
   96    pop_sub(opt_control_point_q)
 
  100    type(opt_control_state_t), 
target, 
intent(in) :: ocs
 
  101    real(real64), 
pointer :: opt_control_point_p(:, :)
 
  103    push_sub(opt_control_point_p)
 
  105    opt_control_point_p => ocs%p
 
  107    pop_sub(opt_control_point_p)
 
  111    type(states_elec_t),       
intent(inout) :: qstate
 
  112    type(opt_control_state_t), 
intent(in)    :: ocs
 
  122    type(ions_t),              
intent(inout) :: ions
 
  123    type(opt_control_state_t), 
intent(in)    :: ocs
 
  125    integer :: idim, iatom
 
  129    do idim = 1, ions%space%dim
 
  130      do iatom = 1, ions%natoms
 
  131        ions%pos(idim, iatom) = ocs%q(iatom, idim)
 
  132        ions%vel(idim, iatom) = ocs%p(iatom, idim) / ions%mass(iatom)
 
  140    type(ions_t),              
intent(inout) :: ions
 
  141    type(opt_control_state_t), 
intent(inout) :: ocs
 
  143    integer :: idim, iatom
 
  147    do idim = 1, ions%space%dim
 
  148      do iatom = 1, ions%natoms
 
  149        ocs%q(iatom, idim) = ions%pos(idim, iatom)
 
  150        ocs%p(iatom, idim) = ions%vel(idim, iatom) * ions%mass(iatom)
 
  160    type(
ions_t),              
intent(in)    :: ions
 
  162    integer :: iatom, idim
 
  168    safe_deallocate_a(ocs%q)
 
  169    safe_deallocate_a(ocs%p)
 
  171    ocs%ndim   = ions%space%dim
 
  172    ocs%natoms = ions%natoms
 
  174    safe_allocate(ocs%q(1:ocs%natoms, 1:ocs%ndim))
 
  175    safe_allocate(ocs%p(1:ocs%natoms, 1:ocs%ndim))
 
  177    do idim = 1, ions%space%dim
 
  178      do iatom = 1, ions%natoms
 
  179        ocs%q(iatom, idim) = ions%pos(idim, iatom)
 
  180        ocs%p(iatom, idim) = ions%mass(iatom) * ions%vel(idim, iatom)
 
  194    safe_deallocate_a(ocs%q)
 
  195    safe_deallocate_a(ocs%p)
 
  208    ocsout%ndim = ocsin%ndim
 
  209    ocsout%natoms = ocsin%natoms
 
  210    safe_deallocate_a(ocsout%q)
 
  211    safe_deallocate_a(ocsout%p)
 
  212    if (
allocated(ocsin%q)) 
then 
  213      safe_allocate(ocsout%q(1:ocsout%natoms, 1:ocsout%ndim))
 
  216    if (
allocated(ocsin%p)) 
then 
  217      safe_allocate(ocsout%p(1:ocsout%natoms, 1:ocsout%ndim))
 
This module holds the "opt_control_state_t" datatype, which contains a quantum-classical state.
 
real(real64) function, dimension(:, :), pointer, public opt_control_point_p(ocs)
 
subroutine, public opt_control_set_classical(ions, ocs)
 
real(real64) function, dimension(:, :), pointer, public opt_control_point_q(ocs)
 
type(states_elec_t) function, pointer, public opt_control_point_qs(ocs)
 
subroutine, public opt_control_state_end(ocs)
 
subroutine, public opt_control_state_null(ocs)
 
subroutine, public opt_control_state_copy(ocsout, ocsin)
 
subroutine, public opt_control_state_init(ocs, qstate, ions)
 
subroutine, public opt_control_get_classical(ions, ocs)
 
subroutine, public opt_control_get_qs(qstate, ocs)
 
subroutine, public states_elec_end(st)
finalize the states_elec_t object
 
subroutine, public states_elec_copy(stout, stin, exclude_wfns, exclude_eigenval, special)
make a (selective) copy of a states_elec_t object
 
This is the datatype that contains the objects that are propagated: in principle this could be both t...
 
The states_elec_t class contains all electronic wave functions.