Octopus
states_elec_oct_m Module Reference

Data Types

interface  states_elec_generate_random_vector
 
interface  states_elec_get_points
 
interface  states_elec_get_state
 
interface  states_elec_set_state
 
type  states_elec_t
 The states_elec_t class contains all electronic wave functions. More...
 
type  stress_t
 

Functions/Subroutines

subroutine, public states_elec_null (st)
 
subroutine, public states_elec_init (st, namespace, space, valence_charge, kpoints)
 Initialize a new states_elec_t object. More...
 
subroutine, public states_elec_look (restart, nik, dim, nst, ierr)
 Reads the 'states' file in the restart directory, and finds out the nik, dim, and nst contained in it. More...
 
subroutine states_elec_read_initial_occs (st, namespace, excess_charge, kpoints)
 Reads from the input file the initial occupations, if the block "Occupations" is present. Otherwise, it makes an initial guess for the occupations, maybe using the "Smearing" variable. More...
 
subroutine states_elec_read_initial_spins (st, namespace)
 Reads, if present, the "InitialSpins" block. More...
 
subroutine, public states_elec_allocate_wfns (st, mesh, wfs_type, skip, packed)
 Allocates the KS wavefunctions defined within a states_elec_t structure. More...
 
subroutine states_elec_init_block (st, mesh, verbose, skip, packed)
 Initializes the data components in st that describe how the states are distributed in blocks: More...
 
subroutine, public states_elec_deallocate_wfns (st)
 Deallocates the KS wavefunctions defined within a states_elec_t structure. More...
 
subroutine, public states_elec_densities_init (st, gr)
 
subroutine, public states_elec_allocate_current (st, space, mesh)
 
subroutine, public states_elec_exec_init (st, namespace, mc)
 Further initializations. More...
 
subroutine, public states_elec_copy (stout, stin, exclude_wfns, exclude_eigenval, special)
 make a (selective) copy of a states_elec_t object More...
 
subroutine, public states_elec_end (st)
 finalize the states_elec_t object More...
 
subroutine, public states_elec_generate_random (st, mesh, kpoints, ist_start_, ist_end_, ikpt_start_, ikpt_end_, normalized)
 randomize states More...
 
subroutine, public states_elec_fermi (st, namespace, mesh, compute_spin)
 calculate the Fermi level for the states in this object More...
 
real(real64) function, public states_elec_eigenvalues_sum (st, alt_eig)
 function to calculate the eigenvalues sum using occupations as weights More...
 
subroutine, public states_elec_distribute_nodes (st, namespace, mc)
 @Brief. Distribute states over the processes for states parallelization More...
 
subroutine, public states_elec_calc_quantities (gr, st, kpoints, nlcc, kinetic_energy_density, paramagnetic_current, density_gradient, density_laplacian, gi_kinetic_energy_density, st_end)
 calculated selected quantities More...
 
real(real64) function, dimension(1:3) state_spin (mesh, f1)
 calculate the spin vector for a spinor wave function f1 More...
 
logical function, public state_is_local (st, ist)
 check whether a given state (ist) is on the local node More...
 
logical function, public state_kpt_is_local (st, ist, ik)
 check whether a given state (ist, ik) is on the local node More...
 
real(real64) function, public states_elec_wfns_memory (st, mesh)
 return the memory usage of a states_elec_t object More...
 
subroutine states_elec_pack (st, copy)
 pack the batches in this states object More...
 
subroutine states_elec_unpack (st, copy)
 unpack the batches in this states object More...
 
subroutine states_elec_write_info (st, namespace)
 write information about the states object More...
 
subroutine, public states_elec_set_zero (st)
 expclicitely set all wave functions in the states to zero More...
 
integer pure function, public states_elec_block_min (st, ib)
 return index of first state in block ib More...
 
integer pure function, public states_elec_block_max (st, ib)
 return index of last state in block ib More...
 
integer pure function, public states_elec_block_size (st, ib)
 return number of states in block ib More...
 
subroutine, public states_elec_count_pairs (st, namespace, n_pairs, n_occ, n_unocc, is_included, is_frac_occ)
 number of occupied-unoccupied pairs for Casida More...
 
subroutine, public occupied_states (st, namespace, ik, n_filled, n_partially_filled, n_half_filled, filled, partially_filled, half_filled)
 return information about occupied orbitals in many-body state More...
 
subroutine, public kpoints_distribute (this, mc)
 distribute k-points over the nodes in the corresponding communicator More...
 
subroutine states_elec_kpoints_distribution (st)
 Assign the start and end indices for states and kpoints, for "st_kpt_mpi_grp" communicator. More...
 
subroutine, public states_elec_choose_kpoints (st, kpoints, namespace)
 double up k-points for SPIN_POLARIZED calculations More...
 
real(real64) function, dimension(1:gr%box%dim) states_elec_calculate_dipole (this, gr)
 calculate the expectation value of the dipole moment of electrons More...
 
subroutine dstates_elec_get_state2 (st, mesh, ist, iqn, psi)
 Write a wave function into a state_elec_t object. More...
 
subroutine dstates_elec_get_state1 (st, mesh, idim, ist, iqn, psi)
 Write one component (dim) of a wave function into a state_elec_t object. More...
 
subroutine dstates_elec_get_state4 (st, mesh, psi)
 get all local wave functions from a states_elec_t object More...
 
subroutine dstates_elec_get_state3 (st, mesh, iqn, psi)
 get local wave functions for given k-point from a states_elec_t object More...
 
subroutine dstates_elec_set_state2 (st, mesh, ist, iqn, psi)
 get local wave function for given k-point and states index from a states_elec_t object More...
 
subroutine dstates_elec_set_state1 (st, mesh, idim, ist, iqn, psi)
 get one dimension of local wave function for given k-point and states index from a states_elec_t object More...
 
subroutine dstates_elec_set_state3 (st, mesh, iqn, psi)
 set local wave functions for given k-point in a states_elec_t object More...
 
subroutine dstates_elec_set_state4 (st, mesh, psi)
 set all local wave functions in a states_elec_t object More...
 
subroutine dstates_elec_get_points1 (st, start_point, end_point, iqn, psi)
 Returns the value of all the states for given k-point in the range of points [start_point:end_point]. More...
 
subroutine dstates_elec_get_points2 (st, start_point, end_point, psi)
 Returns the value of all the states in the range of points [start_point:end_point]. More...
 
subroutine dstates_elec_generate_random_vector (mesh, st, vector, normalized, reset_seed)
 Generate a random vector. More...
 
subroutine zstates_elec_get_state2 (st, mesh, ist, iqn, psi)
 Write a wave function into a state_elec_t object. More...
 
subroutine zstates_elec_get_state1 (st, mesh, idim, ist, iqn, psi)
 Write one component (dim) of a wave function into a state_elec_t object. More...
 
subroutine zstates_elec_get_state4 (st, mesh, psi)
 get all local wave functions from a states_elec_t object More...
 
subroutine zstates_elec_get_state3 (st, mesh, iqn, psi)
 get local wave functions for given k-point from a states_elec_t object More...
 
subroutine zstates_elec_set_state2 (st, mesh, ist, iqn, psi)
 get local wave function for given k-point and states index from a states_elec_t object More...
 
subroutine zstates_elec_set_state1 (st, mesh, idim, ist, iqn, psi)
 get one dimension of local wave function for given k-point and states index from a states_elec_t object More...
 
subroutine zstates_elec_set_state3 (st, mesh, iqn, psi)
 set local wave functions for given k-point in a states_elec_t object More...
 
subroutine zstates_elec_set_state4 (st, mesh, psi)
 set all local wave functions in a states_elec_t object More...
 
subroutine zstates_elec_get_points1 (st, start_point, end_point, iqn, psi)
 Returns the value of all the states for given k-point in the range of points [start_point:end_point]. More...
 
subroutine zstates_elec_get_points2 (st, start_point, end_point, psi)
 Returns the value of all the states in the range of points [start_point:end_point]. More...
 
subroutine zstates_elec_generate_random_vector (mesh, st, vector, normalized, reset_seed)
 Generate a random vector. More...
 

Variables

integer, parameter, public par_independent = 1
 Method used to generate random states. More...
 
integer, parameter, public par_dependent = 2
 

Function/Subroutine Documentation

◆ states_elec_null()

subroutine, public states_elec_oct_m::states_elec_null ( class(states_elec_t), intent(inout)  st)

Definition at line 359 of file states_elec.F90.

◆ states_elec_init()

subroutine, public states_elec_oct_m::states_elec_init ( type(states_elec_t), intent(inout), target  st,
type(namespace_t), intent(in)  namespace,
type(electron_space_t), intent(in)  space,
real(real64), intent(in)  valence_charge,
type(kpoints_t), intent(in)  kpoints 
)

Initialize a new states_elec_t object.

Definition at line 373 of file states_elec.F90.

◆ states_elec_look()

subroutine, public states_elec_oct_m::states_elec_look ( type(restart_t), intent(in)  restart,
integer, intent(out)  nik,
integer, intent(out)  dim,
integer, intent(out)  nst,
integer, intent(out)  ierr 
)

Reads the 'states' file in the restart directory, and finds out the nik, dim, and nst contained in it.

Definition at line 722 of file states_elec.F90.

◆ states_elec_read_initial_occs()

subroutine states_elec_oct_m::states_elec_read_initial_occs ( type(states_elec_t), intent(inout)  st,
type(namespace_t), intent(in)  namespace,
real(real64), intent(in)  excess_charge,
type(kpoints_t), intent(in)  kpoints 
)
private

Reads from the input file the initial occupations, if the block "Occupations" is present. Otherwise, it makes an initial guess for the occupations, maybe using the "Smearing" variable.

The resulting occupations are placed on the st%occ variable. The boolean st%fixed_occ is also set to .true., if the occupations are set by the user through the "Occupations" block; false otherwise.

Definition at line 759 of file states_elec.F90.

◆ states_elec_read_initial_spins()

subroutine states_elec_oct_m::states_elec_read_initial_spins ( type(states_elec_t), intent(inout)  st,
type(namespace_t), intent(in)  namespace 
)
private

Reads, if present, the "InitialSpins" block.

This is only done in spinors mode; otherwise the routine does nothing. The resulting spins are placed onto the st%spin pointer. The boolean st%fixed_spins is set to true if (and only if) the InitialSpins block is present.

Definition at line 1017 of file states_elec.F90.

◆ states_elec_allocate_wfns()

subroutine, public states_elec_oct_m::states_elec_allocate_wfns ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
type(type_t), intent(in), optional  wfs_type,
logical, dimension(:), intent(in), optional  skip,
logical, intent(in), optional  packed 
)

Allocates the KS wavefunctions defined within a states_elec_t structure.

Parameters
[in,out]stthe states
[in]meshunderlying mesh
[in]wfs_typeoptional type; either TYPE_FLOAT or TYPE_FLOAT
[in]skipoptional array of states to skip
[in]packedoptional flag whether to pack?

Definition at line 1087 of file states_elec.F90.

◆ states_elec_init_block()

subroutine states_elec_oct_m::states_elec_init_block ( type(states_elec_t), intent(inout)  st,
type(mesh_t), intent(in)  mesh,
logical, intent(in), optional  verbose,
logical, dimension(:), intent(in), optional  skip,
logical, intent(in), optional  packed 
)
private

Initializes the data components in st that describe how the states are distributed in blocks:

st%nblocks: this is the number of blocks in which the states are divided. Note that this number is the total number of blocks, regardless of how many are actually stored in each node. block_start: in each node, the index of the first block. block_end: in each node, the index of the last block. If the states are not parallelized, then block_start is 1 and block_end is st%nblocks. st%iblock(1:st%nst): it points, for each state, to the block that contains it. st%block_is_local(): st%block_is_local(ib) is .true. if block ib is stored in the running node. st%block_range(1:st%nblocks, 1:2): Block ib contains states fromn st%block_range(ib, 1) to st%block_range(ib, 2) st%block_size(1:st%nblocks): Block ib contains a number st%block_size(ib) of states. st%block_initialized: it should be .false. on entry, and .true. after exiting this routine.

The set of batches st%psib(1:st%nblocks) contains the blocks themselves.

Parameters
[in]verbosedefault: false
[in]skiplist of states to skip
[in]packeddefault: false

Definition at line 1124 of file states_elec.F90.

◆ states_elec_deallocate_wfns()

subroutine, public states_elec_oct_m::states_elec_deallocate_wfns ( type(states_elec_t), intent(inout)  st)

Deallocates the KS wavefunctions defined within a states_elec_t structure.

Definition at line 1291 of file states_elec.F90.

◆ states_elec_densities_init()

subroutine, public states_elec_oct_m::states_elec_densities_init ( type(states_elec_t), intent(inout), target  st,
type(grid_t), intent(in)  gr 
)

Definition at line 1303 of file states_elec.F90.

◆ states_elec_allocate_current()

subroutine, public states_elec_oct_m::states_elec_allocate_current ( type(states_elec_t), intent(inout)  st,
class(space_t), intent(in)  space,
class(mesh_t), intent(in)  mesh 
)

Definition at line 1324 of file states_elec.F90.

◆ states_elec_exec_init()

subroutine, public states_elec_oct_m::states_elec_exec_init ( type(states_elec_t), intent(inout)  st,
type(namespace_t), intent(in)  namespace,
type(multicomm_t), intent(in)  mc 
)

Further initializations.

This subroutine:

  • Fills in the block size (st%d%block_size);
  • Finds out whether or not to pack the states (st%d%pack_states);
  • Finds out the orthogonalization method (st%d%orth_method).

Definition at line 1367 of file states_elec.F90.

◆ states_elec_copy()

subroutine, public states_elec_oct_m::states_elec_copy ( type(states_elec_t), intent(inout), target  stout,
type(states_elec_t), intent(in)  stin,
logical, intent(in), optional  exclude_wfns,
logical, intent(in), optional  exclude_eigenval,
logical, intent(in), optional  special 
)

make a (selective) copy of a states_elec_t object

Parameters
[in,out]stoutsource
[in]stindestination
[in]exclude_wfnsdo not copy wavefunctions, densities, node
[in]exclude_eigenvaldo not copy eigenvalues, occ, spin
[in]specialallocate on GPU

Definition at line 1467 of file states_elec.F90.

◆ states_elec_end()

subroutine, public states_elec_oct_m::states_elec_end ( type(states_elec_t), intent(inout)  st)

finalize the states_elec_t object

Definition at line 1577 of file states_elec.F90.

◆ states_elec_generate_random()

subroutine, public states_elec_oct_m::states_elec_generate_random ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
type(kpoints_t), intent(in)  kpoints,
integer, intent(in), optional  ist_start_,
integer, intent(in), optional  ist_end_,
integer, intent(in), optional  ikpt_start_,
integer, intent(in), optional  ikpt_end_,
logical, intent(in), optional  normalized 
)

randomize states

Parameters
[in,out]stobject to randomize
[in]meshunderlying mess
[in]kpointskpoint list
[in]ist_start_optional start state index
[in]ist_end_optional end state index
[in]ikpt_start_optional start kpoint index
[in]ikpt_end_optional end kpoint index
[in]normalizedoptional flag whether to generate states should have norm 1, default = .true.

Definition at line 1634 of file states_elec.F90.

◆ states_elec_fermi()

subroutine, public states_elec_oct_m::states_elec_fermi ( type(states_elec_t), intent(inout)  st,
type(namespace_t), intent(in)  namespace,
class(mesh_t), intent(in)  mesh,
logical, intent(in), optional  compute_spin 
)

calculate the Fermi level for the states in this object

Local variables.

Definition at line 1834 of file states_elec.F90.

◆ states_elec_eigenvalues_sum()

real(real64) function, public states_elec_oct_m::states_elec_eigenvalues_sum ( type(states_elec_t), intent(in)  st,
real(real64), dimension(st%st_start:, st%d%kpt%start:), intent(in), optional  alt_eig 
)

function to calculate the eigenvalues sum using occupations as weights

Parameters
[in]stthe states object
[in]alt_eigalternative eigenvalues; dimension (st%st_start:st%st_end, st%d%kpt%start:st%d%kpt%end)
Returns
eigenvalue sum

Definition at line 1894 of file states_elec.F90.

◆ states_elec_distribute_nodes()

subroutine, public states_elec_oct_m::states_elec_distribute_nodes ( type(states_elec_t), intent(inout)  st,
type(namespace_t), intent(in)  namespace,
type(multicomm_t), intent(in)  mc 
)

@Brief. Distribute states over the processes for states parallelization

Parameters
[in]mcMPI communicators

Definition at line 1922 of file states_elec.F90.

◆ states_elec_calc_quantities()

subroutine, public states_elec_oct_m::states_elec_calc_quantities ( type(grid_t), intent(in)  gr,
type(states_elec_t), intent(in)  st,
type(kpoints_t), intent(in)  kpoints,
logical, intent(in)  nlcc,
real(real64), dimension(:,:), intent(out), optional, target  kinetic_energy_density,
real(real64), dimension(:,:,:), intent(out), optional, target  paramagnetic_current,
real(real64), dimension(:,:,:), intent(out), optional  density_gradient,
real(real64), dimension(:,:), intent(out), optional, contiguous  density_laplacian,
real(real64), dimension(:,:), intent(out), optional  gi_kinetic_energy_density,
integer, intent(in), optional  st_end 
)

calculated selected quantities

This function can calculate several quantities that depend on derivatives of the orbitals from the states and the density. The quantities to be calculated depend on the arguments passed.

Parameters
[in]grthe underlying grid
[in]stthe states object
[in]kpointsthe kpoint list
[in]nlccflag whether to use non-local core corrections
[out]kinetic_energy_densityThe kinetic energy density.
[out]paramagnetic_currentThe paramagnetic current.
[out]density_gradientThe gradient of the density.
[out]density_laplacianThe Laplacian of the density.
[out]gi_kinetic_energy_densityThe gauge-invariant kinetic energy density.
[in]st_endMaximum state used to compute the quantities

Definition at line 2012 of file states_elec.F90.

◆ state_spin()

real(real64) function, dimension(1:3) states_elec_oct_m::state_spin ( type(mesh_t), intent(in)  mesh,
complex(real64), dimension(:, :), intent(in)  f1 
)
private

calculate the spin vector for a spinor wave function f1

Parameters
[in]meshunderlying mesh
[in]f1spinor wave functionl dimensions (1:mesh%np, 1:2)
Returns
spin vector

Definition at line 2384 of file states_elec.F90.

◆ state_is_local()

logical function, public states_elec_oct_m::state_is_local ( type(states_elec_t), intent(in)  st,
integer, intent(in)  ist 
)

check whether a given state (ist) is on the local node

Definition at line 2406 of file states_elec.F90.

◆ state_kpt_is_local()

logical function, public states_elec_oct_m::state_kpt_is_local ( type(states_elec_t), intent(in)  st,
integer, intent(in)  ist,
integer, intent(in)  ik 
)

check whether a given state (ist, ik) is on the local node

Definition at line 2420 of file states_elec.F90.

◆ states_elec_wfns_memory()

real(real64) function, public states_elec_oct_m::states_elec_wfns_memory ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh 
)

return the memory usage of a states_elec_t object

Definition at line 2436 of file states_elec.F90.

◆ states_elec_pack()

subroutine states_elec_oct_m::states_elec_pack ( class(states_elec_t), intent(inout)  st,
logical, intent(in), optional  copy 
)
private

pack the batches in this states object

Definition at line 2452 of file states_elec.F90.

◆ states_elec_unpack()

subroutine states_elec_oct_m::states_elec_unpack ( class(states_elec_t), intent(inout)  st,
logical, intent(in), optional  copy 
)
private

unpack the batches in this states object

Definition at line 2510 of file states_elec.F90.

◆ states_elec_write_info()

subroutine states_elec_oct_m::states_elec_write_info ( class(states_elec_t), intent(in)  st,
type(namespace_t), intent(in)  namespace 
)
private

write information about the states object

Definition at line 2534 of file states_elec.F90.

◆ states_elec_set_zero()

subroutine, public states_elec_oct_m::states_elec_set_zero ( class(states_elec_t), intent(inout)  st)

expclicitely set all wave functions in the states to zero

Definition at line 2555 of file states_elec.F90.

◆ states_elec_block_min()

integer pure function, public states_elec_oct_m::states_elec_block_min ( type(states_elec_t), intent(in)  st,
integer, intent(in)  ib 
)

return index of first state in block ib

Definition at line 2574 of file states_elec.F90.

◆ states_elec_block_max()

integer pure function, public states_elec_oct_m::states_elec_block_max ( type(states_elec_t), intent(in)  st,
integer, intent(in)  ib 
)

return index of last state in block ib

Definition at line 2584 of file states_elec.F90.

◆ states_elec_block_size()

integer pure function, public states_elec_oct_m::states_elec_block_size ( type(states_elec_t), intent(in)  st,
integer, intent(in)  ib 
)

return number of states in block ib

Definition at line 2594 of file states_elec.F90.

◆ states_elec_count_pairs()

subroutine, public states_elec_oct_m::states_elec_count_pairs ( type(states_elec_t), intent(in)  st,
type(namespace_t), intent(in)  namespace,
integer, intent(out)  n_pairs,
integer, dimension(:), intent(out)  n_occ,
integer, dimension(:), intent(out)  n_unocc,
logical, dimension(:,:,:), intent(out), allocatable  is_included,
logical, intent(out)  is_frac_occ 
)

number of occupied-unoccupied pairs for Casida

Parameters
[out]n_pairsresult: number of pairs
[out]n_occresult: number of occ. states per k-point; dimension (1:nik)
[out]n_unoccresult: number of unocc. states per k-point;dimension (1:nik)
[out]is_includedresult: mask whether a state is included; dimension (max(n_occ), max(n_unocc), st%d%nik)
[out]is_frac_occresult: are there fractional occupations?

Definition at line 2604 of file states_elec.F90.

◆ occupied_states()

subroutine, public states_elec_oct_m::occupied_states ( type(states_elec_t), intent(in)  st,
type(namespace_t), intent(in)  namespace,
integer, intent(in)  ik,
integer, intent(out)  n_filled,
integer, intent(out)  n_partially_filled,
integer, intent(out)  n_half_filled,
integer, dimension(:), intent(out), optional  filled,
integer, dimension(:), intent(out), optional  partially_filled,
integer, dimension(:), intent(out), optional  half_filled 
)

return information about occupied orbitals in many-body state

Returns information about which single-particle orbitals are occupied or not in a many-particle state st:

  • n_filled are the number of orbitals that are totally filled (the occupation number is two, if ispin = UNPOLARIZED, or it is one in the other cases).
  • n_half_filled is only meaningful if ispin = UNPOLARIZED. It is the number of orbitals where there is only one electron in the orbital.
  • n_partially_filled is the number of orbitals that are neither filled, half-filled, nor empty. The integer arrays filled, partially_filled and half_filled point to the indices where the filled, partially filled and half_filled orbitals are, respectively.

Definition at line 2728 of file states_elec.F90.

◆ kpoints_distribute()

subroutine, public states_elec_oct_m::kpoints_distribute ( type(states_elec_t), intent(inout)  this,
type(multicomm_t), intent(in)  mc 
)

distribute k-points over the nodes in the corresponding communicator

Definition at line 2784 of file states_elec.F90.

◆ states_elec_kpoints_distribution()

subroutine states_elec_oct_m::states_elec_kpoints_distribution ( type(states_elec_t), intent(inout)  st)
private

Assign the start and end indices for states and kpoints, for "st_kpt_mpi_grp" communicator.

Definition at line 2799 of file states_elec.F90.

◆ states_elec_choose_kpoints()

subroutine, public states_elec_oct_m::states_elec_choose_kpoints ( type(states_elec_t), intent(inout), target  st,
type(kpoints_t), intent(in)  kpoints,
type(namespace_t), intent(in)  namespace 
)

double up k-points for SPIN_POLARIZED calculations

Definition at line 2821 of file states_elec.F90.

◆ states_elec_calculate_dipole()

real(real64) function, dimension(1:gr%box%dim) states_elec_oct_m::states_elec_calculate_dipole ( class(states_elec_t), intent(in)  this,
class(mesh_t), intent(in)  gr 
)
private

calculate the expectation value of the dipole moment of electrons

Note
this routine is only meaningful for isolated systems. For periodic systems, we need to consider the Berry phase.

Definition at line 2869 of file states_elec.F90.

◆ dstates_elec_get_state2()

subroutine states_elec_oct_m::dstates_elec_get_state2 ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  ist,
integer, intent(in)  iqn,
real(real64), dimension(:, :), intent(inout), contiguous  psi 
)
private

Write a wave function into a state_elec_t object.

Parameters
[in]stthe states object
[in]meshthe underlying mesh
[in]istcurrent state
[in]iqncurrent k-point
[in,out]psithe wave function; dimension (1:mesh%np_part, 1:st%d%dim)

Definition at line 2959 of file states_elec.F90.

◆ dstates_elec_get_state1()

subroutine states_elec_oct_m::dstates_elec_get_state1 ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  idim,
integer, intent(in)  ist,
integer, intent(in)  iqn,
real(real64), dimension(:), intent(inout), contiguous  psi 
)
private

Write one component (dim) of a wave function into a state_elec_t object.

Parameters
[in]stthe states object
[in]meshthe underlying mesh
[in]idimcurrent dimension
[in]istcurrent state
[in]iqncurrent k-point
[in,out]psithe wave function; dimension (1:mesh%np_part)

Definition at line 2980 of file states_elec.F90.

◆ dstates_elec_get_state4()

subroutine states_elec_oct_m::dstates_elec_get_state4 ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
real(real64), dimension(:, :, st%st_start:, st%d%kpt%start:), intent(inout), contiguous  psi 
)
private

get all local wave functions from a states_elec_t object

Parameters
[in]stthe states object
[in]meshthe underlying mesh
[in,out]psiresult: the wave function; dimension (1:mesh%np_part, 1:st%d%dim, st%st_start:st%st_end, st%d%kpt%start:st%d%kpt%end)

Definition at line 2999 of file states_elec.F90.

◆ dstates_elec_get_state3()

subroutine states_elec_oct_m::dstates_elec_get_state3 ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  iqn,
real(real64), dimension(:, :, st%st_start:), intent(inout), contiguous  psi 
)
private

get local wave functions for given k-point from a states_elec_t object

Parameters
[in]stthe states object
[in]meshthe underlying mesh
[in]iqnk-point index
[in,out]psiresult: the wave function; dimension (1:mesh%np_part, 1:st%d%dim, st%st_start:st%st_end)

Definition at line 3021 of file states_elec.F90.

◆ dstates_elec_set_state2()

subroutine states_elec_oct_m::dstates_elec_set_state2 ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  ist,
integer, intent(in)  iqn,
real(real64), dimension(:, :), intent(in), contiguous  psi 
)
private

get local wave function for given k-point and states index from a states_elec_t object

Parameters
[in,out]stthe states object
[in]meshthe underlying mesh
[in]istcurrent state
[in]iqncurrent k-point
[in]psiresult: the wave function; dimension (1:mesh%np_part, 1:st%d%dim)

Definition at line 3042 of file states_elec.F90.

◆ dstates_elec_set_state1()

subroutine states_elec_oct_m::dstates_elec_set_state1 ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  idim,
integer, intent(in)  ist,
integer, intent(in)  iqn,
real(real64), dimension(:), intent(in), contiguous  psi 
)
private

get one dimension of local wave function for given k-point and states index from a states_elec_t object

Parameters
[in,out]stthe states object
[in]meshthe underlying mesh
[in]idimcurrent dimension
[in]istcurrent state
[in]iqncurrent k-point
[in]psiresult: the wave function; dimension (1:mesh%np_part)

Definition at line 3064 of file states_elec.F90.

◆ dstates_elec_set_state3()

subroutine states_elec_oct_m::dstates_elec_set_state3 ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  iqn,
real(real64), dimension(:, :, st%st_start:), intent(in), contiguous  psi 
)
private

set local wave functions for given k-point in a states_elec_t object

Parameters
[in,out]stthe states object
[in]meshthe underlying mesh
[in]iqnthe k-point index
[in]psithe wave function dimension (1:mesh%np_part, 1:st%d%dim, st%st_start:st%st_end)

Definition at line 3082 of file states_elec.F90.

◆ dstates_elec_set_state4()

subroutine states_elec_oct_m::dstates_elec_set_state4 ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
real(real64), dimension(:, :, st%st_start:, st%d%kpt%start:), intent(in), contiguous  psi 
)
private

set all local wave functions in a states_elec_t object

Parameters
[in,out]stthe states object
[in]meshthe underlying mesh
[in]psithe wave functions; dimension (1:mesh%np_part, 1:st%d%dim, st%st_start:st%st_end, st%d%kpt%start:st%d%kpt%end)

Definition at line 3104 of file states_elec.F90.

◆ dstates_elec_get_points1()

subroutine states_elec_oct_m::dstates_elec_get_points1 ( type(states_elec_t), intent(in)  st,
integer, intent(in)  start_point,
integer, intent(in)  end_point,
integer, intent(in)  iqn,
real(real64), dimension(:, :, :), intent(out), contiguous  psi 
)
private

Returns the value of all the states for given k-point in the range of points [start_point:end_point].

Parameters
[in]stthe states object
[in]start_pointfirst point
[in]end_pointlast point
[in]iqnk-point index
[out]psithe wave function; dimension (start_point:end_point,1:st%d%dim, 1:st%nst)

Definition at line 3128 of file states_elec.F90.

◆ dstates_elec_get_points2()

subroutine states_elec_oct_m::dstates_elec_get_points2 ( type(states_elec_t), intent(in)  st,
integer, intent(in)  start_point,
integer, intent(in)  end_point,
real(real64), dimension(:, :, :, :), intent(out), contiguous  psi 
)
private

Returns the value of all the states in the range of points [start_point:end_point].

Parameters
[in]stthe states object
[in]start_pointfirst point
[in]end_pointlast point
[out]psithe wave functions; dimension (start_point:end_point,1:st%d%dim, 1:st%nst, st%d%kpt%start:st%d%kpt%end)

Definition at line 3152 of file states_elec.F90.

◆ dstates_elec_generate_random_vector()

subroutine states_elec_oct_m::dstates_elec_generate_random_vector ( class(mesh_t), intent(in)  mesh,
type(states_elec_t), intent(in)  st,
real(real64), dimension(:, :), intent(out), contiguous  vector,
logical, intent(in), optional  normalized,
logical, intent(in), optional  reset_seed 
)
private

Generate a random vector.

Warning
This will not work for SPINORS when the spins are not fixed.
Parameters
[in]meshSystem grid.
[in]stProvide information on the basis.
[out]vectorRandom vector.
[in]normalizedNormalize the random vector.
[in]reset_seedReset the seed. Usefull for k-point parallel

Definition at line 3174 of file states_elec.F90.

◆ zstates_elec_get_state2()

subroutine states_elec_oct_m::zstates_elec_get_state2 ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  ist,
integer, intent(in)  iqn,
complex(real64), dimension(:, :), intent(inout), contiguous  psi 
)
private

Write a wave function into a state_elec_t object.

Parameters
[in]stthe states object
[in]meshthe underlying mesh
[in]istcurrent state
[in]iqncurrent k-point
[in,out]psithe wave function; dimension (1:mesh%np_part, 1:st%d%dim)

Definition at line 3304 of file states_elec.F90.

◆ zstates_elec_get_state1()

subroutine states_elec_oct_m::zstates_elec_get_state1 ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  idim,
integer, intent(in)  ist,
integer, intent(in)  iqn,
complex(real64), dimension(:), intent(inout), contiguous  psi 
)
private

Write one component (dim) of a wave function into a state_elec_t object.

Parameters
[in]stthe states object
[in]meshthe underlying mesh
[in]idimcurrent dimension
[in]istcurrent state
[in]iqncurrent k-point
[in,out]psithe wave function; dimension (1:mesh%np_part)

Definition at line 3325 of file states_elec.F90.

◆ zstates_elec_get_state4()

subroutine states_elec_oct_m::zstates_elec_get_state4 ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:, :, st%st_start:, st%d%kpt%start:), intent(inout), contiguous  psi 
)
private

get all local wave functions from a states_elec_t object

Parameters
[in]stthe states object
[in]meshthe underlying mesh
[in,out]psiresult: the wave function; dimension (1:mesh%np_part, 1:st%d%dim, st%st_start:st%st_end, st%d%kpt%start:st%d%kpt%end)

Definition at line 3344 of file states_elec.F90.

◆ zstates_elec_get_state3()

subroutine states_elec_oct_m::zstates_elec_get_state3 ( type(states_elec_t), intent(in)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  iqn,
complex(real64), dimension(:, :, st%st_start:), intent(inout), contiguous  psi 
)
private

get local wave functions for given k-point from a states_elec_t object

Parameters
[in]stthe states object
[in]meshthe underlying mesh
[in]iqnk-point index
[in,out]psiresult: the wave function; dimension (1:mesh%np_part, 1:st%d%dim, st%st_start:st%st_end)

Definition at line 3366 of file states_elec.F90.

◆ zstates_elec_set_state2()

subroutine states_elec_oct_m::zstates_elec_set_state2 ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  ist,
integer, intent(in)  iqn,
complex(real64), dimension(:, :), intent(in), contiguous  psi 
)
private

get local wave function for given k-point and states index from a states_elec_t object

Parameters
[in,out]stthe states object
[in]meshthe underlying mesh
[in]istcurrent state
[in]iqncurrent k-point
[in]psiresult: the wave function; dimension (1:mesh%np_part, 1:st%d%dim)

Definition at line 3387 of file states_elec.F90.

◆ zstates_elec_set_state1()

subroutine states_elec_oct_m::zstates_elec_set_state1 ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  idim,
integer, intent(in)  ist,
integer, intent(in)  iqn,
complex(real64), dimension(:), intent(in), contiguous  psi 
)
private

get one dimension of local wave function for given k-point and states index from a states_elec_t object

Parameters
[in,out]stthe states object
[in]meshthe underlying mesh
[in]idimcurrent dimension
[in]istcurrent state
[in]iqncurrent k-point
[in]psiresult: the wave function; dimension (1:mesh%np_part)

Definition at line 3409 of file states_elec.F90.

◆ zstates_elec_set_state3()

subroutine states_elec_oct_m::zstates_elec_set_state3 ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
integer, intent(in)  iqn,
complex(real64), dimension(:, :, st%st_start:), intent(in), contiguous  psi 
)
private

set local wave functions for given k-point in a states_elec_t object

Parameters
[in,out]stthe states object
[in]meshthe underlying mesh
[in]iqnthe k-point index
[in]psithe wave function dimension (1:mesh%np_part, 1:st%d%dim, st%st_start:st%st_end)

Definition at line 3427 of file states_elec.F90.

◆ zstates_elec_set_state4()

subroutine states_elec_oct_m::zstates_elec_set_state4 ( type(states_elec_t), intent(inout)  st,
class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:, :, st%st_start:, st%d%kpt%start:), intent(in), contiguous  psi 
)
private

set all local wave functions in a states_elec_t object

Parameters
[in,out]stthe states object
[in]meshthe underlying mesh
[in]psithe wave functions; dimension (1:mesh%np_part, 1:st%d%dim, st%st_start:st%st_end, st%d%kpt%start:st%d%kpt%end)

Definition at line 3449 of file states_elec.F90.

◆ zstates_elec_get_points1()

subroutine states_elec_oct_m::zstates_elec_get_points1 ( type(states_elec_t), intent(in)  st,
integer, intent(in)  start_point,
integer, intent(in)  end_point,
integer, intent(in)  iqn,
complex(real64), dimension(:, :, :), intent(out), contiguous  psi 
)
private

Returns the value of all the states for given k-point in the range of points [start_point:end_point].

Parameters
[in]stthe states object
[in]start_pointfirst point
[in]end_pointlast point
[in]iqnk-point index
[out]psithe wave function; dimension (start_point:end_point,1:st%d%dim, 1:st%nst)

Definition at line 3473 of file states_elec.F90.

◆ zstates_elec_get_points2()

subroutine states_elec_oct_m::zstates_elec_get_points2 ( type(states_elec_t), intent(in)  st,
integer, intent(in)  start_point,
integer, intent(in)  end_point,
complex(real64), dimension(:, :, :, :), intent(out), contiguous  psi 
)
private

Returns the value of all the states in the range of points [start_point:end_point].

Parameters
[in]stthe states object
[in]start_pointfirst point
[in]end_pointlast point
[out]psithe wave functions; dimension (start_point:end_point,1:st%d%dim, 1:st%nst, st%d%kpt%start:st%d%kpt%end)

Definition at line 3497 of file states_elec.F90.

◆ zstates_elec_generate_random_vector()

subroutine states_elec_oct_m::zstates_elec_generate_random_vector ( class(mesh_t), intent(in)  mesh,
type(states_elec_t), intent(in)  st,
complex(real64), dimension(:, :), intent(out), contiguous  vector,
logical, intent(in), optional  normalized,
logical, intent(in), optional  reset_seed 
)
private

Generate a random vector.

Warning
This will not work for SPINORS when the spins are not fixed.
Parameters
[in]meshSystem grid.
[in]stProvide information on the basis.
[out]vectorRandom vector.
[in]normalizedNormalize the random vector.
[in]reset_seedReset the seed. Usefull for k-point parallel

Definition at line 3519 of file states_elec.F90.

Variable Documentation

◆ par_independent

integer, parameter, public states_elec_oct_m::par_independent = 1

Method used to generate random states.

Definition at line 333 of file states_elec.F90.

◆ par_dependent

integer, parameter, public states_elec_oct_m::par_dependent = 2

Definition at line 333 of file states_elec.F90.