Octopus
v_ks_photon_oct_m Module Reference

QEDFT / electron-photon (cavity) extension of the Kohn-Sham potential. More...

Detailed Description

QEDFT / electron-photon (cavity) extension of the Kohn-Sham potential.

Holds the photon-specific state of v_ks_oct_m::v_ks_t (the QEDFT functional selector, the photon-free exchange object, the photon OEP object and the mean-field photon object) together with the corresponding init / end / potential routines. It is kept in a separate module so that the (experimental) photon machinery and its module closure do not have to be parsed and compiled as part of v_ks.F90 itself. v_ks_oct_m::v_ks_t embeds a v_ks_photon_t and forwards to the routines below.

Data Types

type  v_ks_photon_t
 Photon (QEDFT) part of v_ks_t. More...
 

Functions/Subroutines

subroutine v_ks_photon_init (this, namespace)
 Parse the QEDFT input variables and set photon defaults. More...
 
subroutine v_ks_photon_init_xc (this, namespace, space, gr, st)
 Initialize the photon-free exchange object when a QEDFT functional is selected. More...
 
subroutine v_ks_photon_setup (this, namespace, modes, gr, st, ions, mc, space, xc, xc_family, oep_level)
 Set up the photon modes, mean-field object and photon OEP (called after v_ks_init). More...
 
subroutine v_ks_photon_end (this)
 Finalize all photon objects. More...
 
subroutine v_ks_photon_mf_calc (this, gr, st, ions, time)
 Update the mean-field photon quantities (time-dependent run, mean-field QEDFT). More...
 
subroutine v_ks_photon_add_px (this, namespace, total_density, gr, space, psolver, st, spin_channels, vxc, e_photon_exchange)
 Add the photon-free photon-exchange potential to vxc and return its energy. More...
 
subroutine v_ks_photon_oep_calc (this, namespace, xc, gr, hm, st, space, vxc)
 Compute the photon OEP potential/energy contribution. More...
 
subroutine v_ks_photon_add_mf_potential (this, gr, vhxc, ispin, photon_forces)
 Add the mean-field photon potential to vhxc and set the photon forces. More...
 
subroutine v_ks_photon_add_mean_field (this, gr, space, kpoints, st, time, dt)
 Add the photon mean field to the paramagnetic-current integral (time propagation). More...
 
subroutine v_ks_photon_restart_dump (this, restart, gr, dt, ierr)
 Dump photon restart data; error bits added to ierr (16: mean field, 32: photon-free). More...
 
subroutine v_ks_photon_restart_load (this, restart, gr, space, ierr)
 Load photon restart data; error bits added to ierr (16: mean field, 32: photon-free). More...
 
subroutine v_ks_photon_write_info (this, iunit)
 Write the photon observables (number, exchange) to the SCF info output. More...
 
logical pure function v_ks_photon_active (this)
 Whether photons are enabled in this v_ks. More...
 
subroutine v_ks_photon_set_active (this, val)
 Enable/disable photons (set before v_ks_init). More...
 
integer pure function v_ks_photon_functional (this)
 The selected QEDFT functional (0 = none). More...
 
logical pure function v_ks_photon_include_hartree (this)
 Whether to include the Hartree term (QEDFT). More...
 
integer pure function v_ks_photon_nmodes (this)
 Number of photon modes. More...
 
logical pure function v_ks_photon_oep_full (this)
 Whether the photon OEP is at the FULL level (controls correlator output). More...
 
real(real64) function, dimension(:), pointer v_ks_photon_correlator (this)
 Pointer to the photon correlator (for output). More...
 
type(mf_t) function, pointer v_ks_photon_get_pt_mx (this)
 Pointer to the mean-field photon object (for time-dependent output). More...
 
type(xc_photons_t) function, pointer v_ks_photon_get_xc_photons (this)
 Pointer to the photon-free exchange object. More...
 

Function/Subroutine Documentation

◆ v_ks_photon_init()

subroutine v_ks_photon_oct_m::v_ks_photon_init ( class(v_ks_photon_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace 
)
private

Parse the QEDFT input variables and set photon defaults.

Definition at line 203 of file v_ks_photon.F90.

◆ v_ks_photon_init_xc()

subroutine v_ks_photon_oct_m::v_ks_photon_init_xc ( class(v_ks_photon_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
type(grid_t), intent(in)  gr,
type(states_elec_t), intent(in)  st 
)
private

Initialize the photon-free exchange object when a QEDFT functional is selected.

Definition at line 250 of file v_ks_photon.F90.

◆ v_ks_photon_setup()

subroutine v_ks_photon_oct_m::v_ks_photon_setup ( class(v_ks_photon_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
type(photon_mode_t), intent(inout), target  modes,
type(grid_t), intent(inout)  gr,
type(states_elec_t), intent(in)  st,
type(ions_t), intent(in)  ions,
type(multicomm_t), intent(in)  mc,
class(space_t), intent(in)  space,
type(xc_t), intent(in)  xc,
integer, intent(in)  xc_family,
integer, intent(in)  oep_level 
)
private

Set up the photon modes, mean-field object and photon OEP (called after v_ks_init).

Definition at line 270 of file v_ks_photon.F90.

◆ v_ks_photon_end()

subroutine v_ks_photon_oct_m::v_ks_photon_end ( class(v_ks_photon_t), intent(inout)  this)
private

Finalize all photon objects.

Definition at line 304 of file v_ks_photon.F90.

◆ v_ks_photon_mf_calc()

subroutine v_ks_photon_oct_m::v_ks_photon_mf_calc ( class(v_ks_photon_t), intent(inout)  this,
type(grid_t), intent(inout)  gr,
type(states_elec_t), intent(inout)  st,
type(ions_t), intent(in)  ions,
real(real64), intent(in)  time 
)
private

Update the mean-field photon quantities (time-dependent run, mean-field QEDFT).

Definition at line 322 of file v_ks_photon.F90.

◆ v_ks_photon_add_px()

subroutine v_ks_photon_oct_m::v_ks_photon_add_px ( class(v_ks_photon_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
real(real64), dimension(:), intent(in), pointer, contiguous  total_density,
type(grid_t), intent(in)  gr,
class(space_t), intent(in)  space,
type(poisson_t), intent(in)  psolver,
type(states_elec_t), intent(inout)  st,
integer, intent(in)  spin_channels,
real(real64), dimension(:, :), intent(inout)  vxc,
real(real64), intent(out)  e_photon_exchange 
)
private

Add the photon-free photon-exchange potential to vxc and return its energy.

Definition at line 338 of file v_ks_photon.F90.

◆ v_ks_photon_oep_calc()

subroutine v_ks_photon_oct_m::v_ks_photon_oep_calc ( class(v_ks_photon_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
type(xc_t), intent(inout)  xc,
type(grid_t), intent(in)  gr,
type(hamiltonian_elec_t), intent(inout)  hm,
type(states_elec_t), intent(inout)  st,
class(space_t), intent(in)  space,
real(real64), dimension(:, :), intent(inout), contiguous  vxc 
)
private

Compute the photon OEP potential/energy contribution.

Does nothing (and is cheap to call) when the photon OEP level is NONE, so the caller does not need to know about the OEP photon level.

Definition at line 372 of file v_ks_photon.F90.

◆ v_ks_photon_add_mf_potential()

subroutine v_ks_photon_oct_m::v_ks_photon_add_mf_potential ( class(v_ks_photon_t), intent(in)  this,
type(grid_t), intent(in)  gr,
real(real64), dimension(:, :), intent(inout)  vhxc,
integer, intent(in)  ispin,
real(real64), dimension(:), intent(out)  photon_forces 
)
private

Add the mean-field photon potential to vhxc and set the photon forces.

Definition at line 400 of file v_ks_photon.F90.

◆ v_ks_photon_add_mean_field()

subroutine v_ks_photon_oct_m::v_ks_photon_add_mean_field ( class(v_ks_photon_t), intent(inout)  this,
type(grid_t), intent(in)  gr,
class(space_t), intent(in)  space,
type(kpoints_t), intent(in)  kpoints,
type(states_elec_t), intent(inout)  st,
real(real64), intent(in)  time,
real(real64), intent(in)  dt 
)
private

Add the photon mean field to the paramagnetic-current integral (time propagation).

Definition at line 422 of file v_ks_photon.F90.

◆ v_ks_photon_restart_dump()

subroutine v_ks_photon_oct_m::v_ks_photon_restart_dump ( class(v_ks_photon_t), intent(in)  this,
type(restart_t), intent(in)  restart,
type(grid_t), intent(in)  gr,
real(real64), intent(in)  dt,
integer, intent(inout)  ierr 
)
private

Dump photon restart data; error bits added to ierr (16: mean field, 32: photon-free).

Definition at line 442 of file v_ks_photon.F90.

◆ v_ks_photon_restart_load()

subroutine v_ks_photon_oct_m::v_ks_photon_restart_load ( class(v_ks_photon_t), intent(inout)  this,
type(restart_t), intent(in)  restart,
type(grid_t), intent(in)  gr,
class(space_t), intent(in)  space,
integer, intent(inout)  ierr 
)
private

Load photon restart data; error bits added to ierr (16: mean field, 32: photon-free).

Definition at line 468 of file v_ks_photon.F90.

◆ v_ks_photon_write_info()

subroutine v_ks_photon_oct_m::v_ks_photon_write_info ( class(v_ks_photon_t), intent(in)  this,
integer, intent(in)  iunit 
)
private

Write the photon observables (number, exchange) to the SCF info output.

Definition at line 493 of file v_ks_photon.F90.

◆ v_ks_photon_active()

logical pure function v_ks_photon_oct_m::v_ks_photon_active ( class(v_ks_photon_t), intent(in)  this)
private

Whether photons are enabled in this v_ks.

Definition at line 511 of file v_ks_photon.F90.

◆ v_ks_photon_set_active()

subroutine v_ks_photon_oct_m::v_ks_photon_set_active ( class(v_ks_photon_t), intent(inout)  this,
logical, intent(in)  val 
)
private

Enable/disable photons (set before v_ks_init).

Definition at line 518 of file v_ks_photon.F90.

◆ v_ks_photon_functional()

integer pure function v_ks_photon_oct_m::v_ks_photon_functional ( class(v_ks_photon_t), intent(in)  this)
private

The selected QEDFT functional (0 = none).

Definition at line 526 of file v_ks_photon.F90.

◆ v_ks_photon_include_hartree()

logical pure function v_ks_photon_oct_m::v_ks_photon_include_hartree ( class(v_ks_photon_t), intent(in)  this)
private

Whether to include the Hartree term (QEDFT).

Definition at line 533 of file v_ks_photon.F90.

◆ v_ks_photon_nmodes()

integer pure function v_ks_photon_oct_m::v_ks_photon_nmodes ( class(v_ks_photon_t), intent(in)  this)
private

Number of photon modes.

Definition at line 540 of file v_ks_photon.F90.

◆ v_ks_photon_oep_full()

logical pure function v_ks_photon_oct_m::v_ks_photon_oep_full ( class(v_ks_photon_t), intent(in)  this)
private

Whether the photon OEP is at the FULL level (controls correlator output).

Definition at line 547 of file v_ks_photon.F90.

◆ v_ks_photon_correlator()

real(real64) function, dimension(:), pointer v_ks_photon_oct_m::v_ks_photon_correlator ( class(v_ks_photon_t), intent(in), target  this)
private

Pointer to the photon correlator (for output).

Definition at line 554 of file v_ks_photon.F90.

◆ v_ks_photon_get_pt_mx()

type(mf_t) function, pointer v_ks_photon_oct_m::v_ks_photon_get_pt_mx ( class(v_ks_photon_t), intent(in), target  this)
private

Pointer to the mean-field photon object (for time-dependent output).

Definition at line 562 of file v_ks_photon.F90.

◆ v_ks_photon_get_xc_photons()

type(xc_photons_t) function, pointer v_ks_photon_oct_m::v_ks_photon_get_xc_photons ( class(v_ks_photon_t), intent(in), target  this)
private

Pointer to the photon-free exchange object.

Definition at line 570 of file v_ks_photon.F90.