operations Module

This module contain initial_density, density, density matrix, molecular orbial density, wavefunction of molecular orbital, external potential, direct Coulomb potential, single-center integral, single-center Coulomb potential, Checking fidelity of molecular orbitals, and some other things



Functions

public function initial_density(p, g, a, b) result(rho)

prepares an initial electron density F%rho based on atomic electron densities

Arguments

Type IntentOptional Attributes Name
type(param), intent(in) :: p
type(grid3d), intent(in) :: g
type(atom_set), intent(in) :: a(:)
type(basis), intent(in) :: b

Return Value real(kind=long), (g%n_grid)

public function initial_density_matrix(p, a, b) result(d)

this is the equivalent to initial_density but returns a density matrix instead of a grid density

Arguments

Type IntentOptional Attributes Name
type(param), intent(in) :: p
type(atom_set), intent(in) :: a(:)
type(basis), intent(in) :: b

Return Value real(kind=long), (b%n_basis,b%n_basis)

public function density(g, b, dmatrix) result(rho)

computes electronic density on the grid density: where is a basis function

Arguments

Type IntentOptional Attributes Name
type(grid3d), intent(in) :: g
type(basis), intent(in) :: b
real(kind=long) :: dmatrix(b%n_basis,b%n_basis)

Return Value real(kind=long), (g%n_grid)

public function prodoverlap(p, f, strans, lcref) result(prodolap)

Calculate the product of all occupied orbital projections

Arguments

Type IntentOptional Attributes Name
type(param), intent(in) :: p
type(wf_data), intent(in) :: f
real(kind=long), intent(in), dimension(f%n_basis, f%n_basis) :: strans

The overlap matrix SI(i,j) between the

real(kind=long), intent(in), dimension(f%n_basis, f%nr_basis) :: lcref

The reference MO coefficients

Return Value real(kind=long)

public function prodoverlapunrestricted(p, f, strans, lcrefa, lcrefb) result(prodolap)

Calculate the product of all occupied orbital projections

Arguments

Type IntentOptional Attributes Name
type(param), intent(in) :: p
type(wf_data), intent(inout) :: f
real(kind=long), intent(in), dimension(f%n_basis, f%n_basis) :: strans

The overlap matrix SI(i,j) between the

real(kind=long), intent(in), dimension(f%n_basis, f%nr_basis) :: lcrefa

The reference MO coefficients

real(kind=long), intent(in), dimension(f%n_basis, f%nr_basis) :: lcrefb

The reference MO coefficients

Return Value real(kind=long)

public pure function occ_space(f, mo) result(n)

returns 0 for unoccupied MO 1 for singly occupied MO 2 for doubly occupied MO 2+i for orbital in average_occ_MO subspace i=1,...n if the orbitals are partially occupied

Arguments

Type IntentOptional Attributes Name
type(wf_data), intent(in) :: f
integer, intent(in) :: mo

Return Value integer

public function fidelity(lc, strans, lcref) result(fid)

computes the overlaps to reference orbitals squared

Arguments

Type IntentOptional Attributes Name
real(kind=long), intent(in), dimension(:, :) :: lc
real(kind=long), intent(in), dimension(:, :) :: strans
real(kind=long), intent(in), dimension(:, :) :: lcref

Return Value real(kind=long), dimension(size(lc,2))

public function nuclear_repulsion_energy(a, p) result(e_nuc)

nuclear repulsion energy

Arguments

Type IntentOptional Attributes Name
type(atom_set), intent(in) :: a(:)
type(param), intent(in) :: p

Return Value real(kind=long)

public function nuclear_repulsion_gradient(a, p) result(grad_e)

nuclear repulsion gradient

Arguments

Type IntentOptional Attributes Name
type(atom_set), intent(in) :: a(:)
type(param), intent(in) :: p

Return Value real(kind=long), (size(a,1)*3)

public function nuclear_repulsion_energy_crystal(g, a) result(e_nuc)

nuclear_repulsion_energy_crystal() for the crystalline case

Arguments

Type IntentOptional Attributes Name
type(grid3d), intent(in) :: g
type(atom_set), intent(in) :: a(:)

Return Value real(kind=long)

public function long_range_energies(p, g, f) result(e)

returns long range interaction energies

Arguments

Type IntentOptional Attributes Name
type(param), intent(in) :: p
type(grid3d), intent(in) :: g
type(wf_data), intent(in) :: f

Return Value real(kind=long), (3)

public function potential_ext(g, a) result(v)

Nuc-elec potential

Arguments

Type IntentOptional Attributes Name
type(grid3d), intent(in) :: g
type(atom_set), intent(in) :: a(:)

Return Value real(kind=long), (g%n_grid)

public function potential_j(p, g, a, rho, q_a, dipole_a) result(v_j)

calculating the direct Coulomb potential a.k.a. Hartree potential or classical electron-electron repulsion potential

Read more…

Arguments

Type IntentOptional Attributes Name
type(param), intent(in) :: p
type(grid3d), intent(in) :: g
type(atom_set), intent(in) :: a(:)
real(kind=long), intent(in) :: rho(:)
real(kind=long), intent(out), optional :: q_a(:)
real(kind=long), intent(out), optional :: dipole_a(:,:)

Return Value real(kind=long), (g%n_grid)

public function potential_j_mc(p, g, a, rho) result(v)

Yajiang's original implementation for the direct Coulomb potential - potential_J_MC() - potential_J_A_R() - integral_A() - potential_J_A()

Read more…

Arguments

Type IntentOptional Attributes Name
type(param), intent(in) :: p
type(grid3d), intent(in) :: g
type(atom_set), intent(in) :: a(:)
real(kind=long), intent(in) :: rho(:)

Return Value real(kind=long), dimension(g%n_grid)

public function integral_a(a, v) result(i)

integral on atomic grid

Arguments

Type IntentOptional Attributes Name
type(atom_set), intent(in) :: a
real(kind=long), intent(in) :: v(:)

Return Value real(kind=long)

public function potential_j_a(a, rho) result(v)

Calculating Coulomb potential on the atomic grid

Arguments

Type IntentOptional Attributes Name
type(atom_set), intent(in) :: a
real(kind=long), intent(in) :: rho(:)

Return Value real(kind=long), (a%n_r)

public function groundstate_occ(occ, ncore, open_shell, add_electrons) result(gs_occ)

returns ground state occupation numbers

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: occ(:)
integer, optional :: ncore
logical, optional :: open_shell
logical, optional :: add_electrons

Return Value integer, (size(occ))


Subroutines

public subroutine occ_overlap2_highspin_core(occ, occs, lc1, lc2, s12, ncore, overlap2)

returns overlap square between configurations in occ to configurations in occs with different molecular orbitals and basis sets considering only high-spin configurations

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: occ(:)
integer, intent(in) :: occs(:,:)
real(kind=long), intent(in) :: lc1(:,:)
real(kind=long), intent(in) :: lc2(:,:)
real(kind=long), intent(in) :: s12(:,:)
integer, intent(in) :: ncore
real(kind=long), intent(out) :: overlap2(size(occs,2))

public subroutine get_complement_combinations(n, k, combinations, complement)

given a list of combinations k out of n this subroutine returns the complement combinations

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
integer, intent(in) :: k
integer, intent(in) :: combinations(:,:)
integer, intent(out), allocatable :: complement(:,:)

public subroutine get_combinations(n, k, combinations)

returns the list of combinations k out of 1..n in lexicographical order

Arguments

Type IntentOptional Attributes Name
integer :: n
integer :: k
integer, allocatable :: combinations(:,:)

public subroutine single_excitation_occs(n_occ, occs, lower_limit, upper_limit)

returns a list of occupations, constructed from N_occ by exciting one electron

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n_occ(:)
integer, intent(out), allocatable :: occs(:,:)
integer, optional :: lower_limit
integer, optional :: upper_limit

public subroutine single_excitation_occs2(in_occs, occs, lower_limit, upper_limit)

returns a list of occupations, constructed from N_occ by exciting one electron

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: in_occs(:,:)
integer, intent(out), allocatable :: occs(:,:)
integer, optional :: lower_limit
integer, optional :: upper_limit

public subroutine auto_active_space(occ, lc1, lc2, s12, active_space, ncore)

from an occupation occ and a new, LC1, and old, LC2, orbital set plus given basis set overlap matrix S12 return the orbital indices that are involved in the changes/rotations of orbitals Ncore is the number of core orbitals

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: occ(:)
real(kind=long), intent(in) :: lc1(:,:)
real(kind=long), intent(in) :: lc2(:,:)
real(kind=long), intent(in) :: s12(:,:)
integer, intent(out), allocatable :: active_space(:)
integer, intent(in), optional :: ncore

public subroutine general_active_space_occs(norbtot, nelectot, gass, occs)

returns a list of occupations in occs that distributes Nelectot electrons in Norbtot orbitals where the occupations comply with the general active space definitions provides by the list of gass: gass(i)%orbitals(:) is a list defining an orbital subset gass(i)%nmin the minimum number of electrons in this orbital subset gass(i)%nmax the maximum number of electrons in this orbital subset

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: norbtot
integer, intent(in) :: nelectot
type(gas), intent(in) :: gass(:)
integer, intent(out), allocatable :: occs(:,:)

public subroutine filter_sym_occs(irrep_prod, irrep_mo, irrep_state, occs_in, occs_out)

filters set of occupation numbers to meet symmetry restrictions

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: irrep_prod(:,:)
integer, intent(in) :: irrep_mo(:)
integer, intent(in) :: irrep_state
integer, intent(in) :: occs_in(:,:)
integer, intent(out), allocatable :: occs_out(:,:)

public subroutine filter_ras_occs(ras, occs_in, occs_out)

filters set of occupation numbers to meet ras restrictions

Arguments

Type IntentOptional Attributes Name
type(gas), intent(in) :: ras(:)
integer, intent(in), allocatable :: occs_in(:,:)
integer, intent(out), allocatable :: occs_out(:,:)

public subroutine active_space_occs(n_occ, active_space_mo, occs)

returns a list of occupations, constructed from N_occ by redistributing electrons wihtin the orbitals given in active_space_MO

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n_occ(:)
integer, intent(in) :: active_space_mo(:)
integer, intent(out), allocatable :: occs(:,:)

public subroutine density_matrix(lc, occ, d)

computes the density matrix

Arguments

Type IntentOptional Attributes Name
real(kind=long), intent(in) :: lc(:,:)
real(kind=long), intent(in) :: occ(:)
real(kind=long), intent(out) :: d(size(lc,1),size(lc,1))

public subroutine rotate_av_orbitals(av_occ, cref, si, crot)

rotates the orbitals F%LC inside the av_occ(:)%MO subspace such that they best overlap with the orbitals in the av_occ(:)%MO subspace in Cref

Arguments

Type IntentOptional Attributes Name
type(average_occ), intent(in) :: av_occ(:)
real(kind=long), intent(in), dimension(:, :) :: cref
real(kind=long), intent(in), dimension(:, :) :: si
real(kind=long), intent(inout), dimension(:, :) :: crot

public subroutine print_atomic_quantity(a, g, v, output)

print spherically averaged quantity (potential or density) for each atom with and without multicenter decomposition

Read more…

Arguments

Type IntentOptional Attributes Name
type(atom_set), intent(in) :: a(:)
type(grid3d), intent(in) :: g
real(kind=long), intent(in) :: v(:)
integer, intent(in) :: output

public subroutine find_optimal_deltad(p, f, coef)

This subroutines returns a set of coefficients for 'optimal' representing the current Density matrix F%D as a linear combination of the saved density matrices in the F%Dsave array F%D(:,:) = sum_i coef(i) * F%Dsave(:,:,i) + deltaD(:,:) 'optimal' means that the rest is small in that sense that it has minimal number of nonzero elements. To achieve this, we use unconstrained Newton minimizer to minimize the function

Read more…

Arguments

Type IntentOptional Attributes Name
type(param), intent(in) :: p
type(wf_data), intent(in) :: f
real(kind=long), intent(inout), dimension(f%nsave) :: coef