SIRIUS 7.5.0
Electronic structure library and applications
Modules | Data Types | Typedefs | Enumerations | Functions/Subroutines | Variables
sirius Module Reference

Namespace of the SIRIUS library. More...

Modules

namespace  acc
 Namespace for accelerator-related functions.
 
namespace  cg
 Conjugate-gradient solver.
 
namespace  env
 Get environment variables.
 
namespace  fft
 FFT-related functions and objects.
 
namespace  la
 Interface to linear algebra BLAS/LAPACK functions.
 
namespace  local
 Internal implementation of beta-projectors generator.
 
namespace  lr
 Linear respone functions and objects.
 
namespace  magma
 Interface to MAGMA functions.
 
namespace  mixer
 Mixer functions and objects.
 
namespace  mpi
 MPI related functions and classes.
 
namespace  r3
 Work with 3D vectors and matrices.
 
namespace  rte
 Run-time error and warning handling.
 
namespace  sf
 Special functions.
 
namespace  smearing
 Occupancy smearing functions.
 
namespace  wf
 Namespace for the wave-functions.
 

Data Types

class  angular_momentum
 Angular momentum quantum number. More...
 
class  any_ptr
 Handle deallocation of a poiniter to an object of any type. More...
 
class  Array1d
 TODO: Array1d owns data... More...
 
class  Atom
 Data and methods specific to the actual atom in the unit cell. More...
 
struct  atom_index_t
 
class  Atom_symmetry_class
 Data and methods specific to the symmetry class of the atom. More...
 
struct  atom_symmetry_class_index_t
 
class  Atom_type
 Defines the properties of atom type. More...
 
class  Atom_type_base
 Base class for sirius::Atom_type and sirius::Free_atom classes. More...
 
struct  atom_type_index_t
 
class  Augmentation_operator
 Augmentation charge operator Q(r) of the ultrasoft pseudopotential formalism. More...
 
struct  basic_index_t
 Basic index type. More...
 
struct  basis_function_index_descriptor
 
class  basis_functions_index
 A helper class to establish various index mappings for the atomic basis functions. More...
 
struct  beta_chunk_t
 Describe chunk of beta-projectors for a block of atoms. More...
 
struct  beta_desc_idx
 Named index of a descriptor of beta-projectors. The same order is used by the GPU kernel. More...
 
class  Beta_projector_generator
 
class  Beta_projectors
 Stores <G+k | beta> expansion. More...
 
class  Beta_projectors_base
 Base class for beta-projectors, gradient of beta-projectors and strain derivatives of beta-projectors. More...
 
struct  beta_projectors_coeffs_t
 Stores a chunk of the beta-projector and metadata. More...
 
class  Beta_projectors_gradient
 Compute gradient of beta-projectors over atomic positions \( d \langle {\bf G+k} | \beta \rangle / d \tau_{\alpha} \). More...
 
class  Beta_projectors_strain_deriv
 
class  Bound_state
 
struct  callback_functions_t
 Store all callback functions in one place. More...
 
class  cmd_args
 Simple command line arguments handler. More...
 
class  Config
 
class  config_t
 
class  Crystal_symmetry
 Representation of the crystal symmetry. More...
 
class  CUDA_timer
 
class  CUDA_timers_wrapper
 
class  D_operator
 
struct  davidson_result_t
 Result of Davidson solver. More...
 
class  Density
 Generate charge density and magnetization from occupied spinor wave-functions. More...
 
class  density_matrix_t
 
class  DFT_ground_state
 The whole DFT ground state implementation. More...
 
struct  diagonalize_result_t
 
class  DiagonalPreconditioner
 
class  Energy
 Kohn-Sham energy. More...
 
class  Enu_finder
 
class  ffmt
 Floating-point formatting (precision and width). More...
 
class  Field4D
 Four-component function consisting of scalar and vector parts. More...
 
class  Force
 Compute atomic forces. More...
 
class  Free_atom
 Full potential free atom solver. More...
 
class  Gaunt_coefficients
 Compact storage of non-zero Gaunt coefficients \( \langle \ell_1 m_1 | \ell_3 m_3 | \ell_2 m_2 \rangle \). More...
 
struct  gaunt_L1_L2
 Used in the {lm1, lm2, coefficient} : {lm3} way of grouping non-zero Gaunt coefficients. More...
 
struct  gaunt_L3
 Used in the {lm1, lm2} : {lm3, coefficient} way of grouping non-zero Gaunt coefficients. More...
 
struct  GPU_Complex
 helper type traits to template kernel function More...
 
struct  GPU_Complex< double >
 
struct  GPU_Complex< float >
 
class  Hamiltonian0
 Represent the k-point independent part of Hamiltonian. More...
 
class  Hamiltonian_k
 Representation of Kohn-Sham Hamiltonian. More...
 
class  hbar
 Horisontal bar. More...
 
class  HDF5_tree
 Interface to the HDF5 library. More...
 
struct  hdf5_type_wrapper
 
struct  hdf5_type_wrapper< double >
 
struct  hdf5_type_wrapper< float >
 
struct  hdf5_type_wrapper< int >
 
struct  hdf5_type_wrapper< uint8_t >
 
class  Hubbard
 Apply Hubbard correction in the collinear case. More...
 
class  Hubbard_matrix
 Describes Hubbard orbital occupancy or potential correction matrices. More...
 
class  hubbard_orbital_descriptor
 Structure containing all information about a specific hubbard orbital (including the radial function). More...
 
struct  identity
 
class  InverseS_k
 
class  K_point
 K-point related variables and methods. More...
 
class  K_point_set
 Set of k-points. More...
 
struct  kp_index_t
 K-point index type. More...
 
class  Lattice_relaxation
 
struct  lo_basis_descriptor
 Descriptor of the local-orbital part of the LAPW+lo basis. More...
 
class  Local_operator
 Representation of the local operator. More...
 
struct  local_orbital_descriptor
 Descriptor of a local orbital radial function. More...
 
struct  magnetic_group_symmetry_descriptor
 Descriptor of the magnetic group symmetry operation. More...
 
class  Matching_coefficients
 
class  Matrix
 
class  Measurement
 
struct  nearest_neighbour_descriptor
 Descriptor of an atom in a list of nearest neighbours for each atom. More...
 
class  Non_local_operator
 Non-local part of the Hamiltonian and S-operator in the pseudopotential method. More...
 
class  null_stream_t
 
class  Occupation_matrix
 
struct  paw_atom_index_t
 
class  PAW_density
 PAW density storage. More...
 
class  PAW_field4D
 PAW density and potential storage. More...
 
class  Periodic_function
 Representation of the periodical function on the muffin-tin geometry. More...
 
struct  periodic_function_ptr_t
 Describe external pointers to periodic function. More...
 
class  Potential
 Generate effective potential from charge density and magnetization. More...
 
struct  ps_atomic_wf_descriptor
 Store basic information about radial pseudo wave-functions. More...
 
class  Q_operator
 
struct  radial_function_index_descriptor
 Descriptor for the atomic radial functions. More...
 
class  radial_functions_index
 Radial basis function index. More...
 
class  Radial_grid
 Base class for radial grids. More...
 
class  Radial_grid_exp
 
class  Radial_grid_ext
 External radial grid provided as a list of points. More...
 
class  Radial_grid_lin
 
class  Radial_grid_lin_exp
 
class  Radial_grid_pow
 
class  Radial_integrals_atomic_wf
 Radial integrals of the atomic centered orbitals. More...
 
class  Radial_integrals_aug
 Radial integrals of the augmentation operator. More...
 
class  Radial_integrals_base
 Base class for all kinds of radial integrals. More...
 
class  Radial_integrals_beta
 Radial integrals of beta projectors. More...
 
class  Radial_integrals_rho_core_pseudo
 
class  Radial_integrals_rho_free_atom
 
class  Radial_integrals_rho_pseudo
 
struct  radial_integrals_t
 Store all radial integrals in one place. More...
 
class  Radial_integrals_vloc
 
struct  radial_solution_descriptor
 Describes radial solution. More...
 
class  Radial_solver
 Finds a solution to radial Schrodinger, Koelling-Harmon or Dirac equation. More...
 
struct  Real
 
struct  Real< gpu_complex_type< double > >
 
struct  Real< gpu_complex_type< float > >
 
struct  Real< std::complex< T > >
 
class  S_k
 
class  Scalar
 
class  serializer
 Serialize and deserialize objects. More...
 
class  SHT
 Spherical harmonics transformations and related oprtations. More...
 
class  Simulation_context
 Simulation context is a set of parameters and objects describing a single simulation. More...
 
class  Simulation_parameters
 Set of basic parameters of a simulation. More...
 
type  sirius_context_handler
 Opaque wrapper for simulation context handler. More...
 
interface  sirius_free_handler
 Free any of the SIRIUS handlers (context, ground state or k-points). More...
 
type  sirius_ground_state_handler
 Opaque wrapper for DFT ground statee handler. More...
 
type  sirius_kpoint_set_handler
 Opaque wrapper for K-point set handler. More...
 
class  Smooth_periodic_function
 Representation of a smooth (Fourier-transformable) periodic function. More...
 
struct  smooth_periodic_function_ptr_t
 
class  Smooth_periodic_vector_function
 Vector of the smooth periodic functions. More...
 
struct  space_group_symmetry_descriptor
 Descriptor of the space group symmetry operation. More...
 
class  Spheric_function
 Function in spherical harmonics or spherical coordinates representation. More...
 
class  Spheric_function_set
 
struct  spheric_function_set_ptr_t
 
class  Spheric_vector_function
 3D vector function. More...
 
class  splindex
 Base class for split index. More...
 
class  splindex_block
 
class  splindex_block_cyclic
 
class  splindex_chunk
 Externally defined block distribution. More...
 
class  splindex_iterator_t
 
class  Spline
 Cubic spline with a not-a-knot boundary conditions. More...
 
struct  step_function_t
 Representation of the unit step function. More...
 
class  Stress
 Stress tensor. More...
 
class  strong_type
 
class  Teter
 
class  U_operator
 
class  Ultrasoft_preconditioner
 
class  Unit_cell
 Representation of a unit cell. More...
 
struct  unit_cell_parameters_descriptor
 
class  XC_functional
 Interface class to Libxc. More...
 
class  XC_functional_base
 Interface class to Libxc. More...
 

Typedefs

using acc_stream_t = cudaStream_t
 
using acc_error_t = cudaError_t
 
using acc_complex_float_t = cuFloatComplex
 
using acc_complex_double_t = cuDoubleComplex
 
template<typename T >
using gpu_complex_type = typename GPU_Complex< T >::type
 
template<typename T >
using real_type = typename Real< T >::type
 
using n_blocks = strong_type< int, struct __n_blocks_tag >
 Number of blocks to which the global index is split. More...
 
using block_id = strong_type< int, struct __block_id_tag >
 ID of the block. More...
 
using time_point_t = std::chrono::high_resolution_clock::time_point
 
template<class X >
using identity_t = typename identity< X >::type
 
typedef std::vector< radial_solution_descriptorradial_solution_descriptor_set
 Set of radial solution descriptors, used to construct augmented waves or local orbitals. More...
 
using Flm = Spheric_function< function_domain_t::spectral, double >
 
using Ftp = Spheric_function< function_domain_t::spatial, double >
 
using lmax_t = strong_type< int, struct __lmax_t_tag >
 
using rf_index = strong_type< int, struct __rf_index_tag >
 Radial function index. More...
 
using rf_aw_index = strong_type< int, struct __rf_aw_index_tag >
 Augmented wave radial function index. More...
 
using rf_lo_index = strong_type< int, struct __rf_lo_index_tag >
 Local orbital radial function index. More...
 
using bf_index = strong_type< int, struct __bf_index_tag >
 Basis function index. More...
 
using bf_aw_index = strong_type< int, struct __bf_aw_index_tag >
 Augmented wave basis function index. More...
 
using bf_lo_index = strong_type< int, struct __bf_lo_index_tag >
 Local orbital basis function index. More...
 
using json = nlohmann::json
 

Enumerations

enum class  hdf5_access_t { truncate , read_write , read_only }
 
enum class  index_domain_t { global , local }
 
enum class  spin_block_t {
  nm , uu , dd , ud ,
  du
}
 Spin-blocks of the Hamiltonian. More...
 
enum class  electronic_structure_method_t { full_potential_lapwlo , pseudopotential }
 Type of electronic structure methods. More...
 
enum class  function_domain_t { spatial , spectral }
 Type of a function domain. More...
 
enum class  relativity_t {
  none , koelling_harmon , zora , iora ,
  dirac
}
 Type of relativity treatment in the case of LAPW. More...
 
enum class  davidson_evp_t { hamiltonian , overlap }
 
enum class  sync_band_t { energy , occupancy }
 
enum class  radial_grid_t : int { linear = 0 , exponential = 1 , power = 2 , lin_exp = 3 }
 Types of radial grid. More...
 

Functions/Subroutines

character(kind=c_char, len=1) function, dimension(len_trim(f_string)+1) string_f2c (f_string)
 Internal function that adds trailing null character to the string to make it C-style. More...
 
character(kind=c_char, len=size(c_string) - 1) function string_c2f (c_string)
 Internal function that converts C-string (with trailing null character) to the Fortran string. More...
 
subroutine sirius_initialize (call_mpi_init, error_code)
 Initialize the SIRIUS library. More...
 
subroutine sirius_finalize (call_mpi_fin, call_device_reset, call_fftw_fin, error_code)
 Shut down the SIRIUS library. More...
 
subroutine sirius_start_timer (name, error_code)
 Start the timer. More...
 
subroutine sirius_stop_timer (name, error_code)
 Stop the running timer. More...
 
subroutine sirius_print_timers (flatten, error_code)
 Print all timers. More...
 
subroutine sirius_serialize_timers (fname, error_code)
 Save all timers to JSON file. More...
 
subroutine sirius_context_initialized (handler, status, error_code)
 Check if the simulation context is initialized. More...
 
subroutine sirius_create_context (fcomm, handler, fcomm_k, fcomm_band, error_code)
 Create context of the simulation. More...
 
subroutine sirius_import_parameters (handler, str, error_code)
 Import parameters of simulation from a JSON string. More...
 
subroutine sirius_set_parameters (handler, lmax_apw, lmax_rho, lmax_pot, num_fv_states, num_bands, num_mag_dims, pw_cutoff, gk_cutoff, fft_grid_size, auto_rmt, gamma_point, use_symmetry, so_correction, valence_rel, core_rel, iter_solver_tol_empty, iter_solver_type, verbosity, hubbard_correction, hubbard_correction_kind, hubbard_full_orthogonalization, hubbard_orbitals, sht_coverage, min_occupancy, smearing, smearing_width, spglib_tol, electronic_structure_method, error_code)
 Set parameters of the simulation. More...
 
subroutine sirius_get_parameters (handler, lmax_apw, lmax_rho, lmax_pot, num_fv_states, num_bands, num_spins, num_mag_dims, pw_cutoff, gk_cutoff, fft_grid_size, auto_rmt, gamma_point, use_symmetry, so_correction, iter_solver_tol, iter_solver_tol_empty, verbosity, hubbard_correction, evp_work_count, num_loc_op_applied, num_sym_op, electronic_structure_method, error_code)
 Get parameters of the simulation. More...
 
subroutine sirius_add_xc_functional (handler, name, error_code)
 Add one of the XC functionals. More...
 
subroutine sirius_set_mpi_grid_dims (handler, ndims, dims, error_code)
 Set dimensions of the MPI grid. More...
 
subroutine sirius_set_lattice_vectors (handler, a1, a2, a3, error_code)
 Set vectors of the unit cell. More...
 
subroutine sirius_initialize_context (handler, error_code)
 Initialize simulation context. More...
 
subroutine sirius_update_context (handler, error_code)
 Update simulation context after changing lattice or atomic positions. More...
 
subroutine sirius_print_info (handler, error_code)
 Print basic info. More...
 
subroutine sirius_free_object_handler (handler, error_code)
 Free any object handler created by SIRIUS. More...
 
subroutine sirius_set_periodic_function_ptr (handler, label, f_mt, lmmax, nrmtmax, num_atoms, f_rg, size_x, size_y, size_z, offset_z, error_code)
 Set pointer to density or magnetization. More...
 
subroutine sirius_set_periodic_function (handler, label, f_mt, lmmax, nrmtmax, num_atoms, f_rg, size_x, size_y, size_z, offset_z, error_code)
 Set values of the periodic function. More...
 
subroutine sirius_get_periodic_function (handler, label, f_mt, lmmax, nrmtmax, num_atoms, f_rg, size_x, size_y, size_z, offset_z, error_code)
 Get values of the periodic function. More...
 
subroutine sirius_create_kset (handler, num_kpoints, kpoints, kpoint_weights, init_kset, kset_handler, error_code)
 Create k-point set from the list of k-points. More...
 
subroutine sirius_create_kset_from_grid (handler, k_grid, k_shift, use_symmetry, kset_handler, error_code)
 Create k-point set from a grid. More...
 
subroutine sirius_create_ground_state (ks_handler, gs_handler, error_code)
 Create a ground state object. More...
 
subroutine sirius_initialize_kset (ks_handler, count, error_code)
 Initialize k-point set. More...
 
subroutine sirius_find_ground_state (gs_handler, density_tol, energy_tol, iter_solver_tol, initial_guess, max_niter, save_state, converged, niter, rho_min, error_code)
 Find the ground state. More...
 
subroutine sirius_check_scf_density (gs_handler, error_code)
 Check the self-consistent density. More...
 
subroutine sirius_update_ground_state (gs_handler, error_code)
 Update a ground state object after change of atomic coordinates or lattice vectors. More...
 
subroutine sirius_add_atom_type (handler, label, fname, zn, symbol, mass, spin_orbit, error_code)
 Add new atom type to the unit cell. More...
 
subroutine sirius_set_atom_type_radial_grid (handler, label, num_radial_points, radial_points, error_code)
 Set radial grid of the atom type. More...
 
subroutine sirius_set_atom_type_radial_grid_inf (handler, label, num_radial_points, radial_points, error_code)
 Set radial grid of the free atom (up to effectice infinity). More...
 
subroutine sirius_add_atom_type_radial_function (handler, atom_type, label, rf, num_points, n, l, idxrf1, idxrf2, occ, error_code)
 Add one of the radial functions. More...
 
subroutine sirius_set_atom_type_hubbard (handler, label, l, n, occ, U, J, alpha, beta, J0, error_code)
 Set the hubbard correction for the atomic type. More...
 
subroutine sirius_set_atom_type_dion (handler, label, num_beta, dion, error_code)
 Set ionic part of D-operator matrix. More...
 
subroutine sirius_set_atom_type_paw (handler, label, core_energy, occupations, num_occ, error_code)
 Set PAW related data. More...
 
subroutine sirius_add_atom (handler, label, position, vector_field, error_code)
 Add atom to the unit cell. More...
 
subroutine sirius_set_atom_position (handler, ia, position, error_code)
 Set new atomic position. More...
 
subroutine sirius_set_pw_coeffs (handler, label, pw_coeffs, transform_to_rg, ngv, gvl, comm, error_code)
 Set plane-wave coefficients of a periodic function. More...
 
subroutine sirius_get_pw_coeffs (handler, label, pw_coeffs, ngv, gvl, comm, error_code)
 Get plane-wave coefficients of a periodic function. More...
 
subroutine sirius_initialize_subspace (gs_handler, ks_handler, error_code)
 Initialize the subspace of wave-functions. More...
 
subroutine sirius_find_eigen_states (gs_handler, ks_handler, precompute_pw, precompute_rf, precompute_ri, iter_solver_tol, error_code)
 Find eigen-states of the Hamiltonian. More...
 
subroutine sirius_generate_initial_density (handler, error_code)
 Generate initial density. More...
 
subroutine sirius_generate_effective_potential (handler, error_code)
 Generate effective potential and magnetic field. More...
 
subroutine sirius_generate_density (gs_handler, add_core, transform_to_rg, paw_only, error_code)
 Generate charge density and magnetization. More...
 
subroutine sirius_set_band_occupancies (ks_handler, ik, ispn, band_occupancies, error_code)
 Set band occupancies. More...
 
subroutine sirius_get_band_occupancies (ks_handler, ik, ispn, band_occupancies, error_code)
 Set band occupancies. More...
 
subroutine sirius_get_band_energies (ks_handler, ik, ispn, band_energies, error_code)
 Get band energies. More...
 
subroutine sirius_get_energy (handler, label, energy, error_code)
 Get one of the total energy components. More...
 
subroutine sirius_get_forces (handler, label, forces, error_code)
 Get one of the total force components. More...
 
subroutine sirius_get_stress_tensor (handler, label, stress_tensor, error_code)
 Get one of the stress tensor components. More...
 
subroutine sirius_get_num_beta_projectors (handler, label, num_bp, error_code)
 Get the number of beta-projectors for an atom type. More...
 
subroutine sirius_get_wave_functions (ks_handler, vkl, spin, num_gvec_loc, gvec_loc, evec, ld, num_spin_comp, error_code)
 Get wave-functions. More...
 
subroutine sirius_add_atom_type_aw_descriptor (handler, label, n, l, enu, dme, auto_enu, error_code)
 Add descriptor of the augmented wave radial function. More...
 
subroutine sirius_add_atom_type_lo_descriptor (handler, label, ilo, n, l, enu, dme, auto_enu, error_code)
 Add descriptor of the local orbital radial function. More...
 
subroutine sirius_set_atom_type_configuration (handler, label, n, l, k, occupancy, core, error_code)
 Set configuration of atomic levels. More...
 
subroutine sirius_generate_coulomb_potential (handler, vh_el, error_code)
 Generate Coulomb potential by solving Poisson equation. More...
 
subroutine sirius_generate_xc_potential (handler, error_code)
 Generate XC potential using LibXC. More...
 
subroutine sirius_get_kpoint_inter_comm (handler, fcomm, error_code)
 Get communicator which is used to split k-points. More...
 
subroutine sirius_get_kpoint_inner_comm (handler, fcomm, error_code)
 Get communicator which is used to parallise band problem. More...
 
subroutine sirius_get_fft_comm (handler, fcomm, error_code)
 Get communicator which is used to parallise FFT. More...
 
subroutine sirius_get_num_gvec (handler, num_gvec, error_code)
 Get total number of G-vectors on the fine grid. More...
 
subroutine sirius_get_gvec_arrays (handler, gvec, gvec_cart, gvec_len, index_by_gvec, error_code)
 Get G-vector arrays. More...
 
subroutine sirius_get_num_fft_grid_points (handler, num_fft_grid_points, error_code)
 Get local number of FFT grid points. More...
 
subroutine sirius_get_fft_index (handler, fft_index, error_code)
 Get mapping between G-vector index and FFT index. More...
 
subroutine sirius_get_max_num_gkvec (ks_handler, max_num_gkvec, error_code)
 Get maximum number of G+k vectors across all k-points in the set. More...
 
subroutine sirius_get_gkvec_arrays (ks_handler, ik, num_gkvec, gvec_index, gkvec, gkvec_cart, gkvec_len, gkvec_tp, error_code)
 Get all G+k vector related arrays. More...
 
subroutine sirius_get_step_function (handler, cfunig, cfunrg, num_rg_points, error_code)
 Get the unit-step function. More...
 
subroutine sirius_set_h_radial_integrals (handler, ia, lmmax, val, l1, o1, ilo1, l2, o2, ilo2, error_code)
 Set LAPW Hamiltonian radial integrals. More...
 
subroutine sirius_set_o_radial_integral (handler, ia, val, l, o1, ilo1, o2, ilo2, error_code)
 Set LAPW overlap radial integral. More...
 
subroutine sirius_set_o1_radial_integral (handler, ia, val, l1, o1, ilo1, l2, o2, ilo2, error_code)
 Set a correction to LAPW overlap radial integral. More...
 
subroutine sirius_set_radial_function (handler, ia, deriv_order, f, l, o, ilo, error_code)
 Set LAPW radial functions. More...
 
subroutine sirius_set_equivalent_atoms (handler, equivalent_atoms, error_code)
 Set equivalent atoms. More...
 
subroutine sirius_update_atomic_potential (handler, error_code)
 Set the new spherical potential. More...
 
subroutine sirius_option_get_number_of_sections (length, error_code)
 Return the total number of sections defined in the input JSON schema. More...
 
subroutine sirius_option_get_section_name (elem, section_name, section_name_length, error_code)
 Return the name of a given section. More...
 
subroutine sirius_option_get_section_length (section, length, error_code)
 Return the number of options in a given section. More...
 
subroutine sirius_option_get_info (section, elem, key_name, key_name_len, type, length, enum_size, title, title_len, description, description_len, error_code)
 Return information about the option. More...
 
subroutine sirius_option_get (section, name, type, data_ptr, max_length, enum_idx, error_code)
 Return the default value of the option as defined in the JSON schema. More...
 
subroutine sirius_option_set (handler, section, name, type, data_ptr, max_length, append, error_code)
 Set the value of the option name in a (internal) json dictionary. More...
 
subroutine sirius_dump_runtime_setup (handler, filename, error_code)
 Dump the runtime setup in a file. More...
 
subroutine sirius_get_fv_eigen_vectors (handler, ik, fv_evec, ld, num_fv_states, error_code)
 Get the first-variational eigen vectors. More...
 
subroutine sirius_get_fv_eigen_values (handler, ik, fv_eval, num_fv_states, error_code)
 Get the first-variational eigen values. More...
 
subroutine sirius_get_sv_eigen_vectors (handler, ik, sv_evec, num_bands, error_code)
 Get the second-variational eigen vectors. More...
 
subroutine sirius_set_rg_values (handler, label, grid_dims, local_box_origin, local_box_size, fcomm, values, transform_to_pw, error_code)
 Set the values of the function on the regular grid. More...
 
subroutine sirius_get_rg_values (handler, label, grid_dims, local_box_origin, local_box_size, fcomm, values, transform_to_rg, error_code)
 Get the values of the function on the regular grid. More...
 
subroutine sirius_get_total_magnetization (handler, mag, error_code)
 Get the total magnetization of the system. More...
 
subroutine sirius_get_num_kpoints (handler, num_kpoints, error_code)
 Get the total number of kpoints. More...
 
subroutine sirius_get_kpoint_properties (handler, ik, weight, coordinates, error_code)
 Get the kpoint properties. More...
 
subroutine sirius_set_callback_function (handler, label, fptr, error_code)
 Set callback function to compute various radial integrals. More...
 
subroutine sirius_nlcg (handler, ks_handler, error_code)
 Robust wave function optimizer. More...
 
subroutine sirius_nlcg_params (handler, ks_handler, temp, smearing, kappa, tau, tol, maxiter, restart, processing_unit, converged, error_code)
 Robust wave function optimizer. More...
 
subroutine sirius_add_hubbard_atom_pair (handler, atom_pair, translation, n, l, coupling, error_code)
 Add a non-local Hubbard interaction V for a pair of atoms. More...
 
subroutine sirius_create_h0 (handler, error_code)
 Generate H0. More...
 
subroutine sirius_linear_solver (handler, vkq, num_gvec_kq_loc, gvec_kq_loc, dpsi, psi, eigvals, dvpsi, ld, num_spin_comp, alpha_pv, spin, nbnd_occ, tol, niter, error_code)
 Interface to linear solver. More...
 
subroutine sirius_generate_d_operator_matrix (handler, error_code)
 Generate D-operator matrix. More...
 
subroutine sirius_save_state (gs_handler, file_name, error_code)
 Save DFT ground state (density and potential) More...
 
subroutine sirius_load_state (handler, file_name, error_code)
 Save DFT ground state (density and potential) More...
 
subroutine sirius_set_density_matrix (handler, ia, dm, ld, error_code)
 Set density matrix. More...
 
subroutine sirius_free_handler_ctx (handler, error_code)
 
subroutine sirius_free_handler_ks (handler, error_code)
 
subroutine sirius_free_handler_dft (handler, error_code)
 
void create_beta_gk_gpu (int num_atoms, int num_gkvec, int const *beta_desc, std::complex< float > const *beta_gk_t, double const *gkvec, double const *atom_pos, std::complex< float > *beta_gk)
 
void create_beta_gk_gpu (int num_atoms, int num_gkvec, int const *beta_desc, std::complex< double > const *beta_gk_t, double const *gkvec, double const *atom_pos, std::complex< double > *beta_gk)
 
void create_beta_gk_gpu_float (int num_atoms, int num_gkvec, int const *beta_desc, std::complex< float > const *beta_gk_t, double const *gkvec, double const *atom_pos, std::complex< float > *beta_gk)
 
void create_beta_gk_gpu_double (int num_atoms, int num_gkvec, int const *beta_desc, std::complex< double > const *beta_gk_t, double const *gkvec, double const *atom_pos, std::complex< double > *beta_gk)
 
template<typename F , typename T >
std::enable_if_t< std::is_same< T, real_type< F > >::value, la::dmatrix< F > > inner_prod_beta (spla::Context &spla_ctx, sddk::memory_t mem__, sddk::memory_t host_mem__, bool result_on_device, beta_projectors_coeffs_t< T > &beta_coeffs__, wf::Wave_functions< T > const &phi__, wf::spin_index ispn__, wf::band_range br__)
 
template<class T >
sddk::matrix< std::complex< T > > inner_beta (const Beta_projectors_base< T > &beta, const Simulation_context &ctx)
 computes <beta|beta> and returns result on ctx.processing_unit_memory_t More...
 
template<class T , class Op >
sddk::matrix< std::complex< T > > inner_beta (const Beta_projectors_base< T > &beta, const Simulation_context &ctx, Op &&op)
 inner product <beta|Op|beta>, return resulting dmatrix<complex> in ctx.processing_unit_memory_t More...
 
std::string const locked_msg ("parameters are locked")
 
template<typename OUT >
void print_memory_usage (OUT &&out__, std::string file_and_line__="")
 
template<typename T >
static std::ostringstream option_print_vector__ (const std::vector< T > &vec)
 
void compose_default_json (nlohmann::json const &schema__, nlohmann::json &output__)
 Compose JSON dictionary with default parameters based on input schema. More...
 
void compose_json (nlohmann::json const &schema__, nlohmann::json const &in__, nlohmann::json &inout__)
 Append the input dictionary to the existing dictionary. More...
 
nlohmann::json const & get_options_dictionary ()
 Get all possible options for initializing sirius. It is a json dictionary. More...
 
nlohmann::json const & get_section_options (std::string const &section__)
 Get all possible options of a given input section. It is a json dictionary. More...
 
void scale_matrix_rows_gpu (int nrow, int ncol, acc_complex_double_t *mtrx, double const *v)
 
void scale_matrix_elements_gpu (acc_complex_double_t *ptr__, int ld__, int nrow__, int ncol__, double beta__)
 
void ddiagmm (const double *diag, int n, const double *X, int lda_x, int ncols, double *Y, int lda_y, double alpha)
 
void sdiagmm (const float *diag, int n, const float *X, int lda_x, int ncols, float *Y, int lda_y, float alpha)
 
void zdiagmm (const std::complex< double > *diag, int n, const std::complex< double > *X, int lda_x, int ncols, std::complex< double > *Y, int lda_y, std::complex< double > alpha)
 
template<>
std::string cmd_args::value< std::string > (const std::string key__) const
 
template<>
std::string cmd_args::value< std::string > (const std::string key__, const std::string default_val__) const
 
template<>
std::vector< double > cmd_args::value< std::vector< double > > (const std::string key__) const
 
template<>
std::vector< int > cmd_args::value< std::vector< int > > (const std::string key__) const
 
auto confined_polynomial (double r, double R, int p1, int p2, int dm)
 
template<typename T >
int sign (T val)
 Sign of the variable. More...
 
template<typename T >
bool is_int (T val__, T eps__)
 Checks if number is integer with a given tolerance. More...
 
template<typename T >
factorial (int n)
 Compute a factorial. More...
 
auto round (double a__, int n__)
 
auto round (std::complex< double > a__, int n__)
 
auto hash (void const *buff, size_t size, uint64_t h=5381)
 Simple hash function. More...
 
uint32_t random_uint32 (bool reset=false)
 Simple random number generator. More...
 
template<typename T >
random ()
 
template<>
int random< int > ()
 
template<>
double random< double > ()
 
template<>
std::complex< double > random< std::complex< double > > ()
 
template<>
float random< float > ()
 
template<>
std::complex< float > random< std::complex< float > > ()
 
template<typename T >
auto abs_diff (T a, T b)
 
template<typename T >
auto rel_diff (T a, T b)
 
auto conj (double x__)
 Return complex conjugate of a number. For a real value this is the number itself. More...
 
auto conj (std::complex< double > x__)
 Return complex conjugate of a number. More...
 
template<typename T >
zero_if_not_complex (T x__)
 
template<typename T >
zero_if_not_complex (std::complex< T > x__)
 
null_stream_tnull_stream ()
 
std::string boolstr (bool b__)
 
std::ostream & operator<< (std::ostream &out, hbar &&b)
 Inject horisontal bar to ostream. More...
 
std::ostream & operator<< (std::ostream &out, ffmt &&f)
 Inject floating point format to ostream. More...
 
template<typename T >
std::ostream & operator<< (std::ostream &out, std::vector< T > &v)
 Print std::vector to ostream. More...
 
std::string double_to_string (double val, int precision=-1)
 Convert double to a string with a given precision. More...
 
template<typename T , typename OUT >
void print_checksum (std::string label__, T value__, OUT &&out__)
 
template<typename OUT >
void print_hash (std::string label__, unsigned long long int hash__, OUT &&out__)
 
int packed_index (int i__, int j__)
 Pack two indices into one for symmetric matrices. More...
 
template<typename T , int N>
nlohmann::json serialize (sddk::mdarray< T, N > const &a__)
 
template<typename T , int N>
nlohmann::json serialize (sddk::mdarray< std::complex< T >, N > const &a__)
 
template<typename T , int N>
void write_to_json_file (sddk::mdarray< T, N > const &a__, std::string const &fname__)
 
template<typename T >
void serialize (serializer &s__, T var__)
 Serialize a single element. More...
 
template<typename T >
void deserialize (serializer &s__, T &var__)
 Deserialize a single element. More...
 
template<typename T >
void serialize (serializer &s__, std::vector< T > const &vec__)
 Serialize a vector. More...
 
template<typename T >
void deserialize (serializer &s__, std::vector< T > &vec__)
 Deserialize a vector. More...
 
template<typename T , int N>
void serialize (serializer &s__, sddk::mdarray< T, N > const &array__)
 Serialize multidimentional array. More...
 
template<typename T , int N>
void deserialize (serializer &s__, sddk::mdarray< T, N > &array__)
 Deserialize multidimentional array. More...
 
void serialize (serializer &s__, mpi::block_data_descriptor const &dd__)
 Serialize block data descriptor. More...
 
void deserialize (serializer &s__, mpi::block_data_descriptor &dd__)
 Deserialize block data descriptor. More...
 
template<>
void SHT::backward_transform< std::complex< double > > (int ld, std::complex< double > const *flm, int nr, int lmmax, std::complex< double > *ftp) const
 
template<>
void SHT::forward_transform< std::complex< double > > (std::complex< double > const *ftp, int nr, int lmmax, int ld, std::complex< double > *flm) const
 
int major_version ()
 
int minor_version ()
 
int revision ()
 
std::string git_hash ()
 
std::string git_branchname ()
 
std::string build_date ()
 
int num_blocks (int length__, int block_size__)
 Return the maximum number of blocks (with size 'block_size') needed to split the 'length' elements. More...
 
auto split_in_blocks (int length__, int block_size__)
 Split the 'length' elements into blocks with the initial block size. More...
 
template<typename Index_t >
auto begin_global (splindex< Index_t > const &a__)
 
template<typename Index_t >
auto end_global (splindex< Index_t > const &a__)
 
template<typename Index_t >
auto begin (splindex< Index_t > const &a__)
 
template<typename Index_t >
auto end (splindex< Index_t > const &a__)
 
auto split (std::string const str__, char delim__)
 Split multi-line string into a list of strings. More...
 
std::string & ltrim (std::string &str, const std::string &chars="\t\n\v\f\r ")
 
std::string & rtrim (std::string &str, const std::string &chars="\t\n\v\f\r ")
 
std::string & trim (std::string &str, const std::string &chars="\t\n\v\f\r ")
 
bool file_exists (std::string file_name)
 Check if file exists. More...
 
auto hostname ()
 Get host name. More...
 
long get_page_size ()
 
long get_num_pages ()
 
long get_total_memory ()
 
auto get_proc_status ()
 
int get_proc_threads ()
 
auto timestamp (std::string fmt)
 Return the timestamp string in a specified format. More...
 
double wtime ()
 Wall-clock time in seconds. More...
 
auto time_now ()
 
double time_interval (std::chrono::high_resolution_clock::time_point t0)
 
relativity_t get_relativity_t (std::string name__)
 
std::ostream & operator<< (std::ostream &out, radial_solution_descriptor const &rsd)
 
void add_square_sum_gpu_double (std::complex< double > const *wf__, int num_rows_loc__, int nwf__, int reduced__, int mpi_rank__, double *result__)
 
void add_square_sum_gpu_float (std::complex< float > const *wf__, int num_rows_loc__, int nwf__, int reduced__, int mpi_rank__, float *result__)
 
void scale_matrix_columns_gpu_double (int nrow__, int ncol__, std::complex< double > *mtrx__, double *a__)
 
void scale_matrix_columns_gpu_float (int nrow__, int ncol__, std::complex< float > *mtrx__, float *a__)
 
void add_checksum_gpu_double (void const *wf__, int ld__, int num_rows_loc__, int nwf__, void *result__)
 
void add_checksum_gpu_float (void const *wf__, int ld__, int num_rows_loc__, int nwf__, void *result__)
 
void inner_diag_local_gpu_double_complex_double (void const *wf1__, int ld1__, void const *wf2__, int ld2__, int ngv_loc__, int nwf__, void *result__)
 
void inner_diag_local_gpu_double_double (void const *wf1__, int ld1__, void const *wf2__, int ld2__, int ngv_loc__, int nwf__, int reduced__, void *result__)
 
void axpby_gpu_double_complex_double (int nwf__, void const *alpha__, void const *x__, int ld1__, void const *beta__, void *y__, int ld2__, int ngv_loc__)
 
void axpby_gpu_double_double (int nwf__, void const *alpha__, void const *x__, int ld1__, void const *beta__, void *y__, int ld2__, int ngv_loc__)
 
void axpy_scatter_gpu_double_complex_double (int nwf__, void const *alpha__, void const *x__, int ld1__, void const *idx__, void *y__, int ld2__, int ngv_loc__)
 
void axpy_scatter_gpu_double_double (int nwf__, void const *alpha__, void const *x__, int ld1__, void const *idx__, void *y__, int ld2__, int ngv_loc__)
 
template<typename T >
auto checksum_gpu (std::complex< T > const *wf__, int ld__, int num_rows_loc__, int nwf__)
 Add checksum for the arrays on GPUs. More...
 
template<typename F >
void iterate_aug_atom_types (Unit_cell const &uc__, F &&f__)
 
auto max_l_aug (Unit_cell const &uc__)
 
auto max_na_aug (Unit_cell const &uc__)
 
auto max_nb_aug (Unit_cell const &uc__)
 
void update_density_rg_1_real_gpu (int size__, float const *psi_rg__, float wt__, float *density_rg__)
 
void update_density_rg_1_real_gpu (int size__, double const *psi_rg__, double wt__, double *density_rg__)
 
void update_density_rg_1_complex_gpu (int size__, std::complex< float > const *psi_rg__, float wt__, float *density_rg__)
 
void update_density_rg_1_complex_gpu (int size__, std::complex< double > const *psi_rg__, double wt__, double *density_rg__)
 
void update_density_rg_2_gpu (int size__, std::complex< float > const *psi_rg_up__, std::complex< float > const *psi_rg_dn__, float wt__, float *density_x_rg__, float *density_y_rg__)
 
void update_density_rg_2_gpu (int size__, std::complex< double > const *psi_rg_up__, std::complex< double > const *psi_rg_dn__, double wt__, double *density_x_rg__, double *density_y_rg__)
 
template<typename T >
static void add_k_point_contribution_rg_collinear (fft::spfft_transform_type< T > &fft__, int ispn__, T w__, T const *inp_wf__, int nr__, bool gamma__, sddk::mdarray< T, 2 > &density_rg__)
 Compute non-magnetic or up- or dn- contribution of the wave-functions to the charge density. More...
 
template<typename T >
static void add_k_point_contribution_rg_noncollinear (fft::spfft_transform_type< T > &fft__, T w__, T const *inp_wf_up__, T const *inp_wf_dn__, int nr__, sddk::mdarray< std::complex< T >, 1 > &psi_r_up__, sddk::mdarray< T, 2 > &density_rg__)
 Compute contribution to density and megnetisation from the 2-component spinor wave-functions. More...
 
template<typename T >
static void add_k_point_contribution_dm_fplapw (Simulation_context const &ctx__, K_point< T > const &kp__, density_matrix_t &density_matrix__)
 
template<typename T , typename F >
static void add_k_point_contribution_dm_pwpp_collinear (Simulation_context &ctx__, K_point< T > &kp__, beta_projectors_coeffs_t< T > &bp_coeffs__, density_matrix_t &density_matrix__)
 
template<typename T , typename F >
static void add_k_point_contribution_dm_pwpp_noncollinear (Simulation_context &ctx__, K_point< T > &kp__, beta_projectors_coeffs_t< T > &bp_coeffs__, density_matrix_t &density_matrix__)
 
template<typename T , typename F >
static void add_k_point_contribution_dm_pwpp (Simulation_context &ctx__, K_point< T > &kp__, density_matrix_t &density_matrix__)
 
auto get_rho_up_dn (int num_mag_dims__, double rho__, r3::vector< double > mag__)
 Use Kuebler's trick to get rho_up and rho_dn from density and magnetisation. More...
 
void copy (Density const &src__, Density &dest__)
 
template<bool add_pseudo_core__>
std::array< std::unique_ptr< Smooth_periodic_function< double > >, 2 > get_rho_up_dn (Density const &density__, double add_delta_rho_xc__=0.0, double add_delta_mag_xc__=0.0)
 
void copy (density_matrix_t const &src__, density_matrix_t &dest__)
 
void copy (Occupation_matrix const &src__, Occupation_matrix &dest__)
 
double ewald_energy (const Simulation_context &ctx, const fft::Gvec &gvec, const Unit_cell &unit_cell)
 Compute the ion-ion electrostatic energy using Ewald method. More...
 
double energy_vxc (Density const &density, Potential const &potential)
 Returns exchange correlation potential. More...
 
double energy_exc (Density const &density, Potential const &potential)
 Returns exchange correlation energy. More...
 
double energy_vha (Potential const &potential)
 Returns Hatree potential. More...
 
double energy_bxc (const Density &density, const Potential &potential)
 TODO doc. More...
 
double energy_enuc (Simulation_context const &ctx, Potential const &potential)
 Return nucleus energy in the electrostatic field. More...
 
double energy_vloc (Density const &density, Potential const &potential)
 TODO doc. More...
 
double core_eval_sum (Unit_cell const &unit_cell)
 Return eigen-value sum of core states. More...
 
double eval_sum (Unit_cell const &unit_cell, K_point_set const &kset)
 TODO doc. More...
 
double energy_veff (Density const &density, Potential const &potential)
 TODO doc. More...
 
double energy_kin (Simulation_context const &ctx, K_point_set const &kset, Density const &density, Potential const &potential)
 Return kinetic energy. More...
 
double ks_energy (Simulation_context const &ctx, const std::map< std::string, double > &energies)
 
double ks_energy (Simulation_context const &ctx, K_point_set const &kset, Density const &density, Potential const &potential, double ewald_energy)
 
double total_energy (Simulation_context const &ctx, K_point_set const &kset, Density const &density, Potential const &potential, double ewald_energy)
 Total energy of the electronic subsystem. More...
 
std::map< std::string, double > total_energy_components (Simulation_context const &ctx, const K_point_set &kset, Density const &density, Potential const &potential, double ewald_energy)
 
double hubbard_energy (Density const &density)
 
double one_electron_energy (Density const &density, Potential const &potential)
 
double one_electron_energy_hubbard (Density const &density, Potential const &potential)
 
double energy_potential (Density const &density, Potential const &potential)
 
double valence_eval_sum (K_point_set const &kset)
 TODO doc.
 
auto energy_dict (Simulation_context const &ctx__, K_point_set const &kset__, Density const &density__, Potential const &potential__, double ewald_energy__, double scf_correction__=0)
 
template<index_domain_t index_domain, typename F >
auto make_periodic_function (Unit_cell const &uc__, fft::Gvec const &gv__, sddk::mdarray< std::complex< double >, 2 > const &phase_factors_t__, F &&form_factors__)
 Make periodic function out of form factors. More...
 
template<index_domain_t index_domain>
auto make_periodic_function (Unit_cell const &uc__, fft::Gvec const &gv__, sddk::mdarray< std::complex< double >, 2 > const &phase_factors_t__, sddk::mdarray< double, 2 > const &form_factors__)
 Make periodic out of form factors computed for G-shells. More...
 
template<typename T >
inner (PAW_field4D< T > const &x__, PAW_field4D< T > const &y__)
 
template<typename T >
inner (Periodic_function< T > const &f__, Periodic_function< T > const &g__)
 
template<typename T >
void copy (Periodic_function< T > const &src__, periodic_function_ptr_t< T > dest__)
 Copy values of the function to the external location. More...
 
template<typename T >
void copy (periodic_function_ptr_t< T > const src__, Periodic_function< T > &dest__)
 Copy the values of the function from the external location. More...
 
template<typename T >
void check_smooth_periodic_function_ptr (smooth_periodic_function_ptr_t< T > const &ptr__, fft::spfft_transform_type< T > const &spfft__)
 
template<typename T >
Smooth_periodic_vector_function< T > gradient (Smooth_periodic_function< T > &f__)
 Gradient of the function in the plane-wave domain. More...
 
template<typename T >
Smooth_periodic_function< T > divergence (Smooth_periodic_vector_function< T > &g__)
 Divergence of the vecor function. More...
 
template<typename T >
Smooth_periodic_function< T > laplacian (Smooth_periodic_function< T > &f__)
 Laplacian of the function in the plane-wave domain. More...
 
template<typename T >
Smooth_periodic_function< T > dot (Smooth_periodic_vector_function< T > &vf__, Smooth_periodic_vector_function< T > &vg__)
 
template<typename T , typename F >
inner_local (Smooth_periodic_function< T > const &f__, Smooth_periodic_function< T > const &g__, F &&theta__)
 Compute local contribution to inner product <f|g> More...
 
template<typename T >
inner_local (Smooth_periodic_function< T > const &f__, Smooth_periodic_function< T > const &g__)
 
template<typename T , typename F >
inner (Smooth_periodic_function< T > const &f__, Smooth_periodic_function< T > const &g__, F &&theta__)
 
template<typename T >
inner (Smooth_periodic_function< T > const &f__, Smooth_periodic_function< T > const &g__)
 Compute inner product <f|g> More...
 
template<typename T >
void copy (Smooth_periodic_function< T > const &src__, smooth_periodic_function_ptr_t< T > dest__)
 Copy real-space values from the function to external pointer. More...
 
template<typename T >
void copy (smooth_periodic_function_ptr_t< T > const src__, Smooth_periodic_function< T > &dest__)
 Copy real-space values from the external pointer to function. More...
 
template<typename T >
void copy (Smooth_periodic_function< T > const &src__, Smooth_periodic_function< T > &dest__)
 
template<typename T >
void scale (T alpha__, Smooth_periodic_function< T > &x__)
 
template<typename T >
void axpy (T alpha__, Smooth_periodic_function< T > const &x__, Smooth_periodic_function< T > &y__)
 
template<typename T >
auto operator* (Spheric_function< function_domain_t::spatial, T > const &a__, Spheric_function< function_domain_t::spatial, T > const &b__)
 Multiplication of two functions in spatial domain. More...
 
auto operator* (Spheric_vector_function< function_domain_t::spatial, double > const &f, Spheric_vector_function< function_domain_t::spatial, double > const &g)
 Dot product of two gradiensts of real functions in spatial domain. More...
 
template<function_domain_t domain_t, typename T >
auto operator+ (Spheric_function< domain_t, T > const &a__, Spheric_function< domain_t, T > const &b__)
 Summation of two functions. More...
 
template<function_domain_t domain_t, typename T >
auto operator- (Spheric_function< domain_t, T > const &a__, Spheric_function< domain_t, T > const &b__)
 Subtraction of functions. More...
 
template<function_domain_t domain_t, typename T >
auto operator* (T a__, Spheric_function< domain_t, T > const &b__)
 Multiply function by a scalar. More...
 
template<function_domain_t domain_t, typename T >
auto operator* (Spheric_function< domain_t, T > const &b__, T a__)
 Multiply function by a scalar (inverse order). More...
 
template<function_domain_t domain_t, typename T >
auto inner (Spheric_function< domain_t, T > const &f1, Spheric_function< domain_t, T > const &f2)
 Inner product of two spherical functions. More...
 
template<typename T >
auto laplacian (Spheric_function< function_domain_t::spectral, T > const &f__)
 Compute Laplacian of the spheric function. More...
 
void convert (Spheric_function< function_domain_t::spectral, std::complex< double > > const &f__, Spheric_function< function_domain_t::spectral, double > &g__)
 Convert from Ylm to Rlm representation. More...
 
auto convert (Spheric_function< function_domain_t::spectral, std::complex< double > > const &f__)
 Convert from Ylm to Rlm representation. More...
 
void convert (Spheric_function< function_domain_t::spectral, double > const &f__, Spheric_function< function_domain_t::spectral, std::complex< double > > &g__)
 Convert from Rlm to Ylm representation. More...
 
auto convert (Spheric_function< function_domain_t::spectral, double > const &f__)
 Convert from Rlm to Ylm representation. More...
 
template<typename T >
void transform (SHT const &sht__, Spheric_function< function_domain_t::spectral, T > const &f__, Spheric_function< function_domain_t::spatial, T > &g__)
 
template<typename T >
auto transform (SHT const &sht__, Spheric_function< function_domain_t::spectral, T > const &f__)
 Transform to spatial domain (to r, \theta, \phi coordinates). More...
 
template<typename T >
void transform (SHT const &sht__, Spheric_function< function_domain_t::spatial, T > const &f__, Spheric_function< function_domain_t::spectral, T > &g__)
 
template<typename T >
auto transform (SHT const &sht__, Spheric_function< function_domain_t::spatial, T > const &f__)
 Transform to spectral domain. More...
 
auto gradient (Spheric_function< function_domain_t::spectral, std::complex< double > > const &f)
 Gradient of the function in complex spherical harmonics. More...
 
auto gradient (Spheric_function< function_domain_t::spectral, double > const &f__)
 Gradient of the function in real spherical harmonics. More...
 
auto divergence (Spheric_vector_function< function_domain_t::spectral, std::complex< double > > const &vf__)
 Divergence of the vector function in complex spherical harmonics. More...
 
auto divergence (Spheric_vector_function< function_domain_t::spectral, double > const &vf)
 
template<typename T , typename I >
inner (Spheric_function_set< T, I > const &f1__, Spheric_function_set< T, I > const &f2__)
 
template<typename T , typename I >
void copy (Spheric_function_set< T, I > const &src__, spheric_function_set_ptr_t< T > dest__)
 Copy from Spheric_function_set to external pointer. More...
 
template<typename T , typename I >
void copy (spheric_function_set_ptr_t< T > const src__, Spheric_function_set< T, I > &dest__)
 Copy from external pointer to Spheric_function_set. More...
 
template<typename T , typename I >
void copy (Spheric_function_set< T, I > const &src__, Spheric_function_set< T, I > &dest__)
 
template<typename T , typename I >
void scale (T alpha__, Spheric_function_set< T, I > &x__)
 
template<typename T , typename I >
void axpy (T alpha__, Spheric_function_set< T, I > const &x__, Spheric_function_set< T, I > &y__)
 
template<typename T , typename F >
void add_k_point_contribution_nonlocal (Simulation_context &ctx__, Beta_projectors_base< T > &bp_base__, K_point< T > &kp__, sddk::mdarray< real_type< F >, 2 > &collect_res__)
 
void wavefunctions_strain_deriv (Simulation_context const &ctx__, K_point< double > &kp__, wf::Wave_functions< double > &dphi__, sddk::mdarray< double, 2 > const &rlm_g__, sddk::mdarray< double, 3 > const &rlm_dg__, int nu__, int mu__)
 
template<typename T , typename F >
void check_wave_functions (Hamiltonian_k< real_type< T > > const &Hk__, wf::Wave_functions< T > &psi__, wf::spin_range sr__, wf::band_range br__, double *eval__)
 
template<typename T , typename F >
void project_out_subspace (::spla::Context &spla_ctx__, sddk::memory_t mem__, wf::spin_range spins__, wf::Wave_functions< T > &phi__, wf::Wave_functions< T > &sphi__, int N__, int n__, la::dmatrix< F > &o__)
 
template<typename T , typename F , davidson_evp_t what>
auto davidson (Hamiltonian_k< T > const &Hk__, K_point< T > &kp__, wf::num_bands num_bands__, wf::num_mag_dims num_mag_dims__, wf::Wave_functions< T > &psi__, std::function< double(int, int)> tolerance__, double res_tol__, int num_steps__, bool locking__, int subspace_size__, bool estimate_eval__, bool extra_ortho__, std::ostream &out__, int verbosity__, wf::Wave_functions< T > *phi_extra__=nullptr)
 Solve the eigen-problem using Davidson iterative method. More...
 
template<typename T , typename F >
auto diagonalize (Hamiltonian0< T > const &H0__, K_point_set &kset__, double itsol_tol__)
 Diagonalize KS Hamiltonian for all k-points in the set. More...
 
void diagonalize_fp_fv_exact (Hamiltonian_k< float > const &, K_point< float > &)
 
void diagonalize_fp_fv_exact (Hamiltonian_k< double > const &Hk__, K_point< double > &kp__)
 
void get_singular_components (Hamiltonian_k< double > const &Hk__, K_point< double > &kp__, double itsol_tol__)
 
void diagonalize_fp_fv_davidson (Hamiltonian_k< float > const &, K_point< float > &, double)
 
void diagonalize_fp_fv_davidson (Hamiltonian_k< double > const &Hk__, K_point< double > &kp__, double itsol_tol__)
 
void diagonalize_fp_sv (Hamiltonian_k< float > const &, K_point< float > &)
 
void diagonalize_fp_sv (Hamiltonian_k< double > const &Hk__, K_point< double > &kp)
 Diagonalize second-variational Hamiltonian. More...
 
template<typename T >
void diagonalize_fp (Hamiltonian_k< T > const &Hk__, K_point< T > &kp__, double itsol_tol__)
 Diagonalize a full-potential LAPW Hamiltonian. More...
 
template<typename T , typename F >
std::enable_if_t<!std::is_same< T, real_type< F > >::value, void > diagonalize_pp_exact (int ispn__, Hamiltonian_k< T > const &Hk__, K_point< T > &kp)
 
template<typename T , typename F >
std::enable_if_t< std::is_same< T, real_type< F > >::value, void > diagonalize_pp_exact (int ispn__, Hamiltonian_k< T > const &Hk__, K_point< T > &kp__)
 
template<typename T , typename F >
sddk::mdarray< real_type< F >, 1 > diag_S_davidson (Hamiltonian_k< T > const &Hk__, K_point< T > &kp__)
 Diagonalize S-operator of the ultrasoft or PAW methods. More...
 
template<typename T , typename F >
auto diagonalize_pp (Hamiltonian_k< T > const &Hk__, K_point< T > &kp__, double itsol_tol__, double empy_tol__)
 
template<typename T , typename F >
void generate_subspace_matrix (Simulation_context &ctx__, int N__, int n__, int num_locked__, wf::Wave_functions< T > &phi__, wf::Wave_functions< T > &op_phi__, la::dmatrix< F > &mtrx__, la::dmatrix< F > *mtrx_old__=nullptr)
 Generate subspace matrix for the iterative diagonalization. More...
 
template<typename T , typename F >
void initialize_subspace (Hamiltonian_k< T > const &Hk__, K_point< T > &kp__, int num_ao__)
 Initialize the wave-functions subspace at a given k-point. More...
 
template<typename T >
void initialize_subspace (K_point_set &kset__, Hamiltonian0< T > &H0__)
 
template<typename T >
static void mul_by_veff (fft::spfft_transform_type< T > &spfftk__, T const *in__, std::array< std::unique_ptr< Smooth_periodic_function< T > >, 6 > const &veff_vec__, int idx_veff__, T *out__)
 Multiply FFT buffer by the effective potential. More...
 
template<typename T , typename F >
void apply_non_local_D_Q (sddk::memory_t mem__, wf::spin_range spins__, wf::band_range br__, Beta_projector_generator< T > &beta__, beta_projectors_coeffs_t< T > &beta_coeffs__, wf::Wave_functions< T > const &phi__, D_operator< T > const *d_op__, wf::Wave_functions< T > *hphi__, Q_operator< T > const *q_op__, wf::Wave_functions< T > *sphi__)
 
template<typename T , typename F >
void apply_S_operator (sddk::memory_t mem__, wf::spin_range spins__, wf::band_range br__, Beta_projector_generator< T > &beta__, beta_projectors_coeffs_t< T > &beta_coeffs__, wf::Wave_functions< T > const &phi__, Q_operator< T > const *q_op__, wf::Wave_functions< T > &sphi__)
 Compute |sphi> = (1 + Q)|phi> More...
 
template<typename T >
void apply_U_operator (Simulation_context &ctx__, wf::spin_range spins__, wf::band_range br__, wf::Wave_functions< T > const &hub_wf__, wf::Wave_functions< T > const &phi__, U_operator< T > const &um__, wf::Wave_functions< T > &hphi__)
 
void apply_S_operator_strain_deriv (sddk::memory_t mem__, int comp__, Beta_projector_generator< double > &bp__, beta_projectors_coeffs_t< double > &bp_coeffs__, Beta_projector_generator< double > &bp_strain_deriv__, beta_projectors_coeffs_t< double > &bp_strain_deriv_coeffs__, wf::Wave_functions< double > &phi__, Q_operator< double > &q_op__, wf::Wave_functions< double > &ds_phi__)
 Apply strain derivative of S-operator to all scalar functions. More...
 
template<typename T >
dmatrix< T > pseudopotential_hmatrix (K_point &kp__, int ispn__, Hamiltonian &H__)
 
template<typename T >
static void compute_residuals (sddk::memory_t mem__, wf::spin_range spins__, wf::num_bands num_bands__, sddk::mdarray< T, 1 > const &eval__, wf::Wave_functions< T > const &hpsi__, wf::Wave_functions< T > const &opsi__, wf::Wave_functions< T > &res__)
 Compute band residuals. More...
 
template<typename T >
void apply_preconditioner (sddk::memory_t mem__, wf::spin_range spins__, wf::num_bands num_bands__, wf::Wave_functions< T > &res__, sddk::mdarray< T, 2 > const &h_diag__, sddk::mdarray< T, 2 > const &o_diag__, sddk::mdarray< T, 1 > const &eval__)
 Apply preconditioner to the residuals. More...
 
template<typename T , typename F >
static auto normalized_preconditioned_residuals (sddk::memory_t mem__, wf::spin_range spins__, wf::num_bands num_bands__, sddk::mdarray< T, 1 > const &eval__, wf::Wave_functions< T > const &hpsi__, wf::Wave_functions< T > const &opsi__, wf::Wave_functions< T > &res__, sddk::mdarray< T, 2 > const &h_diag__, sddk::mdarray< T, 2 > const &o_diag__, T norm_tolerance__, bool gamma__)
 
template<typename T , typename F >
auto residuals (Simulation_context &ctx__, sddk::memory_t mem__, wf::spin_range sr__, int N__, int num_bands__, int num_locked__, sddk::mdarray< real_type< F >, 1 > &eval__, la::dmatrix< F > &evec__, wf::Wave_functions< T > &hphi__, wf::Wave_functions< T > &ophi__, wf::Wave_functions< T > &hpsi__, wf::Wave_functions< T > &opsi__, wf::Wave_functions< T > &res__, sddk::mdarray< T, 2 > const &h_diag__, sddk::mdarray< T, 2 > const &o_diag__, bool estimate_eval__, T norm_tolerance__, std::function< bool(int, int)> is_converged__)
 Compute residuals from eigen-vectors. More...
 
template void apply_U_operator< double > (Simulation_context &, wf::spin_range, wf::band_range, const wf::Wave_functions< double > &, const wf::Wave_functions< double > &, U_operator< double > const &, wf::Wave_functions< double > &)
 
void generate_potential (Hubbard_matrix const &om__, Hubbard_matrix &um__)
 
double energy (Hubbard_matrix const &om__)
 
double one_electron_energy_hubbard (Hubbard_matrix const &om__, Hubbard_matrix const &pm__)
 
void copy (Hubbard_matrix const &src__, Hubbard_matrix &dest__)
 
static void update_density_matrix_deriv (la::lib_t la__, sddk::memory_t mt__, int nwfh__, int nbnd__, std::complex< double > *alpha__, la::dmatrix< std::complex< double > > const &phi_hub_s_psi_deriv__, la::dmatrix< std::complex< double > > const &psi_s_phi_hub__, std::complex< double > *dn__, int ld__)
 
static void build_phi_hub_s_psi_deriv (Simulation_context const &ctx__, int nbnd__, int nawf__, la::dmatrix< std::complex< double > > const &ovlp__, la::dmatrix< std::complex< double > > const &inv_sqrt_O__, la::dmatrix< std::complex< double > > const &phi_atomic_s_psi__, la::dmatrix< std::complex< double > > const &phi_atomic_ds_psi__, std::vector< int > const &atomic_wf_offset__, std::vector< int > const &hubbard_wf_offset__, la::dmatrix< std::complex< double > > &phi_hub_s_psi_deriv__)
 
static void compute_inv_sqrt_O_deriv (la::dmatrix< std::complex< double > > &O_deriv__, la::dmatrix< std::complex< double > > &evec_O__, std::vector< double > &eval_O__, int nawf__)
 
static void generate_potential_collinear_nonlocal (Simulation_context const &ctx__, const int index__, sddk::mdarray< std::complex< double >, 3 > const &om__, sddk::mdarray< std::complex< double >, 3 > &um__)
 
static void generate_potential_collinear_local (Simulation_context const &ctx__, Atom_type const &atom_type__, const int idx_hub_wf, sddk::mdarray< std::complex< double >, 3 > const &om__, sddk::mdarray< std::complex< double >, 3 > &um__)
 
static double calculate_energy_collinear_nonlocal (Simulation_context const &ctx__, const int index__, sddk::mdarray< std::complex< double >, 3 > const &om__)
 
static double calculate_energy_collinear_local (Simulation_context const &ctx__, Atom_type const &atom_type__, const int idx_hub_wf, sddk::mdarray< std::complex< double >, 3 > const &om__)
 
static void generate_potential_non_collinear_local (Simulation_context const &ctx__, Atom_type const &atom_type__, const int idx_hub_wf, sddk::mdarray< std::complex< double >, 3 > const &om__, sddk::mdarray< std::complex< double >, 3 > &um__)
 
static double calculate_energy_non_collinear_local (Simulation_context const &ctx__, Atom_type const &atom_type__, const int idx_hub_wf, sddk::mdarray< std::complex< double >, 3 > const &om__)
 
template<typename T >
auto wave_function_factory (Simulation_context const &ctx__, K_point< T > const &kp__, wf::num_bands num_wf__, wf::num_mag_dims num_md__, bool mt_part__)
 
template void K_point_set::sync_band< double, sync_band_t::energy > ()
 
template void K_point_set::sync_band< double, sync_band_t::occupancy > ()
 
template<class F >
double bisection_search (F &&f, double a, double b, double tol, int maxstep=1000)
 
template<class Nt , class DNt , class D2Nt >
auto newton_minimization_chemical_potential (Nt &&N, DNt &&dN, D2Nt &&ddN, double mu0, double ne, double tol, int maxstep=1000)
 
template<bool conjugate, typename T >
auto generate_alm_block (Simulation_context const &ctx__, int atom_begin__, int num_atoms__, Matching_coefficients const &alm__)
 Generate matching coefficients for a block of atoms. More...
 
auto generate_gvec_ylm (Simulation_context const &ctx__, int lmax__)
 Generate complex spherical harmonics for the local set of G-vectors. More...
 
auto generate_sbessel_mt (Simulation_context const &ctx__, int lmax__)
 Compute values of spherical Bessel functions at MT boundary. More...
 
double unit_step_function_form_factors (double R__, double g__)
 Utility function to generate LAPW unit step function. More...
 
auto init_step_function (Unit_cell const &uc__, fft::Gvec const &gv__, fft::Gvec_fft const &gvec_fft__, sddk::mdarray< std::complex< double >, 2 > const &phase_factors_t__, fft::spfft_transform_type< double > spfft__)
 Unit step function is defined to be 1 in the interstitial and 0 inside muffin-tins. More...
 
auto sum_fg_fl_yg (Simulation_context const &ctx__, int lmax__, std::complex< double > const *fpw__, sddk::mdarray< double, 3 > &fl__, sddk::matrix< std::complex< double > > &gvec_ylm__)
 
template<class numeric_t >
auto make_matrix_view (nlcglib::buffer_protocol< numeric_t, 2 > &buf)
 
void apply_hamiltonian (Hamiltonian0< double > &H0, K_point< double > &kp, wf::Wave_functions< double > &wf_out, wf::Wave_functions< double > &wf, std::shared_ptr< wf::Wave_functions< double > > swf)
 
void call_nlcg (Simulation_context &ctx, config_t::nlcg_t const &nlcg_params, Energy &energy, K_point_set &kset, Potential &potential)
 
void check_xc_potential (Density const &rho__)
 
void mul_veff_with_phase_factors_gpu (int num_atoms__, int num_gvec_loc__, std::complex< double > const *veff__, int const *gvx__, int const *gvy__, int const *gvz__, double const *atom_pos__, double *veff_a__, int ld__, int stream_id__)
 
double xc_mt_paw (std::vector< XC_functional > const &xc_func__, int lmax__, int num_mag_dims__, SHT const &sht__, Radial_grid< double > const &rgrid__, std::vector< Flm const * > rho__, std::vector< double > const &rho_core__, std::vector< Flm > &vxc__, Flm &exclm__)
 
double density_residual_hartree_energy (Density const &rho1__, Density const &rho2__)
 
double xc_mt (Radial_grid< double > const &rgrid__, SHT const &sht__, std::vector< XC_functional > const &xc_func__, int num_mag_dims__, std::vector< Flm const * > rho__, std::vector< Flm * > vxc__, Flm *exc__)
 
void xc_mt_nonmagnetic (Radial_grid< double > const &rgrid__, SHT const &sht__, std::vector< XC_functional > const &xc_func__, Flm const &rho_lm__, Ftp &rho_tp__, Flm &vxc_lm__, Flm &exc_lm__)
 
void xc_mt_magnetic (Radial_grid< double > const &rgrid__, SHT const &sht__, int num_mag_dims__, std::vector< XC_functional > const &xc_func__, std::vector< Ftp > const &rho_tp__, std::vector< Flm * > vxc__, Flm &exc__)
 
template<typename T >
Radial_grid< T > Radial_grid_factory (radial_grid_t grid_type__, int num_points__, T rmin__, T rmax__, double p__)
 
std::pair< radial_grid_t, double > get_radial_grid_t (std::string str__)
 
template<typename T , typename U = double>
Spline< T, U > operator* (Spline< T, U > const &a__, Spline< T, U > const &b__)
 
void spline_inner_product_gpu_v3 (int const *idx_ri__, int num_ri__, int num_points__, double const *x__, double const *dx__, double const *f__, double const *g__, double *result__)
 
template<typename T >
inner (Spline< T > const &f__, Spline< T > const &g__, int m__, int num_points__)
 
template<typename T >
inner (Spline< T > const &f__, Spline< T > const &g__, int m__)
 
static bool & is_initialized ()
 Return the status of the library (initialized or not). More...
 
void initialize (bool call_mpi_init__=true)
 Initialize the library. More...
 
void finalize (bool call_mpi_fin__=true, bool reset_device__=true, bool fftw_cleanup__=true)
 Shut down the library. More...
 
void check_gvec (fft::Gvec const &gvec__, Crystal_symmetry const &sym__)
 
void check_gvec (fft::Gvec_shells const &gvec_shells__, Crystal_symmetry const &sym__)
 
static std::pair< std::vector< int >, std::vector< r3::vector< int > > > find_sym_atom (int num_atoms__, sddk::mdarray< double, 2 > const &positions__, r3::matrix< int > const &R__, r3::vector< double > const &t__, double tolerance__, bool inverse__=false)
 
static space_group_symmetry_descriptor get_spg_sym_op (int isym_spg__, SpglibDataset *spg_dataset__, r3::matrix< double > const &lattice_vectors__, int num_atoms__, sddk::mdarray< double, 2 > const &positions__, double tolerance__)
 
static space_group_symmetry_descriptor get_identity_spg_sym_op (int num_atoms__)
 
std::tuple< int, std::vector< double >, std::vector< std::array< double, 3 > > > get_irreducible_reciprocal_mesh (Crystal_symmetry const &sym__, r3::vector< int > k_mesh__, r3::vector< int > is_shift__)
 
auto metric_tensor (r3::matrix< double > const &lat_vec__)
 Compute a metric tensor. More...
 
double metric_tensor_error (r3::matrix< double > const &lat_vec__, r3::matrix< int > const &R__)
 Compute error of the symmetry-transformed metric tensor. More...
 
auto find_lat_sym (r3::matrix< double > const &lat_vec__, double tol__, double *mt_error__=nullptr)
 
double phi_by_sin_cos (double sinp, double cosp)
 Return angle phi in the range [0, 2Pi) by its values of sin(phi) and cos(phi). More...
 
auto rotation_matrix_su2 (std::array< double, 3 > u__, double theta__)
 Generate SU(2) rotation matrix from the axes and angle. More...
 
auto rotation_matrix_su2 (r3::matrix< double > R__)
 Generate SU2(2) rotation matrix from a 3x3 rotation matrix in Cartesian coordinates. More...
 
auto axis_angle (r3::matrix< double > R__)
 Get axis and angle from rotation matrix. More...
 
auto rot_mtrx_cart (r3::vector< double > euler_angles__)
 Generate rotation matrix from three Euler angles. More...
 
auto euler_angles (r3::matrix< double > const &rot__, double tolerance__)
 Compute Euler angles corresponding to the proper rotation matrix. More...
 
void apply_symmetry_to_density_matrix (sddk::mdarray< std::complex< double >, 3 > const &dm_ia__, basis_functions_index const &indexb__, const int num_mag_comp__, std::vector< sddk::mdarray< double, 2 > > const &rotm__, sddk::mdarray< std::complex< double >, 2 > const &spin_rot_su2__, sddk::mdarray< std::complex< double >, 3 > &dm_ja__)
 
void symmetrize_density_matrix (Unit_cell const &uc__, density_matrix_t &dm__, int num_mag_comp__)
 Symmetrize density matrix. More...
 
void symmetrize_field4d (Field4D &f__)
 
void symmetrize_forces (Unit_cell const &uc__, sddk::mdarray< double, 2 > &f__)
 
template<typename Index_t >
void symmetrize_mt_function (Crystal_symmetry const &sym__, mpi::Communicator const &comm__, int num_mag_dims__, std::vector< Spheric_function_set< double, Index_t > * > frlm__)
 
void symmetrize_occupation_matrix (Occupation_matrix &om__)
 
void symmetrize_pw_function (Crystal_symmetry const &sym__, fft::Gvec_shells const &gvec_shells__, sddk::mdarray< std::complex< double >, 3 > const &sym_phase_factors__, int num_mag_dims__, std::vector< Smooth_periodic_function< double > * > frg__)
 Symmetrize scalar or vector function. More...
 
void symmetrize_stress_tensor (Crystal_symmetry const &sym__, r3::matrix< double > &s__)
 
template<typename F >
int call_test (std::string label__, F &&f__)
 
template<typename F >
int call_test (std::string label__, F &&f__, cmd_args const &args__)
 
template<typename T >
auto random_symmetric (int N__, int bs__, la::BLACS_grid const &blacs_grid__)
 
template<typename T >
auto random_positive_definite (int N__, int bs__=16, la::BLACS_grid const *blacs_grid__=nullptr)
 
auto create_simulation_context (nlohmann::json const &conf__, r3::matrix< double > L__, int num_atoms__, std::vector< r3::vector< double > > coord__, bool add_vloc__, bool add_dion__)
 
template<typename T >
void randomize (wf::Wave_functions< T > &wf__)
 
std::ostream & operator<< (std::ostream &out, ps_atomic_wf_descriptor const &wfd)
 
auto begin (basis_functions_index const &idx__)
 
auto end (basis_functions_index const &idx__)
 
std::ostream & operator<< (std::ostream &out, hubbard_orbital_descriptor const &ho)
 
bool operator== (angular_momentum lhs__, angular_momentum rhs__)
 
bool operator!= (angular_momentum lhs__, angular_momentum rhs__)
 
std::ostream & operator<< (std::ostream &out, angular_momentum am)
 Output angular momentum to a stream. More...
 
auto begin (radial_functions_index const &idx__)
 
auto end (radial_functions_index const &idx__)
 

Variables

integer, parameter, public sirius_integer_type = 1
 
integer, parameter, public sirius_logical_type = 2
 
integer, parameter, public sirius_string_type = 3
 
integer, parameter, public sirius_number_type = 4
 
integer, parameter, public sirius_object_type = 5
 
integer, parameter, public sirius_array_type = 6
 
integer, parameter, public sirius_integer_array_type = 7
 
integer, parameter, public sirius_logical_array_type = 8
 
integer, parameter, public sirius_number_array_type = 9
 
integer, parameter, public sirius_string_array_type = 10
 
integer, parameter, public sirius_object_array_type = 11
 
integer, parameter, public sirius_array_array_type = 12
 
const double speed_of_light = 137.035999139
 NIST value for the inverse fine structure (http://physics.nist.gov/cuu/Constants/index.html) More...
 
const double bohr_radius = 0.52917721067
 Bohr radius in angstroms. More...
 
const double pi = 3.1415926535897932385
 \( \pi \) More...
 
const double twopi = 6.2831853071795864769
 \( 2\pi \) More...
 
const double fourpi = 12.566370614359172954
 \( 4\pi \) More...
 
const double y00 = 0.28209479177387814347
 First spherical harmonic \( Y_{00} = \frac{1}{\sqrt{4\pi}} \). More...
 
const double ha2ev = 27.21138505
 Hartree in electron-volt units. More...
 
const char *const storage_file_name = "sirius.h5"
 
const std::complex< double > pauli_matrix [4][2][2]
 Pauli matrices in {I, Z, X, Y} order. More...
 
::rt_graph::Timer global_rtgraph_timer
 
template<class T >
constexpr bool is_real_v = std::is_same<T, real_type<T>>::value
 
const std::map< std::string, int > libxc_functionals
 
json sirius_options_parser_
 

Detailed Description

Namespace of the SIRIUS library.

Typedef Documentation

◆ acc_stream_t

using sirius::acc_stream_t = typedef cudaStream_t

Definition at line 62 of file acc.hpp.

◆ acc_error_t

using sirius::acc_error_t = typedef cudaError_t

Definition at line 70 of file acc.hpp.

◆ acc_complex_float_t

using sirius::acc_complex_float_t = typedef cuFloatComplex

Definition at line 78 of file acc.hpp.

◆ acc_complex_double_t

using sirius::acc_complex_double_t = typedef cuDoubleComplex

Definition at line 79 of file acc.hpp.

◆ gpu_complex_type

template<typename T >
using sirius::gpu_complex_type = typedef typename GPU_Complex<T>::type

Definition at line 124 of file acc.hpp.

◆ real_type

template<typename T >
using sirius::real_type = typedef typename Real<T>::type

Definition at line 48 of file acc_common.hpp.

◆ n_blocks

using sirius::n_blocks = typedef strong_type<int, struct __n_blocks_tag>

Number of blocks to which the global index is split.

Definition at line 105 of file splindex.hpp.

◆ block_id

using sirius::block_id = typedef strong_type<int, struct __block_id_tag>

ID of the block.

The id of the block has the range [0, n_blocks)

Definition at line 108 of file splindex.hpp.

◆ time_point_t

using sirius::time_point_t = typedef std::chrono::high_resolution_clock::time_point

Definition at line 54 of file time_tools.hpp.

◆ identity_t

template<class X >
using sirius::identity_t = typedef typename identity<X>::type

Definition at line 37 of file traits.hpp.

◆ radial_solution_descriptor_set

Set of radial solution descriptors, used to construct augmented waves or local orbitals.

Definition at line 155 of file typedefs.hpp.

◆ Flm

Definition at line 205 of file spheric_function.hpp.

◆ Ftp

Definition at line 206 of file spheric_function.hpp.

◆ lmax_t

using sirius::lmax_t = typedef strong_type<int, struct __lmax_t_tag>

Definition at line 9 of file spheric_function_set.hpp.

◆ rf_index

using sirius::rf_index = typedef strong_type<int, struct __rf_index_tag>

Radial function index.

Definition at line 34 of file radial_functions_index.hpp.

◆ rf_aw_index

using sirius::rf_aw_index = typedef strong_type<int, struct __rf_aw_index_tag>

Augmented wave radial function index.

Definition at line 36 of file radial_functions_index.hpp.

◆ rf_lo_index

using sirius::rf_lo_index = typedef strong_type<int, struct __rf_lo_index_tag>

Local orbital radial function index.

Definition at line 38 of file radial_functions_index.hpp.

◆ bf_index

using sirius::bf_index = typedef strong_type<int, struct __bf_index_tag>

Basis function index.

Definition at line 40 of file radial_functions_index.hpp.

◆ bf_aw_index

using sirius::bf_aw_index = typedef strong_type<int, struct __bf_aw_index_tag>

Augmented wave basis function index.

Definition at line 42 of file radial_functions_index.hpp.

◆ bf_lo_index

using sirius::bf_lo_index = typedef strong_type<int, struct __bf_lo_index_tag>

Local orbital basis function index.

Definition at line 44 of file radial_functions_index.hpp.

◆ json

using sirius::json = typedef nlohmann::json

Definition at line 36 of file unit_cell.hpp.

Enumeration Type Documentation

◆ hdf5_access_t

enum class sirius::hdf5_access_t
strong

Definition at line 38 of file hdf5_tree.hpp.

◆ index_domain_t

enum class sirius::index_domain_t
strong
Enumerator
global 

Global index.

local 

Local index.

Definition at line 110 of file splindex.hpp.

◆ spin_block_t

enum class sirius::spin_block_t
strong

Spin-blocks of the Hamiltonian.

Enumerator
nm 

Non-magnetic case.

uu 

Up-up block.

dd 

Down-donw block.

ud 

Up-down block.

du 

Down-up block.

Definition at line 56 of file typedefs.hpp.

◆ electronic_structure_method_t

Type of electronic structure methods.

Enumerator
full_potential_lapwlo 

Full potential linearized augmented plane waves with local orbitals.

pseudopotential 

Pseudopotential (ultrasoft, norm-conserving, PAW).

Definition at line 75 of file typedefs.hpp.

◆ function_domain_t

enum class sirius::function_domain_t
strong

Type of a function domain.

Enumerator
spatial 

Spatial domain.

spectral 

Spectral domain.

Definition at line 85 of file typedefs.hpp.

◆ relativity_t

enum class sirius::relativity_t
strong

Type of relativity treatment in the case of LAPW.

Definition at line 94 of file typedefs.hpp.

◆ davidson_evp_t

enum class sirius::davidson_evp_t
strong

Definition at line 48 of file davidson.hpp.

◆ sync_band_t

enum class sirius::sync_band_t
strong

Definition at line 33 of file k_point_set.hpp.

◆ radial_grid_t

enum class sirius::radial_grid_t : int
strong

Types of radial grid.

Definition at line 34 of file radial_grid.hpp.

Function/Subroutine Documentation

◆ string_f2c()

character(kind=c_char,len=1) function, dimension(len_trim(f_string) + 1) sirius::string_f2c ( character(kind=c_char,len=*), intent(in)  f_string)

Internal function that adds trailing null character to the string to make it C-style.

Definition at line 46 of file sirius.f90.

◆ string_c2f()

character(kind=c_char,len=size(c_string) - 1) function sirius::string_c2f ( character(kind=c_char,len=1), dimension(:), intent(in)  c_string)

Internal function that converts C-string (with trailing null character) to the Fortran string.

Definition at line 58 of file sirius.f90.

◆ sirius_initialize()

subroutine sirius::sirius_initialize ( logical, intent(in), target  call_mpi_init,
integer, intent(out), optional, target  error_code 
)

Initialize the SIRIUS library.

Parameters
[in]call_mpi_initIf .true. then MPI_Init must be called prior to initialization.
[out]error_codeError code.

Definition at line 77 of file sirius.f90.

◆ sirius_finalize()

subroutine sirius::sirius_finalize ( logical, intent(in), optional, target  call_mpi_fin,
logical, intent(in), optional, target  call_device_reset,
logical, intent(in), optional, target  call_fftw_fin,
integer, intent(out), optional, target  error_code 
)

Shut down the SIRIUS library.

Parameters
[in]call_mpi_finIf .true. then MPI_Finalize must be called after the shutdown.
[in]call_device_resetIf .true. then cuda device is reset after shutdown.
[in]call_fftw_finIf .true. then fft_cleanup must be called after the shutdown.
[out]error_codeError code.

Definition at line 112 of file sirius.f90.

◆ sirius_start_timer()

subroutine sirius::sirius_start_timer ( character(*), intent(in), target  name,
integer, intent(out), optional, target  error_code 
)

Start the timer.

Parameters
[in]nameTimer label.
[out]error_codeError code.

Definition at line 172 of file sirius.f90.

◆ sirius_stop_timer()

subroutine sirius::sirius_stop_timer ( character(*), intent(in), target  name,
integer, intent(out), optional, target  error_code 
)

Stop the running timer.

Parameters
[in]nameTimer label.
[out]error_codeError code.

Definition at line 207 of file sirius.f90.

◆ sirius_print_timers()

subroutine sirius::sirius_print_timers ( logical, intent(in), target  flatten,
integer, intent(out), optional, target  error_code 
)

Print all timers.

Parameters
[in]flattenIf true, flat list of timers is printed.
[out]error_codeError code.

Definition at line 242 of file sirius.f90.

◆ sirius_serialize_timers()

subroutine sirius::sirius_serialize_timers ( character(*), intent(in), target  fname,
integer, intent(out), optional, target  error_code 
)

Save all timers to JSON file.

Parameters
[in]fnameName of the output JSON file.
[out]error_codeError code.

Definition at line 275 of file sirius.f90.

◆ sirius_context_initialized()

subroutine sirius::sirius_context_initialized ( type(sirius_context_handler), intent(in), target  handler,
logical, intent(out), target  status,
integer, intent(out), optional, target  error_code 
)

Check if the simulation context is initialized.

Parameters
[in]handlerSimulation context handler.
[out]statusStatus of the library (true if initialized)
[out]error_codeError code.

Definition at line 311 of file sirius.f90.

◆ sirius_create_context()

subroutine sirius::sirius_create_context ( integer, intent(in), value  fcomm,
type(sirius_context_handler), intent(out), target  handler,
integer, intent(in), optional, target  fcomm_k,
integer, intent(in), optional, target  fcomm_band,
integer, intent(out), optional, target  error_code 
)

Create context of the simulation.

Simulation context is the complex data structure that holds all the parameters of the individual simulation. The context must be created, populated with the correct parameters and initialized before using all subsequent SIRIUS functions.

Parameters
[in]fcommEntire communicator of the simulation.
[out]handlerNew empty simulation context.
[in]fcomm_kCommunicator for k-point parallelization.
[in]fcomm_bandCommunicator for band parallelization.
[out]error_codeError code.

Definition at line 355 of file sirius.f90.

◆ sirius_import_parameters()

subroutine sirius::sirius_import_parameters ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  str,
integer, intent(out), optional, target  error_code 
)

Import parameters of simulation from a JSON string.

Parameters
[in]handlerSimulation context handler.
[in]strJSON string with parameters or a JSON file.
[out]error_codeError code

Definition at line 403 of file sirius.f90.

◆ sirius_set_parameters()

subroutine sirius::sirius_set_parameters ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(in), optional, target  lmax_apw,
integer, intent(in), optional, target  lmax_rho,
integer, intent(in), optional, target  lmax_pot,
integer, intent(in), optional, target  num_fv_states,
integer, intent(in), optional, target  num_bands,
integer, intent(in), optional, target  num_mag_dims,
real(8), intent(in), optional, target  pw_cutoff,
real(8), intent(in), optional, target  gk_cutoff,
integer, dimension(3), intent(in), optional, target  fft_grid_size,
integer, intent(in), optional, target  auto_rmt,
logical, intent(in), optional, target  gamma_point,
logical, intent(in), optional, target  use_symmetry,
logical, intent(in), optional, target  so_correction,
character(*), intent(in), optional, target  valence_rel,
character(*), intent(in), optional, target  core_rel,
real(8), intent(in), optional, target  iter_solver_tol_empty,
character(*), intent(in), optional, target  iter_solver_type,
integer, intent(in), optional, target  verbosity,
logical, intent(in), optional, target  hubbard_correction,
integer, intent(in), optional, target  hubbard_correction_kind,
logical, intent(in), optional, target  hubbard_full_orthogonalization,
character(*), intent(in), optional, target  hubbard_orbitals,
integer, intent(in), optional, target  sht_coverage,
real(8), intent(in), optional, target  min_occupancy,
character(*), intent(in), optional, target  smearing,
real(8), intent(in), optional, target  smearing_width,
real(8), intent(in), optional, target  spglib_tol,
character(*), intent(in), optional, target  electronic_structure_method,
integer, intent(out), optional, target  error_code 
)

Set parameters of the simulation.

Parameters
[in]handlerSimulation context handler
[in]lmax_apwMaximum orbital quantum number for APW functions.
[in]lmax_rhoMaximum orbital quantum number for density.
[in]lmax_potMaximum orbital quantum number for potential.
[in]num_fv_statesNumber of first-variational states.
[in]num_bandsNumber of bands.
[in]num_mag_dimsNumber of magnetic dimensions.
[in]pw_cutoffCutoff for G-vectors.
[in]gk_cutoffCutoff for G+k-vectors.
[in]fft_grid_sizeSize of the fine-grain FFT grid.
[in]auto_rmtSet the automatic search of muffin-tin radii.
[in]gamma_pointTrue if this is a Gamma-point calculation.
[in]use_symmetryTrue if crystal symmetry is taken into account.
[in]so_correctionTrue if spin-orbit correnctio is enabled.
[in]valence_relValence relativity treatment.
[in]core_relCore relativity treatment.
[in]iter_solver_tol_emptyTolerance for the empty states.
[in]iter_solver_typeType of iterative solver.
[in]verbosityVerbosity level.
[in]hubbard_correctionTrue if LDA+U correction is enabled.
[in]hubbard_correction_kindType of LDA+U implementation (simplified or full).
[in]hubbard_full_orthogonalizationUse all atomic orbitals found in all ps potentials to compute the orthogonalization operator.
[in]hubbard_orbitalsType of localized orbitals.
[in]sht_coverageType of spherical coverage (0 for Lebedev-Laikov, 1 for uniform).
[in]min_occupancyMinimum band occupancy to trat is as "occupied".
[in]smearingType of occupancy smearing.
[in]smearing_widthSmearing width
[in]spglib_tolTolerance for the spglib symmetry search.
[in]electronic_structure_methodType of electronic structure method.
[out]error_codeError code.

Definition at line 471 of file sirius.f90.

◆ sirius_get_parameters()

subroutine sirius::sirius_get_parameters ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(out), optional, target  lmax_apw,
integer, intent(out), optional, target  lmax_rho,
integer, intent(out), optional, target  lmax_pot,
integer, intent(out), optional, target  num_fv_states,
integer, intent(out), optional, target  num_bands,
integer, intent(out), optional, target  num_spins,
integer, intent(out), optional, target  num_mag_dims,
real(8), intent(out), optional, target  pw_cutoff,
real(8), intent(out), optional, target  gk_cutoff,
integer, dimension(3), intent(out), optional, target  fft_grid_size,
integer, intent(out), optional, target  auto_rmt,
logical, intent(out), optional, target  gamma_point,
logical, intent(out), optional, target  use_symmetry,
logical, intent(out), optional, target  so_correction,
real(8), intent(out), optional, target  iter_solver_tol,
real(8), intent(out), optional, target  iter_solver_tol_empty,
integer, intent(out), optional, target  verbosity,
logical, intent(out), optional, target  hubbard_correction,
real(8), intent(out), optional, target  evp_work_count,
integer, intent(out), optional, target  num_loc_op_applied,
integer, intent(out), optional, target  num_sym_op,
character(*), intent(out), optional, target  electronic_structure_method,
integer, intent(out), optional, target  error_code 
)

Get parameters of the simulation.

Parameters
[in]handlerSimulation context handler
[out]lmax_apwMaximum orbital quantum number for APW functions.
[out]lmax_rhoMaximum orbital quantum number for density.
[out]lmax_potMaximum orbital quantum number for potential.
[out]num_fv_statesNumber of first-variational states.
[out]num_bandsNumber of bands.
[out]num_spinsNumber of spins.
[out]num_mag_dimsNumber of magnetic dimensions.
[out]pw_cutoffCutoff for G-vectors.
[out]gk_cutoffCutoff for G+k-vectors.
[out]fft_grid_sizeSize of the fine-grain FFT grid.
[out]auto_rmtSet the automatic search of muffin-tin radii.
[out]gamma_pointTrue if this is a Gamma-point calculation.
[out]use_symmetryTrue if crystal symmetry is taken into account.
[out]so_correctionTrue if spin-orbit correnctio is enabled.
[out]iter_solver_tolTolerance of the iterative solver (deprecated).
[out]iter_solver_tol_emptyTolerance for the empty states.
[out]verbosityVerbosity level.
[out]hubbard_correctionTrue if LDA+U correction is enabled.
[out]evp_work_countInternal counter of total eigen-value problem work.
[out]num_loc_op_appliedInternal counter of the number of wave-functions to which Hamiltonian was applied.
[out]num_sym_opNumber of symmetry operations discovered by spglib
[out]electronic_structure_methodType of electronic structure method.
[out]error_codeError code.

Definition at line 792 of file sirius.f90.

◆ sirius_add_xc_functional()

subroutine sirius::sirius_add_xc_functional ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  name,
integer, intent(out), optional, target  error_code 
)

Add one of the XC functionals.

Parameters
[in]handlerSimulation context handler
[in]nameLibXC label of the functional.
[out]error_codeError code.

Definition at line 1011 of file sirius.f90.

◆ sirius_set_mpi_grid_dims()

subroutine sirius::sirius_set_mpi_grid_dims ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(in), target  ndims,
integer, dimension(ndims), intent(in), target  dims,
integer, intent(out), optional, target  error_code 
)

Set dimensions of the MPI grid.

Parameters
[in]handlerSimulation context handler
[in]ndimsNumber of dimensions.
[in]dimsSize of each dimension.
[out]error_codeError code.

Definition at line 1053 of file sirius.f90.

◆ sirius_set_lattice_vectors()

subroutine sirius::sirius_set_lattice_vectors ( type(sirius_context_handler), intent(in), target  handler,
real(8), dimension(3), intent(in), target  a1,
real(8), dimension(3), intent(in), target  a2,
real(8), dimension(3), intent(in), target  a3,
integer, intent(out), optional, target  error_code 
)

Set vectors of the unit cell.

Parameters
[in]handlerSimulation context handler
[in]a11st vector
[in]a22nd vector
[in]a33rd vector
[out]error_codeError code.

Definition at line 1097 of file sirius.f90.

◆ sirius_initialize_context()

subroutine sirius::sirius_initialize_context ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(out), optional, target  error_code 
)

Initialize simulation context.

Parameters
[in]handlerSimulation context handler.
[out]error_codeError code.

Definition at line 1143 of file sirius.f90.

◆ sirius_update_context()

subroutine sirius::sirius_update_context ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(out), optional, target  error_code 
)

Update simulation context after changing lattice or atomic positions.

Parameters
[in]handlerSimulation context handler.
[out]error_codeError code.

Definition at line 1174 of file sirius.f90.

◆ sirius_print_info()

subroutine sirius::sirius_print_info ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(out), optional, target  error_code 
)

Print basic info.

Parameters
[in]handlerSimulation context handler.
[out]error_codeError code.

Definition at line 1205 of file sirius.f90.

◆ sirius_free_object_handler()

subroutine sirius::sirius_free_object_handler ( type(c_ptr), intent(inout), target  handler,
integer, intent(out), optional, target  error_code 
)

Free any object handler created by SIRIUS.

This is an internal function. Use sirius_free_handler() in your code.

Parameters
[in,out]handlerHandler of the object.
[out]error_codeError code

Definition at line 1238 of file sirius.f90.

◆ sirius_set_periodic_function_ptr()

subroutine sirius::sirius_set_periodic_function_ptr ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
real(8), dimension(:,:,:), intent(in), optional, target  f_mt,
integer, intent(in), optional, target  lmmax,
integer, intent(in), optional, target  nrmtmax,
integer, intent(in), optional, target  num_atoms,
real(8), dimension(:), intent(in), optional, target  f_rg,
integer, intent(in), optional, target  size_x,
integer, intent(in), optional, target  size_y,
integer, intent(in), optional, target  size_z,
integer, intent(in), optional, target  offset_z,
integer, intent(out), optional, target  error_code 
)

Set pointer to density or magnetization.

Parameters
[in]handlerSimulation context handler.
[in]labelLabel of the function.
[in]f_mtPointer to the muffin-tin part of the function.
[in]lmmaxNumber of lm components.
[in]nrmtmaxMaximum number of muffin-tin points.
[in]num_atomsTotal number of atoms.
[in]f_rgPointer to the regular-grid part of the function.
[in]size_xSize of X-dimension of FFT grid.
[in]size_ySize of Y-dimension of FFT grid.
[in]size_zLocal or global size of Z-dimension of FFT grid depending on offset_z
[in]offset_zOffset in the Z-dimension of FFT grid for this MPI rank.
[out]error_codeError code

Definition at line 1279 of file sirius.f90.

◆ sirius_set_periodic_function()

subroutine sirius::sirius_set_periodic_function ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  label,
real(8), dimension(:,:,:), intent(in), optional, target  f_mt,
integer, intent(in), optional, target  lmmax,
integer, intent(in), optional, target  nrmtmax,
integer, intent(in), optional, target  num_atoms,
real(8), dimension(:), intent(in), optional, target  f_rg,
integer, intent(in), optional, target  size_x,
integer, intent(in), optional, target  size_y,
integer, intent(in), optional, target  size_z,
integer, intent(in), optional, target  offset_z,
integer, intent(out), optional, target  error_code 
)

Set values of the periodic function.

Parameters
[in]handlerHandler of the DFT ground state object.
[in]labelLabel of the function.
[in]f_mtPointer to the muffin-tin part of the function.
[in]lmmaxNumber of lm components.
[in]nrmtmaxMaximum number of muffin-tin points.
[in]num_atomsTotal number of atoms.
[in]f_rgPointer to the regular-grid part of the function.
[in]size_xSize of X-dimension of FFT grid.
[in]size_ySize of Y-dimension of FFT grid.
[in]size_zLocal or global size of Z-dimension of FFT grid depending on offset_z
[in]offset_zOffset in the Z-dimension of FFT grid for this MPI rank.
[out]error_codeError code.

Definition at line 1396 of file sirius.f90.

◆ sirius_get_periodic_function()

subroutine sirius::sirius_get_periodic_function ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  label,
real(8), dimension(:,:,:), intent(in), optional, target  f_mt,
integer, intent(in), optional, target  lmmax,
integer, intent(in), optional, target  nrmtmax,
integer, intent(in), optional, target  num_atoms,
real(8), dimension(:), intent(in), optional, target  f_rg,
integer, intent(in), optional, target  size_x,
integer, intent(in), optional, target  size_y,
integer, intent(in), optional, target  size_z,
integer, intent(in), optional, target  offset_z,
integer, intent(out), optional, target  error_code 
)

Get values of the periodic function.

Parameters
[in]handlerHandler of the DFT ground state object.
[in]labelLabel of the function.
[in]f_mtPointer to the muffin-tin part of the function.
[in]lmmaxNumber of lm components.
[in]nrmtmaxMaximum number of muffin-tin points.
[in]num_atomsTotal number of atoms.
[in]f_rgPointer to the regular-grid part of the function.
[in]size_xSize of X-dimension of FFT grid.
[in]size_ySize of Y-dimension of FFT grid.
[in]size_zLocal or global size of Z-dimension of FFT grid depending on offset_z
[in]offset_zOffset in the Z-dimension of FFT grid for this MPI rank.
[out]error_codeError code

Definition at line 1512 of file sirius.f90.

◆ sirius_create_kset()

subroutine sirius::sirius_create_kset ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(in), target  num_kpoints,
real(8), dimension(3,num_kpoints), intent(in), target  kpoints,
real(8), dimension(num_kpoints), intent(in), target  kpoint_weights,
logical, intent(in), target  init_kset,
type(sirius_kpoint_set_handler), intent(out), target  kset_handler,
integer, intent(out), optional, target  error_code 
)

Create k-point set from the list of k-points.

Parameters
[in]handlerSimulation context handler.
[in]num_kpointsTotal number of k-points in the set.
[in]kpointsList of k-points in lattice coordinates.
[in]kpoint_weightsWeights of k-points.
[in]init_ksetIf .true. k-set will be initialized.
[out]kset_handlerHandler of the newly created k-point set.
[out]error_codeError code.

Definition at line 1623 of file sirius.f90.

◆ sirius_create_kset_from_grid()

subroutine sirius::sirius_create_kset_from_grid ( type(sirius_context_handler), intent(in), target  handler,
integer, dimension(3), intent(in), target  k_grid,
integer, dimension(3), intent(in), target  k_shift,
logical, intent(in), target  use_symmetry,
type(sirius_kpoint_set_handler), intent(out), target  kset_handler,
integer, intent(out), optional, target  error_code 
)

Create k-point set from a grid.

Parameters
[in]handlerSimulation context handler.
[in]k_griddimensions of the k points grid.
[in]k_shiftk point shifts.
[in]use_symmetryIf .true. k-set will be generated using symmetries.
[out]kset_handlerHandler of the newly created k-point set.
[out]error_codeError code.

Definition at line 1688 of file sirius.f90.

◆ sirius_create_ground_state()

subroutine sirius::sirius_create_ground_state ( type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
type(sirius_ground_state_handler), intent(out), target  gs_handler,
integer, intent(out), optional, target  error_code 
)

Create a ground state object.

Parameters
[in]ks_handlerHandler of the k-point set.
[out]gs_handlerHandler of the newly created ground state object.
[out]error_codeError code.

Definition at line 1745 of file sirius.f90.

◆ sirius_initialize_kset()

subroutine sirius::sirius_initialize_kset ( type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
integer, dimension(:), intent(in), optional, target  count,
integer, intent(out), optional, target  error_code 
)

Initialize k-point set.

Parameters
[in]ks_handlerK-point set handler.
[in]countLocal number of k-points for each MPI rank.
[out]error_codeError code.

Definition at line 1782 of file sirius.f90.

◆ sirius_find_ground_state()

subroutine sirius::sirius_find_ground_state ( type(sirius_ground_state_handler), intent(in), target  gs_handler,
real(8), intent(in), optional, target  density_tol,
real(8), intent(in), optional, target  energy_tol,
real(8), intent(in), optional, target  iter_solver_tol,
logical, intent(in), optional, target  initial_guess,
integer, intent(in), optional, target  max_niter,
logical, intent(in), optional, target  save_state,
logical, intent(out), optional, target  converged,
integer, intent(out), optional, target  niter,
real(8), intent(out), optional, target  rho_min,
integer, intent(out), optional, target  error_code 
)

Find the ground state.

Parameters
[in]gs_handlerHandler of the ground state.
[in]density_tolTolerance on RMS in density.
[in]energy_tolTolerance in total energy difference.
[in]iter_solver_tolInitial tolerance of the iterative solver.
[in]initial_guessBoolean variable indicating if we want to start from the initial guess or from previous state.
[in]max_niterMaximum number of SCF iterations.
[in]save_stateBoolean variable indicating if we want to save the ground state.
[out]convergedBoolean variable indicating if the calculation has converged
[out]niterActual number of SCF iterations.
[out]rho_minMinimum value of density on the real-space grid. If negative, total energy can't be trusted. Valid only if SCF calculation is converged.
[out]error_codeError code.

Definition at line 1829 of file sirius.f90.

◆ sirius_check_scf_density()

subroutine sirius::sirius_check_scf_density ( type(sirius_ground_state_handler), intent(in), target  gs_handler,
integer, intent(out), optional, target  error_code 
)

Check the self-consistent density.

Parameters
[in]gs_handlerHandler of the ground state.
[out]error_codeError code

Definition at line 1939 of file sirius.f90.

◆ sirius_update_ground_state()

subroutine sirius::sirius_update_ground_state ( type(sirius_ground_state_handler), intent(in), target  gs_handler,
integer, intent(out), optional, target  error_code 
)

Update a ground state object after change of atomic coordinates or lattice vectors.

Parameters
[in]gs_handlerGround-state handler.
[out]error_codeError code

Definition at line 1970 of file sirius.f90.

◆ sirius_add_atom_type()

subroutine sirius::sirius_add_atom_type ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
character(*), intent(in), optional, target  fname,
integer, intent(in), optional, target  zn,
character(*), intent(in), optional, target  symbol,
real(8), intent(in), optional, target  mass,
logical, intent(in), optional, target  spin_orbit,
integer, intent(out), optional, target  error_code 
)

Add new atom type to the unit cell.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type unique label.
[in]fnameSpecies file name (in JSON format).
[in]znNucleus charge.
[in]symbolAtomic symbol.
[in]massAtomic mass.
[in]spin_orbitTrue if spin-orbit correction is enabled for this atom type.
[out]error_codeError code.

Definition at line 2007 of file sirius.f90.

◆ sirius_set_atom_type_radial_grid()

subroutine sirius::sirius_set_atom_type_radial_grid ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, intent(in), target  num_radial_points,
real(8), dimension(num_radial_points), intent(in), target  radial_points,
integer, intent(out), optional, target  error_code 
)

Set radial grid of the atom type.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[in]num_radial_pointsNumber of radial grid points.
[in]radial_pointsList of radial grid points.
[out]error_codeError code.

Definition at line 2103 of file sirius.f90.

◆ sirius_set_atom_type_radial_grid_inf()

subroutine sirius::sirius_set_atom_type_radial_grid_inf ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, intent(in), target  num_radial_points,
real(8), dimension(num_radial_points), intent(in), target  radial_points,
integer, intent(out), optional, target  error_code 
)

Set radial grid of the free atom (up to effectice infinity).

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[in]num_radial_pointsNumber of radial grid points.
[in]radial_pointsList of radial grid points.
[out]error_codeError code.

Definition at line 2159 of file sirius.f90.

◆ sirius_add_atom_type_radial_function()

subroutine sirius::sirius_add_atom_type_radial_function ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  atom_type,
character(*), intent(in), target  label,
real(8), dimension(num_points), intent(in), target  rf,
integer, intent(in), target  num_points,
integer, intent(in), optional, target  n,
integer, intent(in), optional, target  l,
integer, intent(in), optional, target  idxrf1,
integer, intent(in), optional, target  idxrf2,
real(8), intent(in), optional, target  occ,
integer, intent(out), optional, target  error_code 
)

Add one of the radial functions.

Parameters
[in]handlerSimulation context handler.
[in]atom_typeLabel of the atom type.
[in]labelLabel of the radial function.
[in]rfArray with radial function values.
[in]num_pointsLength of radial function array.
[in]nOrbital quantum number.
[in]langular momentum.
[in]idxrf1First index of radial function (for Q-operator). Indices start from 1.
[in]idxrf2Second index of radial function (for Q-operator). Indices start form 1.
[in]occOccupancy of the wave-function.
[out]error_codeError code.

Definition at line 2221 of file sirius.f90.

◆ sirius_set_atom_type_hubbard()

subroutine sirius::sirius_set_atom_type_hubbard ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, intent(in), target  l,
integer, intent(in), target  n,
real(8), intent(in), target  occ,
real(8), intent(in), target  U,
real(8), intent(in), target  J,
real(8), intent(in), target  alpha,
real(8), intent(in), target  beta,
real(8), intent(in), target  J0,
integer, intent(out), optional, target  error_code 
)

Set the hubbard correction for the atomic type.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[in]lOrbital quantum number.
[in]nprincipal quantum number (s, p, d, f)
[in]occAtomic shell occupancy.
[in]UHubbard U parameter.
[in]JExchange J parameter for the full interaction treatment.
[in]alphaJ_alpha for the simple interaction treatment.
[in]betaJ_beta for the simple interaction treatment.
[in]J0J0 for the simple interaction treatment.
[out]error_codeError code.

Definition at line 2327 of file sirius.f90.

◆ sirius_set_atom_type_dion()

subroutine sirius::sirius_set_atom_type_dion ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, intent(in), target  num_beta,
real(8), dimension(num_beta, num_beta), intent(in), target  dion,
integer, intent(out), optional, target  error_code 
)

Set ionic part of D-operator matrix.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[in]num_betaNumber of beta-projectors.
[in]dionIonic part of D-operator matrix.
[out]error_codeError code.

Definition at line 2413 of file sirius.f90.

◆ sirius_set_atom_type_paw()

subroutine sirius::sirius_set_atom_type_paw ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
real(8), intent(in), target  core_energy,
real(8), dimension(num_occ), intent(in), target  occupations,
integer, intent(in), target  num_occ,
integer, intent(out), optional, target  error_code 
)

Set PAW related data.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[in]core_energyCore-electrons energy contribution.
[in]occupationsarray of orbital occupancies
[in]num_occsize of the occupations array
[out]error_codeError code.

Definition at line 2467 of file sirius.f90.

◆ sirius_add_atom()

subroutine sirius::sirius_add_atom ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
real(8), dimension(3), intent(in), target  position,
real(8), dimension(3), intent(in), optional, target  vector_field,
integer, intent(out), optional, target  error_code 
)

Add atom to the unit cell.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[in]positionAtom position in lattice coordinates.
[in]vector_fieldStarting magnetization.
[out]error_codeError code.

Definition at line 2528 of file sirius.f90.

◆ sirius_set_atom_position()

subroutine sirius::sirius_set_atom_position ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(in), target  ia,
real(8), dimension(3), intent(in), target  position,
integer, intent(out), optional, target  error_code 
)

Set new atomic position.

Parameters
[in]handlerSimulation context handler.
[in]iaIndex of atom; index starts form 1
[in]positionAtom position in lattice coordinates.
[out]error_codeError code.

Definition at line 2582 of file sirius.f90.

◆ sirius_set_pw_coeffs()

subroutine sirius::sirius_set_pw_coeffs ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  label,
complex(8), dimension(:), intent(in), target  pw_coeffs,
logical, intent(in), optional, target  transform_to_rg,
integer, intent(in), optional, target  ngv,
integer, dimension(:,:), intent(in), optional, target  gvl,
integer, intent(in), optional, target  comm,
integer, intent(out), optional, target  error_code 
)

Set plane-wave coefficients of a periodic function.

Parameters
[in]handlerGround state handler.
[in]labelLabel of the function.
[in]pw_coeffsLocal array of plane-wave coefficients.
[in]transform_to_rgTrue if function has to be transformed to real-space grid.
[in]ngvLocal number of G-vectors.
[in]gvlList of G-vectors in lattice coordinates (Miller indices).
[in]commMPI communicator used in distribution of G-vectors
[out]error_codeError code.

Definition at line 2629 of file sirius.f90.

◆ sirius_get_pw_coeffs()

subroutine sirius::sirius_get_pw_coeffs ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  label,
complex(8), dimension(:), intent(in), target  pw_coeffs,
integer, intent(in), optional, target  ngv,
integer, dimension(:,:), intent(in), optional, target  gvl,
integer, intent(in), optional, target  comm,
integer, intent(out), optional, target  error_code 
)

Get plane-wave coefficients of a periodic function.

Parameters
[in]handlerGround state handler.
[in]labelLabel of the function.
[in]pw_coeffsLocal array of plane-wave coefficients.
[in]ngvLocal number of G-vectors.
[in]gvlList of G-vectors in lattice coordinates (Miller indices).
[in]commMPI communicator used in distribution of G-vectors
[out]error_codeError code.

Definition at line 2714 of file sirius.f90.

◆ sirius_initialize_subspace()

subroutine sirius::sirius_initialize_subspace ( type(sirius_ground_state_handler), intent(in), target  gs_handler,
type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
integer, intent(out), optional, target  error_code 
)

Initialize the subspace of wave-functions.

Parameters
[in]gs_handlerGround state handler.
[in]ks_handlerK-point set handler.
[out]error_codeError code.

Definition at line 2782 of file sirius.f90.

◆ sirius_find_eigen_states()

subroutine sirius::sirius_find_eigen_states ( type(sirius_ground_state_handler), intent(in), target  gs_handler,
type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
logical, intent(in), optional, target  precompute_pw,
logical, intent(in), optional, target  precompute_rf,
logical, intent(in), optional, target  precompute_ri,
real(8), intent(in), optional, target  iter_solver_tol,
integer, intent(out), optional, target  error_code 
)

Find eigen-states of the Hamiltonian.

Parameters
[in]gs_handlerGround state handler.
[in]ks_handlerK-point set handler.
[in]precompute_pwGenerate plane-wave coefficients of the potential
[in]precompute_rfGenerate radial functions
[in]precompute_riGenerate radial integrals
[in]iter_solver_tolIterative solver tolerance.
[out]error_codeError code.

Definition at line 2823 of file sirius.f90.

◆ sirius_generate_initial_density()

subroutine sirius::sirius_generate_initial_density ( type(sirius_ground_state_handler), intent(in), target  handler,
integer, intent(out), optional, target  error_code 
)

Generate initial density.

Parameters
[in]handlerGround state handler.
[out]error_codeError code.

Definition at line 2902 of file sirius.f90.

◆ sirius_generate_effective_potential()

subroutine sirius::sirius_generate_effective_potential ( type(sirius_ground_state_handler), intent(in), target  handler,
integer, intent(out), optional, target  error_code 
)

Generate effective potential and magnetic field.

Parameters
[in]handlerGround state handler.
[out]error_codeError code.

Definition at line 2933 of file sirius.f90.

◆ sirius_generate_density()

subroutine sirius::sirius_generate_density ( type(sirius_ground_state_handler), intent(in), target  gs_handler,
logical, intent(in), optional, target  add_core,
logical, intent(in), optional, target  transform_to_rg,
logical, intent(in), optional, target  paw_only,
integer, intent(out), optional, target  error_code 
)

Generate charge density and magnetization.

Parameters
[in]gs_handlerGround state handler.
[in]add_coreAdd core charge density in the muffin-tins.
[in]transform_to_rgIf true, density and magnetization are transformed to real-space grid.
[in]paw_onlyit true, only local PAW density is generated
[out]error_codeError code.

Definition at line 2967 of file sirius.f90.

◆ sirius_set_band_occupancies()

subroutine sirius::sirius_set_band_occupancies ( type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
integer, intent(in), target  ik,
integer, intent(in), target  ispn,
real(8), dimension(:), intent(in), target  band_occupancies,
integer, intent(out), optional, target  error_code 
)

Set band occupancies.

Parameters
[in]ks_handlerK-point set handler.
[in]ikGlobal index of k-point.
[in]ispnSpin component index.
[in]band_occupanciesArray of band occupancies.
[out]error_codeError code.

Definition at line 3037 of file sirius.f90.

◆ sirius_get_band_occupancies()

subroutine sirius::sirius_get_band_occupancies ( type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
integer, intent(in), target  ik,
integer, intent(in), target  ispn,
real(8), dimension(:), intent(out), target  band_occupancies,
integer, intent(out), optional, target  error_code 
)

Set band occupancies.

Parameters
[in]ks_handlerK-point set handler.
[in]ikGlobal index of k-point.
[in]ispnSpin component.
[out]band_occupanciesArray of band occupancies.
[out]error_codeError code.

Definition at line 3087 of file sirius.f90.

◆ sirius_get_band_energies()

subroutine sirius::sirius_get_band_energies ( type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
integer, intent(in), target  ik,
integer, intent(in), target  ispn,
real(8), dimension(:), intent(out), target  band_energies,
integer, intent(out), optional, target  error_code 
)

Get band energies.

Parameters
[in]ks_handlerK-point set handler.
[in]ikGlobal index of k-point.
[in]ispnSpin component.
[out]band_energiesArray of band energies.
[out]error_codeError code.

Definition at line 3137 of file sirius.f90.

◆ sirius_get_energy()

subroutine sirius::sirius_get_energy ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  label,
real(8), intent(out), target  energy,
integer, intent(out), optional, target  error_code 
)

Get one of the total energy components.

Parameters
[in]handlerDFT ground state handler.
[in]labelLabel of the energy component to get.
[out]energyTotal energy component.
[out]error_codeError code.

Definition at line 3186 of file sirius.f90.

◆ sirius_get_forces()

subroutine sirius::sirius_get_forces ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  label,
real(8), dimension(:,:), intent(out), target  forces,
integer, intent(out), optional, target  error_code 
)

Get one of the total force components.

Parameters
[in]handlerDFT ground state handler.
[in]labelLabel of the force component to get.
[out]forcesTotal force component for each atom.
[out]error_codeError code.

Definition at line 3233 of file sirius.f90.

◆ sirius_get_stress_tensor()

subroutine sirius::sirius_get_stress_tensor ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  label,
real(8), dimension(3, 3), intent(out), target  stress_tensor,
integer, intent(out), optional, target  error_code 
)

Get one of the stress tensor components.

Parameters
[in]handlerDFT ground state handler.
[in]labelLabel of the stress tensor component to get.
[out]stress_tensorComponent of the total stress tensor.
[out]error_codeError code.

Definition at line 3280 of file sirius.f90.

◆ sirius_get_num_beta_projectors()

subroutine sirius::sirius_get_num_beta_projectors ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, intent(out), target  num_bp,
integer, intent(out), optional, target  error_code 
)

Get the number of beta-projectors for an atom type.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[out]num_bpNumber of beta projectors for each atom type.
[out]error_codeError code.

Definition at line 3327 of file sirius.f90.

◆ sirius_get_wave_functions()

subroutine sirius::sirius_get_wave_functions ( type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
real(8), dimension(3), intent(in), optional, target  vkl,
integer, intent(in), optional, target  spin,
integer, intent(in), optional, target  num_gvec_loc,
integer, dimension(:,:), intent(in), optional, target  gvec_loc,
complex(8), dimension(:,:), intent(out), optional, target  evec,
integer, intent(in), optional, target  ld,
integer, intent(in), optional, target  num_spin_comp,
integer, intent(out), optional, target  error_code 
)

Get wave-functions.

Parameters
[in]ks_handlerK-point set handler.
[in]vklLatttice coordinates of the k-point.
[in]spinSpin index in case of collinear magnetism.
[in]num_gvec_locLocal number of G-vectors for a k-point.
[in]gvec_locList of G-vectors.
[out]evecWave-functions.
[in]ldLeading dimension of evec array.
[in]num_spin_compNumber of spin components.
[out]error_codeError code

Definition at line 3379 of file sirius.f90.

◆ sirius_add_atom_type_aw_descriptor()

subroutine sirius::sirius_add_atom_type_aw_descriptor ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, intent(in), target  n,
integer, intent(in), target  l,
real(8), intent(in), target  enu,
integer, intent(in), target  dme,
logical, intent(in), target  auto_enu,
integer, intent(out), optional, target  error_code 
)

Add descriptor of the augmented wave radial function.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[in]nPrincipal quantum number.
[in]lOrbital quantum number.
[in]enuLinearization energy.
[in]dmeOrder of energy derivative.
[in]auto_enuTrue if automatic search of linearization energy is allowed for this radial solution.
[out]error_codeError code

Definition at line 3468 of file sirius.f90.

◆ sirius_add_atom_type_lo_descriptor()

subroutine sirius::sirius_add_atom_type_lo_descriptor ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, intent(in), target  ilo,
integer, intent(in), target  n,
integer, intent(in), target  l,
real(8), intent(in), target  enu,
integer, intent(in), target  dme,
logical, intent(in), target  auto_enu,
integer, intent(out), optional, target  error_code 
)

Add descriptor of the local orbital radial function.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[in]iloIndex of the local orbital to which the descriptor is added.
[in]nPrincipal quantum number.
[in]lOrbital quantum number.
[in]enuLinearization energy.
[in]dmeOrder of energy derivative.
[in]auto_enuTrue if automatic search of linearization energy is allowed for this radial solution.
[out]error_codeError code

Definition at line 3545 of file sirius.f90.

◆ sirius_set_atom_type_configuration()

subroutine sirius::sirius_set_atom_type_configuration ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, intent(in), target  n,
integer, intent(in), target  l,
integer, intent(in), target  k,
real(8), intent(in), target  occupancy,
logical, intent(in), target  core,
integer, intent(out), optional, target  error_code 
)

Set configuration of atomic levels.

Parameters
[in]handlerSimulation context handler.
[in]labelAtom type label.
[in]nPrincipal quantum number.
[in]lOrbital quantum number.
[in]kkappa (used in relativistic solver).
[in]occupancyLevel occupancy.
[in]coreTru if this is a core state.
[out]error_codeError code

Definition at line 3626 of file sirius.f90.

◆ sirius_generate_coulomb_potential()

subroutine sirius::sirius_generate_coulomb_potential ( type(sirius_ground_state_handler), intent(in), target  handler,
real(8), dimension(:), intent(out), optional, target  vh_el,
integer, intent(out), optional, target  error_code 
)

Generate Coulomb potential by solving Poisson equation.

Parameters
[in]handlerDFT ground state handler
[out]vh_elElectronic part of Hartree potential at each atom's origin.
[out]error_codeError code

Definition at line 3697 of file sirius.f90.

◆ sirius_generate_xc_potential()

subroutine sirius::sirius_generate_xc_potential ( type(sirius_ground_state_handler), intent(in), target  handler,
integer, intent(out), optional, target  error_code 
)

Generate XC potential using LibXC.

Parameters
[in]handlerGround state handler
[out]error_codeError code

Definition at line 3735 of file sirius.f90.

◆ sirius_get_kpoint_inter_comm()

subroutine sirius::sirius_get_kpoint_inter_comm ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(out), target  fcomm,
integer, intent(out), optional, target  error_code 
)

Get communicator which is used to split k-points.

Parameters
[in]handlerSimulation context handler
[out]fcommFortran communicator
[out]error_codeError code

Definition at line 3767 of file sirius.f90.

◆ sirius_get_kpoint_inner_comm()

subroutine sirius::sirius_get_kpoint_inner_comm ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(out), target  fcomm,
integer, intent(out), optional, target  error_code 
)

Get communicator which is used to parallise band problem.

Parameters
[in]handlerSimulation context handler
[out]fcommFortran communicator
[out]error_codeError code

Definition at line 3804 of file sirius.f90.

◆ sirius_get_fft_comm()

subroutine sirius::sirius_get_fft_comm ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(out), target  fcomm,
integer, intent(out), optional, target  error_code 
)

Get communicator which is used to parallise FFT.

Parameters
[in]handlerSimulation context handler
[out]fcommFortran communicator
[out]error_codeError code

Definition at line 3841 of file sirius.f90.

◆ sirius_get_num_gvec()

subroutine sirius::sirius_get_num_gvec ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(out), target  num_gvec,
integer, intent(out), optional, target  error_code 
)

Get total number of G-vectors on the fine grid.

Parameters
[in]handlerSimulation context handler
[out]num_gvecTotal number of G-vectors
[out]error_codeError code

Definition at line 3878 of file sirius.f90.

◆ sirius_get_gvec_arrays()

subroutine sirius::sirius_get_gvec_arrays ( type(sirius_context_handler), intent(in), target  handler,
integer, dimension(:,:), intent(in), optional, target  gvec,
real(8), dimension(:,:), intent(in), optional, target  gvec_cart,
real(8), dimension(:), intent(in), optional, target  gvec_len,
integer, dimension(:,:,:), intent(in), optional, target  index_by_gvec,
integer, intent(out), optional, target  error_code 
)

Get G-vector arrays.

Parameters
[in]handlerSimulation context handler
[in]gvecG-vectors in lattice coordinates.
[in]gvec_cartG-vectors in Cartesian coordinates.
[in]gvec_lenLength of G-vectors.
[in]index_by_gvecG-vector index by lattice coordinates.
[out]error_codeError code

Definition at line 3918 of file sirius.f90.

◆ sirius_get_num_fft_grid_points()

subroutine sirius::sirius_get_num_fft_grid_points ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(out), target  num_fft_grid_points,
integer, intent(out), optional, target  error_code 
)

Get local number of FFT grid points.

Parameters
[in]handlerSimulation context handler
[out]num_fft_grid_pointsLocal number of FFT grid points in the real-space mesh.
[out]error_codeError code.

Definition at line 3981 of file sirius.f90.

◆ sirius_get_fft_index()

subroutine sirius::sirius_get_fft_index ( type(sirius_context_handler), intent(in), target  handler,
integer, dimension(:), intent(out), target  fft_index,
integer, intent(out), optional, target  error_code 
)

Get mapping between G-vector index and FFT index.

Parameters
[in]handlerSimulation context handler
[out]fft_indexIndex inside FFT buffer
[out]error_codeError code.

Definition at line 4018 of file sirius.f90.

◆ sirius_get_max_num_gkvec()

subroutine sirius::sirius_get_max_num_gkvec ( type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
integer, intent(out), target  max_num_gkvec,
integer, intent(out), optional, target  error_code 
)

Get maximum number of G+k vectors across all k-points in the set.

Parameters
[in]ks_handlerK-point set handler.
[out]max_num_gkvecMaximum number of G+k vectors
[out]error_codeError code.

Definition at line 4055 of file sirius.f90.

◆ sirius_get_gkvec_arrays()

subroutine sirius::sirius_get_gkvec_arrays ( type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
integer, intent(in), target  ik,
integer, intent(out), target  num_gkvec,
integer, dimension(:), intent(out), target  gvec_index,
real(8), dimension(:,:), intent(out), target  gkvec,
real(8), dimension(:,:), intent(out), target  gkvec_cart,
real(8), dimension(:), intent(out), target  gkvec_len,
real(8), dimension(:,:), intent(out), target  gkvec_tp,
integer, intent(out), optional, target  error_code 
)

Get all G+k vector related arrays.

Parameters
[in]ks_handlerK-point set handler.
[in]ikGlobal index of k-point
[out]num_gkvecNumber of G+k vectors.
[out]gvec_indexIndex of the G-vector part of G+k vector.
[out]gkvecG+k vectors in fractional coordinates.
[out]gkvec_cartG+k vectors in Cartesian coordinates.
[out]gkvec_lenLength of G+k vectors.
[out]gkvec_tpTheta and Phi angles of G+k vectors.
[out]error_codeError code.

Definition at line 4098 of file sirius.f90.

◆ sirius_get_step_function()

subroutine sirius::sirius_get_step_function ( type(sirius_context_handler), intent(in), target  handler,
complex(8), dimension(:), intent(out), target  cfunig,
real(8), dimension(:), intent(out), target  cfunrg,
integer, intent(in), target  num_rg_points,
integer, intent(out), optional, target  error_code 
)

Get the unit-step function.

Parameters
[in]handlerSimulation context handler
[out]cfunigPlane-wave coefficients of step function.
[out]cfunrgValues of the step function on the regular grid.
[in]num_rg_pointsNumber of real-space points.
[out]error_codeError code.

Definition at line 4170 of file sirius.f90.

◆ sirius_set_h_radial_integrals()

subroutine sirius::sirius_set_h_radial_integrals ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(in), target  ia,
integer, intent(in), target  lmmax,
real(8), intent(in), target  val,
integer, intent(in), optional, target  l1,
integer, intent(in), optional, target  o1,
integer, intent(in), optional, target  ilo1,
integer, intent(in), optional, target  l2,
integer, intent(in), optional, target  o2,
integer, intent(in), optional, target  ilo2,
integer, intent(out), optional, target  error_code 
)

Set LAPW Hamiltonian radial integrals.

Parameters
[in]handlerSimulation context handler.
[in]iaIndex of atom.
[in]lmmaxNumber of lm-component of the potential.
[in]valValues of the radial integrals.
[in]l11st index of orbital quantum number.
[in]o11st index of radial function order for l1.
[in]ilo11st index or local orbital.
[in]l22nd index of orbital quantum number.
[in]o22nd index of radial function order for l2.
[in]ilo22nd index or local orbital.
[out]error_codeError code.

Definition at line 4226 of file sirius.f90.

◆ sirius_set_o_radial_integral()

subroutine sirius::sirius_set_o_radial_integral ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(in), target  ia,
real(8), intent(in), target  val,
integer, intent(in), target  l,
integer, intent(in), optional, target  o1,
integer, intent(in), optional, target  ilo1,
integer, intent(in), optional, target  o2,
integer, intent(in), optional, target  ilo2,
integer, intent(out), optional, target  error_code 
)

Set LAPW overlap radial integral.

Parameters
[in]handlerSimulation context handler.
[in]iaIndex of atom.
[in]valValue of the radial integral.
[in]lOrbital quantum number.
[in]o11st index of radial function order.
[in]ilo11st index or local orbital.
[in]o22nd index of radial function order.
[in]ilo22nd index or local orbital.
[out]error_codeError code.

Definition at line 4324 of file sirius.f90.

◆ sirius_set_o1_radial_integral()

subroutine sirius::sirius_set_o1_radial_integral ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(in), target  ia,
real(8), intent(in), target  val,
integer, intent(in), optional, target  l1,
integer, intent(in), optional, target  o1,
integer, intent(in), optional, target  ilo1,
integer, intent(in), optional, target  l2,
integer, intent(in), optional, target  o2,
integer, intent(in), optional, target  ilo2,
integer, intent(out), optional, target  error_code 
)

Set a correction to LAPW overlap radial integral.

Parameters
[in]handlerSimulation context handler.
[in]iaIndex of atom.
[in]valValue of the radial integral.
[in]l11st index of orbital quantum number.
[in]o11st index of radial function order for l1.
[in]ilo11st index or local orbital.
[in]l22nd index of orbital quantum number.
[in]o22nd index of radial function order for l2.
[in]ilo22nd index or local orbital.
[out]error_codeError code.

Definition at line 4407 of file sirius.f90.

◆ sirius_set_radial_function()

subroutine sirius::sirius_set_radial_function ( type(sirius_context_handler), intent(in), target  handler,
integer, intent(in), target  ia,
integer, intent(in), target  deriv_order,
real(8), dimension(:), intent(in), target  f,
integer, intent(in), optional, target  l,
integer, intent(in), optional, target  o,
integer, intent(in), optional, target  ilo,
integer, intent(out), optional, target  error_code 
)

Set LAPW radial functions.

Parameters
[in]handlerSimulation context handler.
[in]iaIndex of atom.
[in]deriv_orderRadial derivative order.
[in]fValues of the radial function.
[in]lOrbital quantum number.
[in]oOrder of radial function for l.
[in]iloLocal orbital index.
[out]error_codeError code.

Definition at line 4498 of file sirius.f90.

◆ sirius_set_equivalent_atoms()

subroutine sirius::sirius_set_equivalent_atoms ( type(sirius_context_handler), intent(in), target  handler,
integer, dimension(:), intent(in), target  equivalent_atoms,
integer, intent(out), optional, target  error_code 
)

Set equivalent atoms.

Parameters
[in]handlerSimulation context handler.
[in]equivalent_atomsArray with equivalent atom IDs.
[out]error_codeError code.

Definition at line 4567 of file sirius.f90.

◆ sirius_update_atomic_potential()

subroutine sirius::sirius_update_atomic_potential ( type(sirius_ground_state_handler), intent(in), target  handler,
integer, intent(out), optional, target  error_code 
)

Set the new spherical potential.

Parameters
[in]handlerGround state handler.
[out]error_codeError code.

Definition at line 4603 of file sirius.f90.

◆ sirius_option_get_number_of_sections()

subroutine sirius::sirius_option_get_number_of_sections ( integer, intent(out), target  length,
integer, intent(out), optional, target  error_code 
)

Return the total number of sections defined in the input JSON schema.

Parameters
[out]lengthNumber of sections.
[out]error_codeError code.

Definition at line 4634 of file sirius.f90.

◆ sirius_option_get_section_name()

subroutine sirius::sirius_option_get_section_name ( integer, intent(in), value  elem,
character(*), intent(out), target  section_name,
integer, intent(in), value  section_name_length,
integer, intent(out), optional, target  error_code 
)

Return the name of a given section.

Parameters
[in]elemIndex of the section (starting from 1).
[out]section_nameName of the section
[in]section_name_lengthMaximum length of the output string. Enough capacity should be provided.
[out]error_codeError code.

Definition at line 4667 of file sirius.f90.

◆ sirius_option_get_section_length()

subroutine sirius::sirius_option_get_section_length ( character(*), intent(in), target  section,
integer, intent(out), target  length,
integer, intent(out), optional, target  error_code 
)

Return the number of options in a given section.

Parameters
[in]sectionName of the seciton.
[out]lengthNumber of options contained in the section.
[out]error_codeError code.

Definition at line 4710 of file sirius.f90.

◆ sirius_option_get_info()

subroutine sirius::sirius_option_get_info ( character(*), intent(in), target  section,
integer, intent(in), value  elem,
character(*), intent(out), target  key_name,
integer, intent(in), value  key_name_len,
integer, intent(out), target  type,
integer, intent(out), target  length,
integer, intent(out), target  enum_size,
character(*), intent(out), target  title,
integer, intent(in), value  title_len,
character(*), intent(out), target  description,
integer, intent(in), value  description_len,
integer, intent(out), optional, target  error_code 
)

Return information about the option.

Parameters
[in]sectionName of the section.
[in]elemIndex of the option (starting from 1)
[out]key_nameName of the option.
[in]key_name_lenMaximum length for the string (on the caller side). No allocation is done.
[out]typeType of the option (real, integer, boolean, string, or array of the same types).
[out]lengthLength of the default value (1 for the scalar types, otherwise the lenght of the array).
[out]enum_sizeNumber of elements in the enum type, zero otherwise.
[out]titleShort description of the option (can be empty).
[in]title_lenMaximum length for the short description.
[out]descriptionDetailed description of the option (can be empty).
[in]description_lenMaximum length for the detailed description.
[out]error_codeError code.

Definition at line 4760 of file sirius.f90.

◆ sirius_option_get()

subroutine sirius::sirius_option_get ( character(*), intent(in), target  section,
character(*), intent(in), target  name,
integer, intent(in), target  type,
type(c_ptr), intent(in), value  data_ptr,
integer, intent(in), optional, target  max_length,
integer, intent(in), optional, target  enum_idx,
integer, intent(out), optional, target  error_code 
)

Return the default value of the option as defined in the JSON schema.

Parameters
[in]sectionName of the section of interest.
[in]nameName of the element
[in]typeType of the option (real, integer, boolean)
[in]data_ptrOutput buffer for the default value or list of values.
[in]max_lengthMaximum length of the buffer containing the default values.
[in]enum_idxIndex of the element in case of the enum type.
[out]error_codeError code.

Definition at line 4853 of file sirius.f90.

◆ sirius_option_set()

subroutine sirius::sirius_option_set ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  section,
character(*), intent(in), target  name,
integer, intent(in), target  type,
type(c_ptr), intent(in), value  data_ptr,
integer, intent(in), optional, target  max_length,
logical, intent(in), optional, target  append,
integer, intent(out), optional, target  error_code 
)

Set the value of the option name in a (internal) json dictionary.

Parameters
[in]handlerSimulation context handler.
[in]sectionstring containing the options in json format
[in]namename of the element to pick
[in]typeType of the option (real, integer, boolean)
[in]data_ptrBuffer for the value or list of values.
[in]max_lengthMaximum length of the buffer containing the default values.
[in]appendIf true then value is appended to the list of values.
[out]error_codeError code.

Definition at line 4926 of file sirius.f90.

◆ sirius_dump_runtime_setup()

subroutine sirius::sirius_dump_runtime_setup ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  filename,
integer, intent(out), optional, target  error_code 
)

Dump the runtime setup in a file.

Parameters
[in]handlerSimulation context handler.
[in]filenameString containing the name of the file.
[out]error_codeError code

Definition at line 5004 of file sirius.f90.

◆ sirius_get_fv_eigen_vectors()

subroutine sirius::sirius_get_fv_eigen_vectors ( type(sirius_kpoint_set_handler), intent(in), target  handler,
integer, intent(in), target  ik,
complex(8), dimension(:,:), intent(out), target  fv_evec,
integer, intent(in), target  ld,
integer, intent(in), target  num_fv_states,
integer, intent(out), optional, target  error_code 
)

Get the first-variational eigen vectors.

Parameters
[in]handlerK-point set handler
[in]ikGlobal index of the k-point
[out]fv_evecOutput first-variational eigenvector array
[in]ldLeading dimension of fv_evec
[in]num_fv_statesNumber of first-variational states
[out]error_codeError code

Definition at line 5048 of file sirius.f90.

◆ sirius_get_fv_eigen_values()

subroutine sirius::sirius_get_fv_eigen_values ( type(sirius_kpoint_set_handler), intent(in), target  handler,
integer, intent(in), target  ik,
real(8), dimension(:), intent(out), target  fv_eval,
integer, intent(in), target  num_fv_states,
integer, intent(out), optional, target  error_code 
)

Get the first-variational eigen values.

Parameters
[in]handlerK-point set handler
[in]ikGlobal index of the k-point
[out]fv_evalOutput first-variational eigenvector array
[in]num_fv_statesNumber of first-variational states
[out]error_codeError code

Definition at line 5103 of file sirius.f90.

◆ sirius_get_sv_eigen_vectors()

subroutine sirius::sirius_get_sv_eigen_vectors ( type(sirius_kpoint_set_handler), intent(in), target  handler,
integer, intent(in), target  ik,
complex(8), dimension(:,:), intent(out), target  sv_evec,
integer, intent(in), target  num_bands,
integer, intent(out), optional, target  error_code 
)

Get the second-variational eigen vectors.

Parameters
[in]handlerK-point set handler
[in]ikGlobal index of the k-point
[out]sv_evecOutput second-variational eigenvector array
[in]num_bandsNumber of second-variational bands.
[out]error_codeError code

Definition at line 5153 of file sirius.f90.

◆ sirius_set_rg_values()

subroutine sirius::sirius_set_rg_values ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, dimension(3), intent(in), target  grid_dims,
integer, dimension(:,:), intent(in), target  local_box_origin,
integer, dimension(:,:), intent(in), target  local_box_size,
integer, intent(in), target  fcomm,
real(8), intent(in), target  values,
logical, intent(in), optional, target  transform_to_pw,
integer, intent(out), optional, target  error_code 
)

Set the values of the function on the regular grid.

Parameters
[in]handlerDFT ground state handler.
[in]labelLabel of the function.
[in]grid_dimsDimensions of the FFT grid.
[in]local_box_originCoordinates of the local box origin for each MPI rank
[in]local_box_sizeDimensions of the local box for each MPI rank.
[in]fcommFortran communicator used to partition FFT grid into local boxes.
[in]valuesValues of the function (local buffer for each MPI rank).
[in]transform_to_pwIf true, transform function to PW domain.
[out]error_codeError code

Definition at line 5207 of file sirius.f90.

◆ sirius_get_rg_values()

subroutine sirius::sirius_get_rg_values ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  label,
integer, dimension(3), intent(in), target  grid_dims,
integer, dimension(:,:), intent(in), target  local_box_origin,
integer, dimension(:,:), intent(in), target  local_box_size,
integer, intent(in), target  fcomm,
real(8), intent(out), target  values,
logical, intent(in), optional, target  transform_to_rg,
integer, intent(out), optional, target  error_code 
)

Get the values of the function on the regular grid.

Parameters
[in]handlerDFT ground state handler.
[in]labelLabel of the function.
[in]grid_dimsDimensions of the FFT grid.
[in]local_box_originCoordinates of the local box origin for each MPI rank
[in]local_box_sizeDimensions of the local box for each MPI rank.
[in]fcommFortran communicator used to partition FFT grid into local boxes.
[out]valuesValues of the function (local buffer for each MPI rank).
[in]transform_to_rgIf true, transform function to regular grid before fetching the values.
[out]error_codeError code

Definition at line 5293 of file sirius.f90.

◆ sirius_get_total_magnetization()

subroutine sirius::sirius_get_total_magnetization ( type(sirius_ground_state_handler), intent(in), target  handler,
real(8), intent(out), target  mag,
integer, intent(out), optional, target  error_code 
)

Get the total magnetization of the system.

Parameters
[in]handlerDFT ground state handler.
[out]mag3D magnetization vector (x,y,z components).
[out]error_codeError code

Definition at line 5373 of file sirius.f90.

◆ sirius_get_num_kpoints()

subroutine sirius::sirius_get_num_kpoints ( type(sirius_kpoint_set_handler), intent(in), target  handler,
integer, intent(out), target  num_kpoints,
integer, intent(out), optional, target  error_code 
)

Get the total number of kpoints.

Parameters
[in]handlerKpoint set handler
[out]num_kpointsnumber of kpoints in the set
[out]error_codeError code.

Definition at line 5410 of file sirius.f90.

◆ sirius_get_kpoint_properties()

subroutine sirius::sirius_get_kpoint_properties ( type(sirius_kpoint_set_handler), intent(in), target  handler,
integer, intent(in), target  ik,
real(8), intent(out), target  weight,
real(8), intent(out), optional, target  coordinates,
integer, intent(out), optional, target  error_code 
)

Get the kpoint properties.

Parameters
[in]handlerKpoint set handler
[in]ikIndex of the kpoint
[out]weightWeight of the kpoint
[out]coordinatesCoordinates of the kpoint
[out]error_codeError code.

Definition at line 5449 of file sirius.f90.

◆ sirius_set_callback_function()

subroutine sirius::sirius_set_callback_function ( type(sirius_context_handler), intent(in), target  handler,
character(*), intent(in), target  label,
type(c_funptr), intent(in), value  fptr,
integer, intent(out), optional, target  error_code 
)

Set callback function to compute various radial integrals.

Parameters
[in]handlerSimulation context handler.
[in]labelLable of the callback function.
[in]fptrPointer to callback function.
[out]error_codeError code.

Definition at line 5500 of file sirius.f90.

◆ sirius_nlcg()

subroutine sirius::sirius_nlcg ( type(sirius_ground_state_handler), intent(in), target  handler,
type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
integer, intent(out), optional, target  error_code 
)

Robust wave function optimizer.

Parameters
[in]handlerGround state handler.
[in]ks_handlerK-point set handler.
[out]error_codeError code.

Definition at line 5543 of file sirius.f90.

◆ sirius_nlcg_params()

subroutine sirius::sirius_nlcg_params ( type(sirius_ground_state_handler), intent(in), target  handler,
type(sirius_kpoint_set_handler), intent(in), target  ks_handler,
real(8), intent(in), target  temp,
character(*), intent(in), target  smearing,
real(8), intent(in), target  kappa,
real(8), intent(in), target  tau,
real(8), intent(in), target  tol,
integer, intent(in), target  maxiter,
integer, intent(in), target  restart,
character(*), intent(in), target  processing_unit,
logical, intent(out), target  converged,
integer, intent(out), optional, target  error_code 
)

Robust wave function optimizer.

Parameters
[in]handlerGround state handler.
[in]ks_handlerK-point set handler.
[in]tempTemperature in Kelvin
[in]smearingsmearing label
[in]kappapseudo-Hamiltonian scalar preconditioner
[in]taubacktracking search reduction parameter
[in]tolCG tolerance
[in]maxiterCG maxiter
[in]restartCG restart
[in]processing_unitprocessing_unit = ["cpu"|"gpu"|"none"]
[out]convergedNone
[out]error_codeError code.

Definition at line 5589 of file sirius.f90.

◆ sirius_add_hubbard_atom_pair()

subroutine sirius::sirius_add_hubbard_atom_pair ( type(sirius_context_handler), intent(in), target  handler,
integer, dimension(2), intent(in), target  atom_pair,
integer, dimension(3), intent(in), target  translation,
integer, dimension(2), intent(in), target  n,
integer, dimension(2), intent(in), target  l,
real(8), intent(in), target  coupling,
integer, intent(out), optional, target  error_code 
)

Add a non-local Hubbard interaction V for a pair of atoms.

Parameters
[in]handlerSimulation context handler.
[in]atom_pairatom pair for the V term
[in]translationtranslation vector between the two unit cells containing the atoms
[in]nprincipal quantum number of the atomic levels involved in the V correction
[in]langular momentum of the atomic levels
[in]couplingvalue of the V constant
[out]error_codeError code.

Definition at line 5688 of file sirius.f90.

◆ sirius_create_h0()

subroutine sirius::sirius_create_h0 ( type(sirius_ground_state_handler), intent(in), target  handler,
integer, intent(out), optional, target  error_code 
)

Generate H0.

Parameters
[in]handlerGround state handler.
[out]error_codeError code

Definition at line 5747 of file sirius.f90.

◆ sirius_linear_solver()

subroutine sirius::sirius_linear_solver ( type(sirius_ground_state_handler), intent(in), target  handler,
real(8), dimension(3), intent(in), target  vkq,
integer, intent(in), target  num_gvec_kq_loc,
integer, dimension(3, num_gvec_kq_loc), intent(in), target  gvec_kq_loc,
complex(8), dimension(ld, num_spin_comp), intent(inout), target  dpsi,
complex(8), dimension(ld, num_spin_comp), intent(in), target  psi,
real(8), dimension(*), intent(in), target  eigvals,
complex(8), dimension(ld, num_spin_comp), intent(inout), target  dvpsi,
integer, intent(in), target  ld,
integer, intent(in), target  num_spin_comp,
real(8), intent(in), target  alpha_pv,
integer, intent(in), target  spin,
integer, intent(in), target  nbnd_occ,
real(8), intent(in), target  tol,
integer, intent(out), target  niter,
integer, intent(out), optional, target  error_code 
)

Interface to linear solver.

Parameters
[in]handlerDFT ground state handler.
[in]vkqK+q-point in lattice coordinates
[in]num_gvec_kq_locLocal number of G-vectors for k+q-point
[in]gvec_kq_locLocal list of G-vectors for k+q-point.
[in,out]dpsiLeft-hand side of the linear equation.
[in]psiUnperturbed eigenvectors.
[in]eigvalsUnperturbed eigenvalues.
[in,out]dvpsiRight-hand side of the linear equation (dV * psi)
[in]ldLeading dimension of dpsi, psi, dvpsi.
[in]num_spin_compNumber of spin components.
[in]alpha_pvConstant for the projector.
[in]spinCurrent spin channel.
[in]nbnd_occNumber of occupied bands.
[in]tolTolerance for the unconverged residuals (residual L2-norm should be below this value).
[out]niterAverage number of iterations.
[out]error_codeError code

Definition at line 5792 of file sirius.f90.

◆ sirius_generate_d_operator_matrix()

subroutine sirius::sirius_generate_d_operator_matrix ( type(sirius_ground_state_handler), intent(in), target  handler,
integer, intent(out), optional, target  error_code 
)

Generate D-operator matrix.

Parameters
[in]handlerGround state handler.
[out]error_codeError code

Definition at line 5897 of file sirius.f90.

◆ sirius_save_state()

subroutine sirius::sirius_save_state ( type(sirius_ground_state_handler), intent(in), target  gs_handler,
character(*), intent(in), target  file_name,
integer, intent(out), optional, target  error_code 
)

Save DFT ground state (density and potential)

Parameters
[in]gs_handlerGround-state handler.
[in]file_nameName of the file that stores the saved data.
[out]error_codeError code

Definition at line 5929 of file sirius.f90.

◆ sirius_load_state()

subroutine sirius::sirius_load_state ( type(sirius_ground_state_handler), intent(in), target  handler,
character(*), intent(in), target  file_name,
integer, intent(out), optional, target  error_code 
)

Save DFT ground state (density and potential)

Parameters
[in]handlerGround-state handler.
[in]file_nameName of the file that stores the saved data.
[out]error_codeError code

Definition at line 5970 of file sirius.f90.

◆ sirius_set_density_matrix()

subroutine sirius::sirius_set_density_matrix ( type(sirius_ground_state_handler), intent(in), target  handler,
integer, intent(in), target  ia,
complex(8), dimension(ld, ld, 3), intent(in), target  dm,
integer, intent(in), target  ld,
integer, intent(out), optional, target  error_code 
)

Set density matrix.

Parameters
[in]handlerGround-state handler.
[in]iaIndex of atom.
[in]dmInput density matrix.
[in]ldLeading dimension of the density matrix.
[out]error_codeError code.

Definition at line 6013 of file sirius.f90.

◆ sirius_free_handler_ctx()

subroutine sirius::sirius_free_handler_ctx ( type(sirius_context_handler), intent(inout)  handler,
integer, intent(out), optional, target  error_code 
)

Definition at line 6056 of file sirius.f90.

◆ sirius_free_handler_ks()

subroutine sirius::sirius_free_handler_ks ( type(sirius_kpoint_set_handler), intent(inout)  handler,
integer, intent(out), optional, target  error_code 
)

Definition at line 6063 of file sirius.f90.

◆ sirius_free_handler_dft()

subroutine sirius::sirius_free_handler_dft ( type(sirius_ground_state_handler), intent(inout)  handler,
integer, intent(out), optional, target  error_code 
)

Definition at line 6070 of file sirius.f90.

◆ create_beta_gk_gpu() [1/2]

void sirius::create_beta_gk_gpu ( int  num_atoms,
int  num_gkvec,
int const *  beta_desc,
std::complex< float > const *  beta_gk_t,
double const *  gkvec,
double const *  atom_pos,
std::complex< float > *  beta_gk 
)

Definition at line 36 of file beta_projectors_base.cpp.

◆ create_beta_gk_gpu() [2/2]

void sirius::create_beta_gk_gpu ( int  num_atoms,
int  num_gkvec,
int const *  beta_desc,
std::complex< double > const *  beta_gk_t,
double const *  gkvec,
double const *  atom_pos,
std::complex< double > *  beta_gk 
)

Definition at line 43 of file beta_projectors_base.cpp.

◆ inner_prod_beta()

template<typename F , typename T >
std::enable_if_t< std::is_same< T, real_type< F > >::value, la::dmatrix< F > > sirius::inner_prod_beta ( spla::Context &  spla_ctx,
sddk::memory_t  mem__,
sddk::memory_t  host_mem__,
bool  result_on_device,
beta_projectors_coeffs_t< T > &  beta_coeffs__,
wf::Wave_functions< T > const &  phi__,
wf::spin_index  ispn__,
wf::band_range  br__ 
)

The following is matrix computed: <beta|phi>

Template Parameters
FType of the resulting inner product matrix (float, double, complex<float> or complex<double>).
Tprecision type
Parameters
[in]spla_ctxContext of the SPLA library
[in]memLocation of the input arrays (wfc and beta-projectors)
[in]host_memHost memory type for result allocation (pinned, non-pinned memory)
[in]result_on_deviceCopy result to device if true
[in]beta_coeffsBeta-projector coefficient array
[in]phiWave-function
[in]ispnSpin index (wfc)
[in]brBand range
Returns
inner product

Definition at line 426 of file beta_projectors_base.hpp.

◆ inner_beta() [1/2]

template<class T >
sddk::matrix< std::complex< T > > sirius::inner_beta ( const Beta_projectors_base< T > &  beta,
const Simulation_context ctx 
)

computes <beta|beta> and returns result on ctx.processing_unit_memory_t

Definition at line 446 of file beta_projectors_base.hpp.

◆ inner_beta() [2/2]

template<class T , class Op >
sddk::matrix< std::complex< T > > sirius::inner_beta ( const Beta_projectors_base< T > &  beta,
const Simulation_context ctx,
Op &&  op 
)

inner product <beta|Op|beta>, return resulting dmatrix<complex> in ctx.processing_unit_memory_t

Definition at line 496 of file beta_projectors_base.hpp.

◆ print_memory_usage()

template<typename OUT >
void sirius::print_memory_usage ( OUT &&  out__,
std::string  file_and_line__ = "" 
)

Definition at line 53 of file simulation_context.hpp.

◆ option_print_vector__()

template<typename T >
static std::ostringstream sirius::option_print_vector__ ( const std::vector< T > &  vec)
static

Definition at line 36 of file simulation_parameters.cpp.

◆ compose_default_json()

void sirius::compose_default_json ( nlohmann::json const &  schema__,
nlohmann::json &  output__ 
)

Compose JSON dictionary with default parameters based on input schema.

Traverse the JSON schema and add nodes with default parameters to the output dictionary. The nodes without default parameters are ignored. Still, user has a possibility to add the missing nodes later by providing a corresponding input JSON dictionary. See compose_json() function.

Definition at line 53 of file simulation_parameters.cpp.

◆ compose_json()

void sirius::compose_json ( nlohmann::json const &  schema__,
nlohmann::json const &  in__,
nlohmann::json &  inout__ 
)

Append the input dictionary to the existing dictionary.

Use JSON schema to traverse the existing dictionary and add on top the values from the input dictionary. In this way we can add missing nodes which were not defined in the existing dictionary.

Definition at line 78 of file simulation_parameters.cpp.

◆ get_options_dictionary()

nlohmann::json const & sirius::get_options_dictionary ( )

Get all possible options for initializing sirius. It is a json dictionary.

Definition at line 136 of file simulation_parameters.cpp.

◆ get_section_options()

nlohmann::json const & sirius::get_section_options ( std::string const &  section__)

Get all possible options of a given input section. It is a json dictionary.

Definition at line 146 of file simulation_parameters.cpp.

◆ cmd_args::value< std::string >() [1/2]

template<>
std::string sirius::cmd_args::value< std::string > ( const std::string  key__) const
inline

Definition at line 179 of file cmd_args.hpp.

◆ cmd_args::value< std::string >() [2/2]

template<>
std::string sirius::cmd_args::value< std::string > ( const std::string  key__,
const std::string  default_val__ 
) const
inline

Definition at line 185 of file cmd_args.hpp.

◆ cmd_args::value< std::vector< double > >()

template<>
std::vector< double > sirius::cmd_args::value< std::vector< double > > ( const std::string  key__) const
inline

Definition at line 185 of file cmd_args.hpp.

◆ cmd_args::value< std::vector< int > >()

template<>
std::vector< int > sirius::cmd_args::value< std::vector< int > > ( const std::string  key__) const
inline

Definition at line 185 of file cmd_args.hpp.

◆ confined_polynomial()

auto sirius::confined_polynomial ( double  r,
double  R,
int  p1,
int  p2,
int  dm 
)
inline

Definition at line 30 of file math_tools.hpp.

◆ sign()

template<typename T >
int sirius::sign ( val)
inline

Sign of the variable.

Definition at line 52 of file math_tools.hpp.

◆ is_int()

template<typename T >
bool sirius::is_int ( val__,
eps__ 
)
inline

Checks if number is integer with a given tolerance.

Definition at line 59 of file math_tools.hpp.

◆ factorial()

template<typename T >
T sirius::factorial ( int  n)
inline

Compute a factorial.

Definition at line 70 of file math_tools.hpp.

◆ round() [1/2]

auto sirius::round ( double  a__,
int  n__ 
)
inline

Definition at line 81 of file math_tools.hpp.

◆ round() [2/2]

auto sirius::round ( std::complex< double >  a__,
int  n__ 
)
inline

Definition at line 88 of file math_tools.hpp.

◆ hash()

auto sirius::hash ( void const *  buff,
size_t  size,
uint64_t  h = 5381 
)
inline

Simple hash function.

Example: std::printf("hash: %16llX\n", hash());

Definition at line 95 of file math_tools.hpp.

◆ random_uint32()

uint32_t sirius::random_uint32 ( bool  reset = false)
inline

Simple random number generator.

Definition at line 105 of file math_tools.hpp.

◆ random< int >()

template<>
int sirius::random< int > ( )
inline

Definition at line 123 of file math_tools.hpp.

◆ random< double >()

template<>
double sirius::random< double > ( )
inline

Definition at line 129 of file math_tools.hpp.

◆ random< std::complex< double > >()

template<>
std::complex< double > sirius::random< std::complex< double > > ( )
inline

Definition at line 129 of file math_tools.hpp.

◆ random< float >()

template<>
float sirius::random< float > ( )
inline

Definition at line 141 of file math_tools.hpp.

◆ random< std::complex< float > >()

template<>
std::complex< float > sirius::random< std::complex< float > > ( )
inline

Definition at line 141 of file math_tools.hpp.

◆ abs_diff()

template<typename T >
auto sirius::abs_diff ( a,
b 
)

Definition at line 153 of file math_tools.hpp.

◆ rel_diff()

template<typename T >
auto sirius::rel_diff ( a,
b 
)

Definition at line 159 of file math_tools.hpp.

◆ conj() [1/2]

auto sirius::conj ( double  x__)
inline

Return complex conjugate of a number. For a real value this is the number itself.

Definition at line 165 of file math_tools.hpp.

◆ conj() [2/2]

auto sirius::conj ( std::complex< double >  x__)
inline

Return complex conjugate of a number.

Definition at line 172 of file math_tools.hpp.

◆ zero_if_not_complex() [1/2]

template<typename T >
T sirius::zero_if_not_complex ( x__)
inline

Definition at line 178 of file math_tools.hpp.

◆ zero_if_not_complex() [2/2]

template<typename T >
T sirius::zero_if_not_complex ( std::complex< T >  x__)
inline

Definition at line 184 of file math_tools.hpp.

◆ null_stream()

null_stream_t & sirius::null_stream ( )

Definition at line 29 of file ostream_tools.cpp.

◆ boolstr()

std::string sirius::boolstr ( bool  b__)
inline

Definition at line 48 of file ostream_tools.hpp.

◆ operator<<() [1/7]

std::ostream & sirius::operator<< ( std::ostream &  out,
hbar &&  b 
)
inline

Inject horisontal bar to ostream.

Definition at line 79 of file ostream_tools.hpp.

◆ operator<<() [2/7]

std::ostream & sirius::operator<< ( std::ostream &  out,
ffmt &&  f 
)
inline

Inject floating point format to ostream.

Definition at line 109 of file ostream_tools.hpp.

◆ operator<<() [3/7]

template<typename T >
std::ostream & sirius::operator<< ( std::ostream &  out,
std::vector< T > &  v 
)
inline

Print std::vector to ostream.

Definition at line 120 of file ostream_tools.hpp.

◆ double_to_string()

std::string sirius::double_to_string ( double  val,
int  precision = -1 
)
inline

Convert double to a string with a given precision.

Definition at line 136 of file ostream_tools.hpp.

◆ print_checksum()

template<typename T , typename OUT >
void sirius::print_checksum ( std::string  label__,
value__,
OUT &&  out__ 
)
inline

Definition at line 167 of file ostream_tools.hpp.

◆ print_hash()

template<typename OUT >
void sirius::print_hash ( std::string  label__,
unsigned long long int  hash__,
OUT &&  out__ 
)
inline

Definition at line 173 of file ostream_tools.hpp.

◆ packed_index()

int sirius::packed_index ( int  i__,
int  j__ 
)
inline

Pack two indices into one for symmetric matrices.

Definition at line 31 of file packed_index.hpp.

◆ serialize() [1/6]

template<typename T , int N>
nlohmann::json sirius::serialize ( sddk::mdarray< T, N > const &  a__)
inline

Definition at line 35 of file serialize_mdarray.hpp.

◆ serialize() [2/6]

template<typename T , int N>
nlohmann::json sirius::serialize ( sddk::mdarray< std::complex< T >, N > const &  a__)
inline

Definition at line 55 of file serialize_mdarray.hpp.

◆ write_to_json_file()

template<typename T , int N>
void sirius::write_to_json_file ( sddk::mdarray< T, N > const &  a__,
std::string const &  fname__ 
)

Definition at line 76 of file serialize_mdarray.hpp.

◆ serialize() [3/6]

template<typename T >
void sirius::serialize ( serializer s__,
var__ 
)
inline

Serialize a single element.

Definition at line 100 of file serializer.hpp.

◆ deserialize() [1/4]

template<typename T >
void sirius::deserialize ( serializer s__,
T &  var__ 
)
inline

Deserialize a single element.

Definition at line 107 of file serializer.hpp.

◆ serialize() [4/6]

template<typename T >
void sirius::serialize ( serializer s__,
std::vector< T > const &  vec__ 
)
inline

Serialize a vector.

Definition at line 114 of file serializer.hpp.

◆ deserialize() [2/4]

template<typename T >
void sirius::deserialize ( serializer s__,
std::vector< T > &  vec__ 
)
inline

Deserialize a vector.

Definition at line 122 of file serializer.hpp.

◆ serialize() [5/6]

template<typename T , int N>
void sirius::serialize ( serializer s__,
sddk::mdarray< T, N > const &  array__ 
)

Serialize multidimentional array.

Definition at line 132 of file serializer.hpp.

◆ deserialize() [3/4]

template<typename T , int N>
void sirius::deserialize ( serializer s__,
sddk::mdarray< T, N > &  array__ 
)

Deserialize multidimentional array.

Definition at line 147 of file serializer.hpp.

◆ serialize() [6/6]

void sirius::serialize ( serializer s__,
mpi::block_data_descriptor const &  dd__ 
)
inline

Serialize block data descriptor.

Definition at line 167 of file serializer.hpp.

◆ deserialize() [4/4]

void sirius::deserialize ( serializer s__,
mpi::block_data_descriptor dd__ 
)
inline

Deserialize block data descriptor.

Definition at line 175 of file serializer.hpp.

◆ SHT::backward_transform< std::complex< double > >()

template<>
void sirius::SHT::backward_transform< std::complex< double > > ( int  ld,
std::complex< double > const *  flm,
int  nr,
int  lmmax,
std::complex< double > *  ftp 
) const

Definition at line 254 of file sht.cpp.

◆ SHT::forward_transform< std::complex< double > >()

template<>
void sirius::SHT::forward_transform< std::complex< double > > ( std::complex< double > const *  ftp,
int  nr,
int  lmmax,
int  ld,
std::complex< double > *  flm 
) const

Definition at line 274 of file sht.cpp.

◆ major_version()

int sirius::major_version ( )

Definition at line 30 of file sirius_version.cpp.

◆ minor_version()

int sirius::minor_version ( )

Definition at line 35 of file sirius_version.cpp.

◆ revision()

int sirius::revision ( )

Definition at line 40 of file sirius_version.cpp.

◆ git_hash()

std::string sirius::git_hash ( )

Definition at line 45 of file sirius_version.cpp.

◆ git_branchname()

std::string sirius::git_branchname ( )

Definition at line 50 of file sirius_version.cpp.

◆ build_date()

std::string sirius::build_date ( )

Definition at line 55 of file sirius_version.cpp.

◆ num_blocks()

int sirius::num_blocks ( int  length__,
int  block_size__ 
)
inline

Return the maximum number of blocks (with size 'block_size') needed to split the 'length' elements.

Definition at line 36 of file splindex.hpp.

◆ split_in_blocks()

auto sirius::split_in_blocks ( int  length__,
int  block_size__ 
)
inline

Split the 'length' elements into blocks with the initial block size.

Return vector of block sizes that sum up to the initial 'length'.

Definition at line 43 of file splindex.hpp.

◆ begin_global()

template<typename Index_t >
auto sirius::begin_global ( splindex< Index_t > const &  a__)

Definition at line 506 of file splindex.hpp.

◆ end_global()

template<typename Index_t >
auto sirius::end_global ( splindex< Index_t > const &  a__)

Definition at line 512 of file splindex.hpp.

◆ begin() [1/3]

template<typename Index_t >
auto sirius::begin ( splindex< Index_t > const &  a__)

Definition at line 518 of file splindex.hpp.

◆ end() [1/3]

template<typename Index_t >
auto sirius::end ( splindex< Index_t > const &  a__)

Definition at line 526 of file splindex.hpp.

◆ split()

auto sirius::split ( std::string const  str__,
char  delim__ 
)
inline

Split multi-line string into a list of strings.

Definition at line 31 of file string_tools.hpp.

◆ ltrim()

std::string & sirius::ltrim ( std::string &  str,
const std::string &  chars = "\t\n\v\f\r " 
)
inline

Definition at line 44 of file string_tools.hpp.

◆ rtrim()

std::string & sirius::rtrim ( std::string &  str,
const std::string &  chars = "\t\n\v\f\r " 
)
inline

Definition at line 50 of file string_tools.hpp.

◆ trim()

std::string & sirius::trim ( std::string &  str,
const std::string &  chars = "\t\n\v\f\r " 
)
inline

Definition at line 56 of file string_tools.hpp.

◆ file_exists()

bool sirius::file_exists ( std::string  file_name)
inline

Check if file exists.

Parameters
[in]file_nameFull path to the file being checked.
Returns
True if file exists, false otherwise.

Definition at line 34 of file system_tools.hpp.

◆ hostname()

auto sirius::hostname ( )
inline

Get host name.

Definition at line 41 of file system_tools.hpp.

◆ get_page_size()

long sirius::get_page_size ( )
inline

Definition at line 50 of file system_tools.hpp.

◆ get_num_pages()

long sirius::get_num_pages ( )
inline

Definition at line 55 of file system_tools.hpp.

◆ get_total_memory()

long sirius::get_total_memory ( )
inline

Definition at line 60 of file system_tools.hpp.

◆ get_proc_status()

auto sirius::get_proc_status ( )
inline

Definition at line 65 of file system_tools.hpp.

◆ get_proc_threads()

int sirius::get_proc_threads ( )
inline

Definition at line 113 of file system_tools.hpp.

◆ timestamp()

auto sirius::timestamp ( std::string  fmt)
inline

Return the timestamp string in a specified format.

Typical format strings: "%Y%m%d_%H%M%S", "%Y-%m-%d %H:%M:%S", "%H:%M:%S"

Definition at line 34 of file time_tools.hpp.

◆ wtime()

double sirius::wtime ( )
inline

Wall-clock time in seconds.

Definition at line 47 of file time_tools.hpp.

◆ time_now()

auto sirius::time_now ( )
inline

Definition at line 56 of file time_tools.hpp.

◆ time_interval()

double sirius::time_interval ( std::chrono::high_resolution_clock::time_point  t0)
inline

Definition at line 61 of file time_tools.hpp.

◆ get_relativity_t()

relativity_t sirius::get_relativity_t ( std::string  name__)
inline

Definition at line 107 of file typedefs.hpp.

◆ operator<<() [4/7]

std::ostream & sirius::operator<< ( std::ostream &  out,
radial_solution_descriptor const &  rsd 
)
inline

Definition at line 147 of file typedefs.hpp.

◆ checksum_gpu()

template<typename T >
auto sirius::checksum_gpu ( std::complex< T > const *  wf__,
int  ld__,
int  num_rows_loc__,
int  nwf__ 
)

Add checksum for the arrays on GPUs.

Definition at line 95 of file wave_functions.hpp.

◆ iterate_aug_atom_types()

template<typename F >
void sirius::iterate_aug_atom_types ( Unit_cell const &  uc__,
F &&  f__ 
)
inline

Definition at line 55 of file augmentation_operator.hpp.

◆ max_l_aug()

auto sirius::max_l_aug ( Unit_cell const &  uc__)
inline

Definition at line 67 of file augmentation_operator.hpp.

◆ max_na_aug()

auto sirius::max_na_aug ( Unit_cell const &  uc__)
inline

Definition at line 80 of file augmentation_operator.hpp.

◆ max_nb_aug()

auto sirius::max_nb_aug ( Unit_cell const &  uc__)
inline

Definition at line 94 of file augmentation_operator.hpp.

◆ update_density_rg_1_real_gpu() [1/2]

void sirius::update_density_rg_1_real_gpu ( int  size__,
float const *  psi_rg__,
float  wt__,
float *  density_rg__ 
)

Definition at line 43 of file density.cpp.

◆ update_density_rg_1_real_gpu() [2/2]

void sirius::update_density_rg_1_real_gpu ( int  size__,
double const *  psi_rg__,
double  wt__,
double *  density_rg__ 
)

Definition at line 49 of file density.cpp.

◆ update_density_rg_1_complex_gpu() [1/2]

void sirius::update_density_rg_1_complex_gpu ( int  size__,
std::complex< float > const *  psi_rg__,
float  wt__,
float *  density_rg__ 
)

Definition at line 55 of file density.cpp.

◆ update_density_rg_1_complex_gpu() [2/2]

void sirius::update_density_rg_1_complex_gpu ( int  size__,
std::complex< double > const *  psi_rg__,
double  wt__,
double *  density_rg__ 
)

Definition at line 61 of file density.cpp.

◆ update_density_rg_2_gpu() [1/2]

void sirius::update_density_rg_2_gpu ( int  size__,
std::complex< float > const *  psi_rg_up__,
std::complex< float > const *  psi_rg_dn__,
float  wt__,
float *  density_x_rg__,
float *  density_y_rg__ 
)

Definition at line 67 of file density.cpp.

◆ update_density_rg_2_gpu() [2/2]

void sirius::update_density_rg_2_gpu ( int  size__,
std::complex< double > const *  psi_rg_up__,
std::complex< double > const *  psi_rg_dn__,
double  wt__,
double *  density_x_rg__,
double *  density_y_rg__ 
)

Definition at line 74 of file density.cpp.

◆ add_k_point_contribution_rg_collinear()

template<typename T >
static void sirius::add_k_point_contribution_rg_collinear ( fft::spfft_transform_type< T > &  fft__,
int  ispn__,
w__,
T const *  inp_wf__,
int  nr__,
bool  gamma__,
sddk::mdarray< T, 2 > &  density_rg__ 
)
static

Compute non-magnetic or up- or dn- contribution of the wave-functions to the charge density.

Definition at line 569 of file density.cpp.

◆ add_k_point_contribution_rg_noncollinear()

template<typename T >
static void sirius::add_k_point_contribution_rg_noncollinear ( fft::spfft_transform_type< T > &  fft__,
w__,
T const *  inp_wf_up__,
T const *  inp_wf_dn__,
int  nr__,
sddk::mdarray< std::complex< T >, 1 > &  psi_r_up__,
sddk::mdarray< T, 2 > &  density_rg__ 
)
static

Compute contribution to density and megnetisation from the 2-component spinor wave-functions.

Definition at line 612 of file density.cpp.

◆ add_k_point_contribution_dm_fplapw()

template<typename T >
static void sirius::add_k_point_contribution_dm_fplapw ( Simulation_context const &  ctx__,
K_point< T > const &  kp__,
density_matrix_t density_matrix__ 
)
static

Definition at line 770 of file density.cpp.

◆ add_k_point_contribution_dm_pwpp_collinear()

template<typename T , typename F >
static void sirius::add_k_point_contribution_dm_pwpp_collinear ( Simulation_context ctx__,
K_point< T > &  kp__,
beta_projectors_coeffs_t< T > &  bp_coeffs__,
density_matrix_t density_matrix__ 
)
static

Definition at line 819 of file density.cpp.

◆ add_k_point_contribution_dm_pwpp_noncollinear()

template<typename T , typename F >
static void sirius::add_k_point_contribution_dm_pwpp_noncollinear ( Simulation_context ctx__,
K_point< T > &  kp__,
beta_projectors_coeffs_t< T > &  bp_coeffs__,
density_matrix_t density_matrix__ 
)
static

Definition at line 876 of file density.cpp.

◆ add_k_point_contribution_dm_pwpp()

template<typename T , typename F >
static void sirius::add_k_point_contribution_dm_pwpp ( Simulation_context ctx__,
K_point< T > &  kp__,
density_matrix_t density_matrix__ 
)
static

Definition at line 1011 of file density.cpp.

◆ get_rho_up_dn() [1/2]

auto sirius::get_rho_up_dn ( int  num_mag_dims__,
double  rho__,
r3::vector< double >  mag__ 
)
inline

Use Kuebler's trick to get rho_up and rho_dn from density and magnetisation.

Definition at line 80 of file density.hpp.

◆ copy() [1/12]

void sirius::copy ( Density const &  src__,
Density dest__ 
)
inline

Definition at line 746 of file density.hpp.

◆ get_rho_up_dn() [2/2]

template<bool add_pseudo_core__>
std::array< std::unique_ptr< Smooth_periodic_function< double > >, 2 > sirius::get_rho_up_dn ( Density const &  density__,
double  add_delta_rho_xc__ = 0.0,
double  add_delta_mag_xc__ = 0.0 
)
inline

Definition at line 764 of file density.hpp.

◆ copy() [2/12]

void sirius::copy ( density_matrix_t const &  src__,
density_matrix_t dest__ 
)
inline

Definition at line 49 of file density_matrix.hpp.

◆ copy() [3/12]

void sirius::copy ( Occupation_matrix const &  src__,
Occupation_matrix dest__ 
)
inline

Definition at line 131 of file occupation_matrix.hpp.

◆ ewald_energy()

double sirius::ewald_energy ( const Simulation_context ctx,
const fft::Gvec gvec,
const Unit_cell unit_cell 
)

Compute the ion-ion electrostatic energy using Ewald method.

The following contribution (per unit cell) to the total energy has to be computed:

\[ E^{ion-ion} = \frac{1}{N} \frac{1}{2} \sum_{i \neq j} \frac{Z_i Z_j}{|{\bf r}_i - {\bf r}_j|} = \frac{1}{2} \sideset{}{'} \sum_{\alpha \beta {\bf T}} \frac{Z_{\alpha} Z_{\beta}}{|{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|} \]

where \( N \) is the number of unit cells in the crystal. Following the idea of Ewald the Coulomb interaction is split into two terms:

\[ \frac{1}{|{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|} = \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)}{|{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|} + \frac{{\rm erfc}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)}{|{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|} \]

Second term is computed directly. First term is computed in the reciprocal space. Remembering that

\[ \frac{1}{\Omega} \sum_{\bf G} e^{i{\bf Gr}} = \sum_{\bf T} \delta({\bf r - T}) \]

we rewrite the first term as

\[ \frac{1}{2} \sideset{}{'} \sum_{\alpha \beta {\bf T}} Z_{\alpha} Z_{\beta} \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)}{|{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|} = \frac{1}{2} \sum_{\alpha \beta {\bf T}} Z_{\alpha} Z_{\beta} \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)} {|{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|} - \frac{1}{2} \sum_{\alpha} Z_{\alpha}^2 2 \sqrt{\frac{\lambda}{\pi}} = \\ \frac{1}{2} \sum_{\alpha \beta} Z_{\alpha} Z_{\beta} \frac{1}{\Omega} \sum_{\bf G} \int e^{i{\bf Gr}} \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha\beta} + {\bf r}|)}{|{\bf r}_{\alpha\beta} + {\bf r}|} d{\bf r} - \sum_{\alpha} Z_{\alpha}^2 \sqrt{\frac{\lambda}{\pi}} \]

The integral is computed using the \( \ell=0 \) term of the spherical expansion of the plane-wave:

\[ \int e^{i{\bf Gr}} \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha\beta} + {\bf r}|)}{|{\bf r}_{\alpha\beta} + {\bf r}|} d{\bf r} = \int e^{-i{\bf r}_{\alpha \beta}{\bf G}} e^{i{\bf Gr}} \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}|)}{|{\bf r}|} d{\bf r} = e^{-i{\bf r}_{\alpha \beta}{\bf G}} 4 \pi \int_0^{\infty} \frac{\sin({G r})}{G} {\rm erf}(\sqrt{\lambda} r ) dr \]

We will split integral in two parts:

\[ \int_0^{\infty} \sin({G r}) {\rm erf}(\sqrt{\lambda} r ) dr = \int_0^{b} \sin({G r}) {\rm erf}(\sqrt{\lambda} r ) dr + \int_b^{\infty} \sin({G r}) dr = \frac{1}{G} e^{-\frac{G^2}{4 \lambda}} \]

where \( b \) is sufficiently large. To reproduce in Mathrmatica:

Limit[Limit[
Integrate[Sin[g*x]*Erf[Sqrt[nu] * x], {x, 0, b},
Assumptions -> {nu > 0, g >= 0, b > 0}] +
Integrate[Sin[g*(x + I*a)], {x, b, \[Infinity]},
Assumptions -> {a > 0, nu > 0, g >= 0, b > 0}], a -> 0],
b -> \[Infinity], Assumptions -> {nu > 0, g >= 0}]

The first term of the Ewald sum thus becomes:

\[ \frac{2 \pi}{\Omega} \sum_{{\bf G}} \frac{e^{-\frac{G^2}{4 \lambda}}}{G^2} \Big| \sum_{\alpha} Z_{\alpha} e^{-i{\bf r}_{\alpha}{\bf G}} \Big|^2 - \sum_{\alpha} Z_{\alpha}^2 \sqrt{\frac{\lambda}{\pi}} \]

For \( G=0 \) the following is done:

\[ \frac{e^{-\frac{G^2}{4 \lambda}}}{G^2} \approx \frac{1}{G^2}-\frac{1}{4 \lambda } \]

The term \( \frac{1}{G^2} \) is compensated together with the corresponding Hartree terms in electron-electron and electron-ion interactions (cell should be neutral) and we are left with the following conribution:

\[ -\frac{2\pi}{\Omega}\frac{N_{el}^2}{4 \lambda} \]

Final expression for the Ewald energy:

\[ E^{ion-ion} = \frac{1}{2} \sideset{}{'} \sum_{\alpha \beta {\bf T}} Z_{\alpha} Z_{\beta} \frac{{\rm erfc}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)}{|{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|} + \frac{2 \pi}{\Omega} \sum_{{\bf G}\neq 0} \frac{e^{-\frac{G^2}{4 \lambda}}}{G^2} \Big| \sum_{\alpha} Z_{\alpha} e^{-i{\bf r}_{\alpha}{\bf G}} \Big|^2 - \sum_{\alpha} Z_{\alpha}^2 \sqrt{\frac{\lambda}{\pi}} - \frac{2\pi}{\Omega} \frac{N_{el}^2}{4 \lambda} \]

Definition at line 30 of file energy.cpp.

◆ energy_vxc()

double sirius::energy_vxc ( Density const &  density,
Potential const &  potential 
)

Returns exchange correlation potential.

Definition at line 76 of file energy.cpp.

◆ energy_exc()

double sirius::energy_exc ( Density const &  density,
Potential const &  potential 
)

Returns exchange correlation energy.

Definition at line 82 of file energy.cpp.

◆ energy_vha()

double sirius::energy_vha ( Potential const &  potential)

Returns Hatree potential.

Definition at line 88 of file energy.cpp.

◆ energy_bxc()

double sirius::energy_bxc ( const Density density,
const Potential potential 
)

TODO doc.

Definition at line 94 of file energy.cpp.

◆ energy_enuc()

double sirius::energy_enuc ( Simulation_context const &  ctx,
Potential const &  potential 
)

Return nucleus energy in the electrostatic field.

Compute energy of nucleus in the electrostatic potential generated by the total (electrons + nuclei) j* charge density. Diverging self-interaction term z*z/|r=0| is excluded.

Definition at line 104 of file energy.cpp.

◆ energy_vloc()

double sirius::energy_vloc ( Density const &  density,
Potential const &  potential 
)

TODO doc.

Definition at line 119 of file energy.cpp.

◆ core_eval_sum()

double sirius::core_eval_sum ( Unit_cell const &  unit_cell)

Return eigen-value sum of core states.

Definition at line 125 of file energy.cpp.

◆ eval_sum()

double sirius::eval_sum ( Unit_cell const &  unit_cell,
K_point_set const &  kset 
)

TODO doc.

Definition at line 135 of file energy.cpp.

◆ energy_veff()

double sirius::energy_veff ( Density const &  density,
Potential const &  potential 
)

TODO doc.

Definition at line 141 of file energy.cpp.

◆ energy_kin()

double sirius::energy_kin ( Simulation_context const &  ctx,
K_point_set const &  kset,
Density const &  density,
Potential const &  potential 
)

Return kinetic energy.

Definition at line 147 of file energy.cpp.

◆ ks_energy() [1/2]

double sirius::ks_energy ( Simulation_context const &  ctx,
const std::map< std::string, double > &  energies 
)

Definition at line 153 of file energy.cpp.

◆ ks_energy() [2/2]

double sirius::ks_energy ( Simulation_context const &  ctx,
K_point_set const &  kset,
Density const &  density,
Potential const &  potential,
double  ewald_energy 
)

Definition at line 179 of file energy.cpp.

◆ total_energy()

double sirius::total_energy ( Simulation_context const &  ctx,
K_point_set const &  kset,
Density const &  density,
Potential const &  potential,
double  ewald_energy 
)

Total energy of the electronic subsystem.

Full potential total energy

From the definition of the density functional we have:

\[ E[\rho] = T[\rho] + E^{H}[\rho] + E^{XC}[\rho] + E^{ext}[\rho] \]

where \( T[\rho] \) is the kinetic energy, \( E^{H}[\rho] \) - electrostatic energy of electron-electron density interaction, \( E^{XC}[\rho] \) - exchange-correlation energy and \( E^{ext}[\rho] \) - energy in the external field of nuclei.

Electrostatic and external field energies are grouped in the following way:

\[ \frac{1}{2} \int \int \frac{\rho({\bf r})\rho({\bf r'}) d{\bf r} d{\bf r'}}{|{\bf r} - {\bf r'}|} + \int \rho({\bf r}) V^{nuc}({\bf r}) d{\bf r} = \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} + \frac{1}{2} \int \rho({\bf r}) V^{nuc}({\bf r}) d{\bf r} \]

Here \( V^{H}({\bf r}) \) is the total (electron + nuclei) electrostatic potential returned by the poisson solver. Next we transform the remaining term:

\[ \frac{1}{2} \int \rho({\bf r}) V^{nuc}({\bf r}) d{\bf r} = \frac{1}{2} \int \int \frac{\rho({\bf r})\rho^{nuc}({\bf r'}) d{\bf r} d{\bf r'}}{|{\bf r} - {\bf r'}|} = \frac{1}{2} \int V^{H,el}({\bf r}) \rho^{nuc}({\bf r}) d{\bf r} \]

Pseudopotential total energy

Total energy in PW-PP method has the following expression:

\[ E_{tot} = \sum_{i} f_i \sum_{\sigma \sigma'} \langle \psi_i^{\sigma'} | \Big( \hat T + \sum_{\xi \xi'} |\beta_{\xi} \rangle D_{\xi \xi'}^{ion} \delta_{\sigma \sigma'} \langle \beta_{\xi'} |\Big) | \psi_i^{\sigma} \rangle + \int V^{ion}({\bf r})\rho({\bf r})d{\bf r} + \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} + E^{XC}[\rho + \rho_{core}, |{\bf m}|] \]

Ionic contribution to the non-local part of pseudopotential is diagonal in spin. The following rearrangement is performed next:

\[ \int \rho({\bf r}) \Big( V^{ion}({\bf r}) + \frac{1}{2} V^{H}({\bf r}) \Big) d{\bf r} = \\ \int \rho({\bf r}) \Big( V^{ion}({\bf r}) + V^{H}({\bf r}) + V^{XC}({\bf r}) \Big) d{\bf r} + \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} - \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} - \int V^{XC}({\bf r})\rho({\bf r})d{\bf r} - \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} = \\ \sum_{\sigma \sigma'}\int \rho_{\sigma \sigma'}({\bf r}) V_{\sigma' \sigma}^{eff}({\bf r}) d{\bf r} - \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} - \int V^{XC}({\bf r})\rho({\bf r})d{\bf r} - \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} \]

Where

\[ \rho_{\sigma \sigma'}({\bf r}) = \sum_{i}^{occ} f_{i} \psi_{i}^{\sigma' *}({\bf r})\psi_{i}^{\sigma}({\bf r}) \]

is a \( 2 \times 2 \) density matrix and

\[ V_{\sigma\sigma'}^{eff}({\bf r})=\Big({\bf I}V^{eff}({\bf r})+{\boldsymbol \sigma}{\bf B}^{XC}({\bf r}) \Big) = \left( \begin{array}{cc} V^{eff}({\bf r})+B_z^{XC}({\bf r}) & B_x^{XC}({\bf r})-iB_y^{XC}({\bf r}) \\ B_x^{XC}({\bf r})+iB_y^{XC}({\bf r}) & V^{eff}({\bf r})-B_z^{XC}({\bf r}) \end{array} \right) \]

is a \( 2 \times 2 \) matrix potential (see Spin-polarized DFT for the full derivation).

We are interested in this term:

\[ \sum_{\sigma \sigma'}\int \rho_{\sigma \sigma'}({\bf r}) V_{\sigma' \sigma}^{eff}({\bf r}) d{\bf r} = \int V^{eff}({\bf r})\rho({\bf r})d{\bf r} + \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} \]

We are going to split density into two contributions (sum of occupied bands \( \rho^{ps} \) and augmented charge \( \rho^{aug} \)) and use the definition of \( \rho^{aug} \):

\[ \sum_{\sigma \sigma'}\int \rho_{\sigma \sigma'}^{aug}({\bf r}) V_{\sigma' \sigma}^{eff}({\bf r}) d{\bf r} = \sum_{\sigma \sigma'}\int \sum_{i} \sum_{\xi \xi'} f_i \langle \psi_i^{\sigma'} | \beta_{\xi} \rangle Q_{\xi \xi'}({\bf r}) \langle \beta_{\xi'} | \psi_i^{\sigma} \rangle V_{\sigma' \sigma}^{eff}({\bf r}) d{\bf r} = \sum_{\sigma \sigma'} \sum_{i}\sum_{\xi \xi'} f_i \langle \psi_i^{\sigma'} | \beta_{\xi} \rangle D_{\xi \xi', \sigma' \sigma}^{aug} \langle \beta_{\xi'} | \psi_i^{\sigma} \rangle \]

Now we can rewrite the total energy expression:

\[ E_{tot} = \sum_{i} f_i \sum_{\sigma \sigma'} \langle \psi_i^{\sigma'} | \Big( \hat T + \sum_{\xi \xi'} |\beta_{\xi} \rangle D_{\xi \xi'}^{ion} \delta_{\sigma \sigma'} + D_{\xi \xi', \sigma' \sigma}^{aug} \langle \beta_{\xi'} |\Big) | \psi_i^{\sigma} \rangle + \sum_{\sigma \sigma} \int V^{eff}_{\sigma' \sigma}({\bf r})\rho^{ps}_{\sigma \sigma'}({\bf r})d{\bf r} - \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} - \int V^{XC}({\bf r})\rho({\bf r}) d{\bf r} - \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} + E^{XC}[\rho + \rho_{core}, |{\bf m}|] \]

From the Kohn-Sham equations

\[ \hat T |\psi_i^{\sigma} \rangle + \sum_{\sigma'} \sum_{\xi \xi'} \Big( |\beta_{\xi} \rangle D_{\xi \xi', \sigma' \sigma} \langle \beta_{\xi'}| + \hat V^{eff}_{\sigma' \sigma} \Big) | \psi_i^{\sigma'} \rangle = \varepsilon_i \Big( 1+\hat S \Big) |\psi_i^{\sigma} \rangle \]

we immediately obtain that

\[ \sum_{i} f_i \varepsilon_i = \sum_{i} f_i \sum_{\sigma \sigma'} \langle \psi_i^{\sigma'} | \Big( \hat T + \sum_{\xi \xi'} |\beta_{\xi} \rangle D_{\xi \xi', \sigma' \sigma} \langle \beta_{\xi'} |\Big) | \psi_i^{\sigma} \rangle + \sum_{\sigma \sigma} \int V^{eff}_{\sigma' \sigma}({\bf r})\rho^{ps}_{\sigma \sigma'}({\bf r})d{\bf r} \]

and the total energy expression simplifies to:

\[ E_{tot} = \sum_{i} f_i \varepsilon_i - \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} - \int V^{XC}({\bf r})\rho({\bf r}) d{\bf r} - \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} + E^{XC}[\rho + \rho_{core}, |{\bf m}|] \]

Definition at line 186 of file energy.cpp.

◆ total_energy_components()

std::map< std::string, double > sirius::total_energy_components ( Simulation_context const &  ctx,
const K_point_set kset,
Density const &  density,
Potential const &  potential,
double  ewald_energy 
)

Definition at line 212 of file energy.cpp.

◆ hubbard_energy()

double sirius::hubbard_energy ( Density const &  density)

Definition at line 249 of file energy.cpp.

◆ one_electron_energy()

double sirius::one_electron_energy ( Density const &  density,
Potential const &  potential 
)

Definition at line 259 of file energy.cpp.

◆ one_electron_energy_hubbard() [1/2]

double sirius::one_electron_energy_hubbard ( Density const &  density,
Potential const &  potential 
)

Definition at line 266 of file energy.cpp.

◆ energy_potential()

double sirius::energy_potential ( Density const &  density,
Potential const &  potential 
)

Definition at line 276 of file energy.cpp.

◆ energy_dict()

auto sirius::energy_dict ( Simulation_context const &  ctx__,
K_point_set const &  kset__,
Density const &  density__,
Potential const &  potential__,
double  ewald_energy__,
double  scf_correction__ = 0 
)
inline

Definition at line 270 of file energy.hpp.

◆ make_periodic_function() [1/2]

template<index_domain_t index_domain, typename F >
auto sirius::make_periodic_function ( Unit_cell const &  uc__,
fft::Gvec const &  gv__,
sddk::mdarray< std::complex< double >, 2 > const &  phase_factors_t__,
F &&  form_factors__ 
)
inline

Make periodic function out of form factors.

Return vector of plane-wave coefficients

Definition at line 34 of file make_periodic_function.hpp.

◆ make_periodic_function() [2/2]

template<index_domain_t index_domain>
auto sirius::make_periodic_function ( Unit_cell const &  uc__,
fft::Gvec const &  gv__,
sddk::mdarray< std::complex< double >, 2 > const &  phase_factors_t__,
sddk::mdarray< double, 2 > const &  form_factors__ 
)
inline

Make periodic out of form factors computed for G-shells.

Definition at line 67 of file make_periodic_function.hpp.

◆ inner() [1/8]

template<typename T >
T sirius::inner ( PAW_field4D< T > const &  x__,
PAW_field4D< T > const &  y__ 
)

Definition at line 126 of file paw_field4d.hpp.

◆ inner() [2/8]

template<typename T >
T sirius::inner ( Periodic_function< T > const &  f__,
Periodic_function< T > const &  g__ 
)
inline

Definition at line 288 of file periodic_function.hpp.

◆ copy() [4/12]

template<typename T >
void sirius::copy ( Periodic_function< T > const &  src__,
periodic_function_ptr_t< T >  dest__ 
)
inline

Copy values of the function to the external location.

Definition at line 304 of file periodic_function.hpp.

◆ copy() [5/12]

template<typename T >
void sirius::copy ( periodic_function_ptr_t< T > const  src__,
Periodic_function< T > &  dest__ 
)
inline

Copy the values of the function from the external location.

Definition at line 314 of file periodic_function.hpp.

◆ check_smooth_periodic_function_ptr()

template<typename T >
void sirius::check_smooth_periodic_function_ptr ( smooth_periodic_function_ptr_t< T > const &  ptr__,
fft::spfft_transform_type< T > const &  spfft__ 
)
inline

Definition at line 39 of file smooth_periodic_function.hpp.

◆ gradient() [1/3]

template<typename T >
Smooth_periodic_vector_function< T > sirius::gradient ( Smooth_periodic_function< T > &  f__)
inline

Gradient of the function in the plane-wave domain.

Input functions is expected in the plane wave domain, output function is also in the plane-wave domain

Definition at line 426 of file smooth_periodic_function.hpp.

◆ divergence() [1/3]

template<typename T >
Smooth_periodic_function< T > sirius::divergence ( Smooth_periodic_vector_function< T > &  g__)
inline

Divergence of the vecor function.

Input and output functions are in plane-wave domain

Definition at line 445 of file smooth_periodic_function.hpp.

◆ laplacian() [1/2]

template<typename T >
Smooth_periodic_function< T > sirius::laplacian ( Smooth_periodic_function< T > &  f__)
inline

Laplacian of the function in the plane-wave domain.

Definition at line 464 of file smooth_periodic_function.hpp.

◆ dot()

template<typename T >
Smooth_periodic_function< T > sirius::dot ( Smooth_periodic_vector_function< T > &  vf__,
Smooth_periodic_vector_function< T > &  vg__ 
)
inline

Definition at line 481 of file smooth_periodic_function.hpp.

◆ inner_local() [1/2]

template<typename T , typename F >
T sirius::inner_local ( Smooth_periodic_function< T > const &  f__,
Smooth_periodic_function< T > const &  g__,
F &&  theta__ 
)
inline

Compute local contribution to inner product <f|g>

Definition at line 503 of file smooth_periodic_function.hpp.

◆ inner_local() [2/2]

template<typename T >
T sirius::inner_local ( Smooth_periodic_function< T > const &  f__,
Smooth_periodic_function< T > const &  g__ 
)
inline

Definition at line 521 of file smooth_periodic_function.hpp.

◆ inner() [3/8]

template<typename T , typename F >
T sirius::inner ( Smooth_periodic_function< T > const &  f__,
Smooth_periodic_function< T > const &  g__,
F &&  theta__ 
)
inline

Definition at line 528 of file smooth_periodic_function.hpp.

◆ inner() [4/8]

template<typename T >
T sirius::inner ( Smooth_periodic_function< T > const &  f__,
Smooth_periodic_function< T > const &  g__ 
)
inline

Compute inner product <f|g>

Definition at line 541 of file smooth_periodic_function.hpp.

◆ copy() [6/12]

template<typename T >
void sirius::copy ( Smooth_periodic_function< T > const &  src__,
smooth_periodic_function_ptr_t< T >  dest__ 
)
inline

Copy real-space values from the function to external pointer.

Definition at line 549 of file smooth_periodic_function.hpp.

◆ copy() [7/12]

template<typename T >
void sirius::copy ( smooth_periodic_function_ptr_t< T > const  src__,
Smooth_periodic_function< T > &  dest__ 
)
inline

Copy real-space values from the external pointer to function.

Definition at line 576 of file smooth_periodic_function.hpp.

◆ copy() [8/12]

template<typename T >
void sirius::copy ( Smooth_periodic_function< T > const &  src__,
Smooth_periodic_function< T > &  dest__ 
)
inline

Definition at line 596 of file smooth_periodic_function.hpp.

◆ scale() [1/2]

template<typename T >
void sirius::scale ( alpha__,
Smooth_periodic_function< T > &  x__ 
)
inline

Definition at line 604 of file smooth_periodic_function.hpp.

◆ axpy() [1/2]

template<typename T >
void sirius::axpy ( alpha__,
Smooth_periodic_function< T > const &  x__,
Smooth_periodic_function< T > &  y__ 
)
inline

Definition at line 616 of file smooth_periodic_function.hpp.

◆ operator*() [1/5]

template<typename T >
auto sirius::operator* ( Spheric_function< function_domain_t::spatial, T > const &  a__,
Spheric_function< function_domain_t::spatial, T > const &  b__ 
)
inline

Multiplication of two functions in spatial domain.

The result of the operation is a scalar function in spatial domain

Definition at line 249 of file spheric_function.hpp.

◆ operator*() [2/5]

auto sirius::operator* ( Spheric_vector_function< function_domain_t::spatial, double > const &  f,
Spheric_vector_function< function_domain_t::spatial, double > const &  g 
)
inline

Dot product of two gradiensts of real functions in spatial domain.

The result of the operation is the real scalar function in spatial domain

Definition at line 273 of file spheric_function.hpp.

◆ operator+()

template<function_domain_t domain_t, typename T >
auto sirius::operator+ ( Spheric_function< domain_t, T > const &  a__,
Spheric_function< domain_t, T > const &  b__ 
)

Summation of two functions.

Definition at line 303 of file spheric_function.hpp.

◆ operator-()

template<function_domain_t domain_t, typename T >
auto sirius::operator- ( Spheric_function< domain_t, T > const &  a__,
Spheric_function< domain_t, T > const &  b__ 
)

Subtraction of functions.

Definition at line 326 of file spheric_function.hpp.

◆ operator*() [3/5]

template<function_domain_t domain_t, typename T >
auto sirius::operator* ( a__,
Spheric_function< domain_t, T > const &  b__ 
)

Multiply function by a scalar.

Definition at line 349 of file spheric_function.hpp.

◆ operator*() [4/5]

template<function_domain_t domain_t, typename T >
auto sirius::operator* ( Spheric_function< domain_t, T > const &  b__,
a__ 
)

Multiply function by a scalar (inverse order).

Definition at line 365 of file spheric_function.hpp.

◆ inner() [5/8]

template<function_domain_t domain_t, typename T >
auto sirius::inner ( Spheric_function< domain_t, T > const &  f1,
Spheric_function< domain_t, T > const &  f2 
)
inline

Inner product of two spherical functions.

The result of the operation is a scalar value.

Definition at line 374 of file spheric_function.hpp.

◆ laplacian() [2/2]

template<typename T >
auto sirius::laplacian ( Spheric_function< function_domain_t::spectral, T > const &  f__)
inline

Compute Laplacian of the spheric function.

Laplacian in spherical coordinates has the following expression:

\[ \Delta = \frac{1}{r^2}\frac{\partial}{\partial r}\Big( r^2 \frac{\partial}{\partial r} \Big) + \frac{1}{r^2}\Delta_{\theta, \phi} \]

Definition at line 401 of file spheric_function.hpp.

◆ convert() [1/4]

void sirius::convert ( Spheric_function< function_domain_t::spectral, std::complex< double > > const &  f__,
Spheric_function< function_domain_t::spectral, double > &  g__ 
)
inline

Convert from Ylm to Rlm representation.

Definition at line 434 of file spheric_function.hpp.

◆ convert() [2/4]

auto sirius::convert ( Spheric_function< function_domain_t::spectral, std::complex< double > > const &  f__)
inline

Convert from Ylm to Rlm representation.

Definition at line 468 of file spheric_function.hpp.

◆ convert() [3/4]

void sirius::convert ( Spheric_function< function_domain_t::spectral, double > const &  f__,
Spheric_function< function_domain_t::spectral, std::complex< double > > &  g__ 
)
inline

Convert from Rlm to Ylm representation.

Definition at line 477 of file spheric_function.hpp.

◆ convert() [4/4]

auto sirius::convert ( Spheric_function< function_domain_t::spectral, double > const &  f__)
inline

Convert from Rlm to Ylm representation.

Definition at line 511 of file spheric_function.hpp.

◆ transform() [1/4]

template<typename T >
void sirius::transform ( SHT const &  sht__,
Spheric_function< function_domain_t::spectral, T > const &  f__,
Spheric_function< function_domain_t::spatial, T > &  g__ 
)
inline

Definition at line 520 of file spheric_function.hpp.

◆ transform() [2/4]

template<typename T >
auto sirius::transform ( SHT const &  sht__,
Spheric_function< function_domain_t::spectral, T > const &  f__ 
)
inline

Transform to spatial domain (to r, \theta, \phi coordinates).

Definition at line 530 of file spheric_function.hpp.

◆ transform() [3/4]

template<typename T >
void sirius::transform ( SHT const &  sht__,
Spheric_function< function_domain_t::spatial, T > const &  f__,
Spheric_function< function_domain_t::spectral, T > &  g__ 
)
inline

Definition at line 539 of file spheric_function.hpp.

◆ transform() [4/4]

template<typename T >
auto sirius::transform ( SHT const &  sht__,
Spheric_function< function_domain_t::spatial, T > const &  f__ 
)
inline

Transform to spectral domain.

Definition at line 548 of file spheric_function.hpp.

◆ gradient() [2/3]

auto sirius::gradient ( Spheric_function< function_domain_t::spectral, std::complex< double > > const &  f)
inline

Gradient of the function in complex spherical harmonics.

Definition at line 557 of file spheric_function.hpp.

◆ gradient() [3/3]

auto sirius::gradient ( Spheric_function< function_domain_t::spectral, double > const &  f__)
inline

Gradient of the function in real spherical harmonics.

Definition at line 612 of file spheric_function.hpp.

◆ divergence() [2/3]

auto sirius::divergence ( Spheric_vector_function< function_domain_t::spectral, std::complex< double > > const &  vf__)
inline

Divergence of the vector function in complex spherical harmonics.

Definition at line 627 of file spheric_function.hpp.

◆ divergence() [3/3]

auto sirius::divergence ( Spheric_vector_function< function_domain_t::spectral, double > const &  vf)
inline

Definition at line 640 of file spheric_function.hpp.

◆ inner() [6/8]

template<typename T , typename I >
T sirius::inner ( Spheric_function_set< T, I > const &  f1__,
Spheric_function_set< T, I > const &  f2__ 
)
inline

Definition at line 176 of file spheric_function_set.hpp.

◆ copy() [9/12]

template<typename T , typename I >
void sirius::copy ( Spheric_function_set< T, I > const &  src__,
spheric_function_set_ptr_t< T >  dest__ 
)
inline

Copy from Spheric_function_set to external pointer.

External pointer is assumed to be global.

Definition at line 209 of file spheric_function_set.hpp.

◆ copy() [10/12]

template<typename T , typename I >
void sirius::copy ( spheric_function_set_ptr_t< T > const  src__,
Spheric_function_set< T, I > &  dest__ 
)
inline

Copy from external pointer to Spheric_function_set.

External pointer is assumed to be global.

Definition at line 237 of file spheric_function_set.hpp.

◆ copy() [11/12]

template<typename T , typename I >
void sirius::copy ( Spheric_function_set< T, I > const &  src__,
Spheric_function_set< T, I > &  dest__ 
)
inline

Definition at line 258 of file spheric_function_set.hpp.

◆ scale() [2/2]

template<typename T , typename I >
void sirius::scale ( alpha__,
Spheric_function_set< T, I > &  x__ 
)
inline

Definition at line 269 of file spheric_function_set.hpp.

◆ axpy() [2/2]

template<typename T , typename I >
void sirius::axpy ( alpha__,
Spheric_function_set< T, I > const &  x__,
Spheric_function_set< T, I > &  y__ 
)
inline

Definition at line 280 of file spheric_function_set.hpp.

◆ add_k_point_contribution_nonlocal()

template<typename T , typename F >
void sirius::add_k_point_contribution_nonlocal ( Simulation_context ctx__,
Beta_projectors_base< T > &  bp_base__,
K_point< T > &  kp__,
sddk::mdarray< real_type< F >, 2 > &  collect_res__ 
)
Template Parameters
TPrecision type of the wave-functions

Definition at line 38 of file non_local_functor.hpp.

◆ wavefunctions_strain_deriv()

void sirius::wavefunctions_strain_deriv ( Simulation_context const &  ctx__,
K_point< double > &  kp__,
wf::Wave_functions< double > &  dphi__,
sddk::mdarray< double, 2 > const &  rlm_g__,
sddk::mdarray< double, 3 > const &  rlm_dg__,
int  nu__,
int  mu__ 
)

Definition at line 9 of file wavefunction_strain_deriv.hpp.

◆ check_wave_functions()

template<typename T , typename F >
void sirius::check_wave_functions ( Hamiltonian_k< real_type< T > > const &  Hk__,
wf::Wave_functions< T > &  psi__,
wf::spin_range  sr__,
wf::band_range  br__,
double *  eval__ 
)

Definition at line 34 of file check_wave_functions.hpp.

◆ project_out_subspace()

template<typename T , typename F >
void sirius::project_out_subspace ( ::spla::Context &  spla_ctx__,
sddk::memory_t  mem__,
wf::spin_range  spins__,
wf::Wave_functions< T > &  phi__,
wf::Wave_functions< T > &  sphi__,
int  N__,
int  n__,
la::dmatrix< F > &  o__ 
)
inline

Definition at line 55 of file davidson.hpp.

◆ davidson()

template<typename T , typename F , davidson_evp_t what>
auto sirius::davidson ( Hamiltonian_k< T > const &  Hk__,
K_point< T > &  kp__,
wf::num_bands  num_bands__,
wf::num_mag_dims  num_mag_dims__,
wf::Wave_functions< T > &  psi__,
std::function< double(int, int)>  tolerance__,
double  res_tol__,
int  num_steps__,
bool  locking__,
int  subspace_size__,
bool  estimate_eval__,
bool  extra_ortho__,
std::ostream &  out__,
int  verbosity__,
wf::Wave_functions< T > *  phi_extra__ = nullptr 
)
inline

Solve the eigen-problem using Davidson iterative method.

Template Parameters
TPrecision type of wave-functions (float or double).
FType of the subspace matrices (fload or duble for Gamma case, complex<float> or complex<doouble> for general k-point case.
whatWhat to solve: H|psi> = e*S|psi> or S|psi> = o|psi>
Parameters
[in]HkHamiltonian for a given k-point.
[in]num_bandsNumber of eigen-states (bands) to compute.
[in]num_mag_dimsNumber of magnetic dimensions (0, 1 or 3).
[in,out]psiWave-functions. On input they are used for the starting guess of the subspace basis. On output they are the solutions of Hk|psi> = e S|psi> eigen-problem.
[in]toleranceLambda-function for the band energy tolerance.
[in]res_tolResidual tolerance.
[in]num_stpesNumber of iterative steps.
[in]lockingLock and do not update of the converged wave-functions.
[in]subspace_sizeSize of the diagonalziation subspace.
[in]estimate_evalEstimate eigen-values to get the converrged rersiduals.
[in]extra_orthoOrthogonalize new subspace basis one extra time.
[out]outOutput stream.
[in]verbosityVerbosity level.
[in]phi_extraPointer to the additional (fixed) auxiliary basis functions (used in LAPW).
Returns
List of eigen-values.
  • set the relative tolerance convergence criterion *‍/

Definition at line 141 of file davidson.hpp.

◆ diagonalize()

template<typename T , typename F >
auto sirius::diagonalize ( Hamiltonian0< T > const &  H0__,
K_point_set kset__,
double  itsol_tol__ 
)
inline

Diagonalize KS Hamiltonian for all k-points in the set.

Template Parameters
TPrecision type of the wave-functions
FPrecition type of the Hamiltonian matrix

Definition at line 46 of file diagonalize.hpp.

◆ diagonalize_fp_fv_exact() [1/2]

void sirius::diagonalize_fp_fv_exact ( Hamiltonian_k< float > const &  ,
K_point< float > &   
)
inline

Definition at line 34 of file diagonalize_fp.hpp.

◆ diagonalize_fp_fv_exact() [2/2]

void sirius::diagonalize_fp_fv_exact ( Hamiltonian_k< double > const &  Hk__,
K_point< double > &  kp__ 
)
inline

Definition at line 40 of file diagonalize_fp.hpp.

◆ get_singular_components()

void sirius::get_singular_components ( Hamiltonian_k< double > const &  Hk__,
K_point< double > &  kp__,
double  itsol_tol__ 
)
inline

Definition at line 244 of file diagonalize_fp.hpp.

◆ diagonalize_fp_fv_davidson() [1/2]

void sirius::diagonalize_fp_fv_davidson ( Hamiltonian_k< float > const &  ,
K_point< float > &  ,
double   
)
inline

Definition at line 271 of file diagonalize_fp.hpp.

◆ diagonalize_fp_fv_davidson() [2/2]

void sirius::diagonalize_fp_fv_davidson ( Hamiltonian_k< double > const &  Hk__,
K_point< double > &  kp__,
double  itsol_tol__ 
)
inline

Definition at line 277 of file diagonalize_fp.hpp.

◆ diagonalize_fp_sv() [1/2]

void sirius::diagonalize_fp_sv ( Hamiltonian_k< float > const &  ,
K_point< float > &   
)
inline

Definition at line 347 of file diagonalize_fp.hpp.

◆ diagonalize_fp_sv() [2/2]

void sirius::diagonalize_fp_sv ( Hamiltonian_k< double > const &  Hk__,
K_point< double > &  kp 
)
inline

Diagonalize second-variational Hamiltonian.

Definition at line 354 of file diagonalize_fp.hpp.

◆ diagonalize_fp()

template<typename T >
void sirius::diagonalize_fp ( Hamiltonian_k< T > const &  Hk__,
K_point< T > &  kp__,
double  itsol_tol__ 
)
inline

Diagonalize a full-potential LAPW Hamiltonian.

Definition at line 502 of file diagonalize_fp.hpp.

◆ diagonalize_pp_exact() [1/2]

template<typename T , typename F >
std::enable_if_t<!std::is_same< T, real_type< F > >::value, void > sirius::diagonalize_pp_exact ( int  ispn__,
Hamiltonian_k< T > const &  Hk__,
K_point< T > &  kp 
)
inline

Definition at line 35 of file diagonalize_pp.hpp.

◆ diagonalize_pp_exact() [2/2]

template<typename T , typename F >
std::enable_if_t< std::is_same< T, real_type< F > >::value, void > sirius::diagonalize_pp_exact ( int  ispn__,
Hamiltonian_k< T > const &  Hk__,
K_point< T > &  kp__ 
)
inline

Definition at line 42 of file diagonalize_pp.hpp.

◆ diag_S_davidson()

template<typename T , typename F >
sddk::mdarray< real_type< F >, 1 > sirius::diag_S_davidson ( Hamiltonian_k< T > const &  Hk__,
K_point< T > &  kp__ 
)
inline

Diagonalize S-operator of the ultrasoft or PAW methods.

Sometimes this is needed to check the quality of pseudopotential.

Definition at line 218 of file diagonalize_pp.hpp.

◆ diagonalize_pp()

template<typename T , typename F >
auto sirius::diagonalize_pp ( Hamiltonian_k< T > const &  Hk__,
K_point< T > &  kp__,
double  itsol_tol__,
double  empy_tol__ 
)
inline

Definition at line 294 of file diagonalize_pp.hpp.

◆ generate_subspace_matrix()

template<typename T , typename F >
void sirius::generate_subspace_matrix ( Simulation_context ctx__,
int  N__,
int  n__,
int  num_locked__,
wf::Wave_functions< T > &  phi__,
wf::Wave_functions< T > &  op_phi__,
la::dmatrix< F > &  mtrx__,
la::dmatrix< F > *  mtrx_old__ = nullptr 
)

Generate subspace matrix for the iterative diagonalization.

Compute \( O_{ii'} = \langle \phi_i | \hat O | \phi_{i'} \rangle \) operator matrix for the subspace spanned by the wave-functions \( \phi_i \). The matrix is always returned in the CPU pointer because most of the standard math libraries start from the CPU.

Template Parameters
TPrecision type of the wave-functions
FType of the output subspace matrix.
Parameters
[in]ctxSimulation context
[in]NNumber of existing (old) states phi.
[in]nNumber of new states phi.
[in]num_lockedNumber of locked states phi. Locked states are excluded from the subspace basis.
[in]phiSubspace basis functions phi.
[in]op_phiOperator (H, S or overlap) applied to phi.
[out]mtrxNew subspace matrix.
[in,out]mtrx_oldPointer to old subpsace matrix. It is used to store and reuse the subspace matrix of the previous step.

Definition at line 51 of file generate_subspace_matrix.hpp.

◆ initialize_subspace() [1/2]

template<typename T , typename F >
void sirius::initialize_subspace ( Hamiltonian_k< T > const &  Hk__,
K_point< T > &  kp__,
int  num_ao__ 
)
inline

Initialize the wave-functions subspace at a given k-point.

If the number of atomic orbitals is smaller than the number of bands, the rest of the initial wave-functions are created from the random numbers.

Definition at line 38 of file initialize_subspace.hpp.

◆ initialize_subspace() [2/2]

template<typename T >
void sirius::initialize_subspace ( K_point_set kset__,
Hamiltonian0< T > &  H0__ 
)

Definition at line 290 of file initialize_subspace.hpp.

◆ mul_by_veff()

template<typename T >
static void sirius::mul_by_veff ( fft::spfft_transform_type< T > &  spfftk__,
T const *  in__,
std::array< std::unique_ptr< Smooth_periodic_function< T > >, 6 > const &  veff_vec__,
int  idx_veff__,
T *  out__ 
)
inlinestatic

Multiply FFT buffer by the effective potential.

Definition at line 210 of file local_operator.cpp.

◆ apply_non_local_D_Q()

template<typename T , typename F >
void sirius::apply_non_local_D_Q ( sddk::memory_t  mem__,
wf::spin_range  spins__,
wf::band_range  br__,
Beta_projector_generator< T > &  beta__,
beta_projectors_coeffs_t< T > &  beta_coeffs__,
wf::Wave_functions< T > const &  phi__,
D_operator< T > const *  d_op__,
wf::Wave_functions< T > *  hphi__,
Q_operator< T > const *  q_op__,
wf::Wave_functions< T > *  sphi__ 
)
Template Parameters
TPrecision of the wave-functions.
FType of the subspace.
Parameters
[in]spinsRange of the spin index.
[in]NStarting index of the wave-functions.
[in]nNumber of wave-functions to which D and Q are applied.
[in]betaBeta-projector generator
[in]beta_coeffsBeta-projector coefficients
[in]phiWave-functions.
[in]d_opPointer to D-operator.
[out]hphiResulting |beta>D<beta|phi>
[in]q_opPointer to Q-operator.
[out]sphiResulting |beta>Q<beta|phi>

Definition at line 126 of file non_local_operator.hpp.

◆ apply_S_operator()

template<typename T , typename F >
void sirius::apply_S_operator ( sddk::memory_t  mem__,
wf::spin_range  spins__,
wf::band_range  br__,
Beta_projector_generator< T > &  beta__,
beta_projectors_coeffs_t< T > &  beta_coeffs__,
wf::Wave_functions< T > const &  phi__,
Q_operator< T > const *  q_op__,
wf::Wave_functions< T > &  sphi__ 
)

Compute |sphi> = (1 + Q)|phi>

Definition at line 172 of file non_local_operator.hpp.

◆ apply_U_operator()

template<typename T >
void sirius::apply_U_operator ( Simulation_context ctx__,
wf::spin_range  spins__,
wf::band_range  br__,
wf::Wave_functions< T > const &  hub_wf__,
wf::Wave_functions< T > const &  phi__,
U_operator< T > const &  um__,
wf::Wave_functions< T > &  hphi__ 
)

Apply Hubbard U correction

Template Parameters
TPrecision type of wave-functions (flat or double).
Parameters
[in]hub_wfHubbard atomic wave-functions.
[in]phiSet of wave-functions to which Hubbard correction is applied.
[out]hphiOutput wave-functions to which the result is added.

Definition at line 110 of file s_u_operator.cpp.

◆ apply_S_operator_strain_deriv()

void sirius::apply_S_operator_strain_deriv ( sddk::memory_t  mem__,
int  comp__,
Beta_projector_generator< double > &  bp__,
beta_projectors_coeffs_t< double > &  bp_coeffs__,
Beta_projector_generator< double > &  bp_strain_deriv__,
beta_projectors_coeffs_t< double > &  bp_strain_deriv_coeffs__,
wf::Wave_functions< double > &  phi__,
Q_operator< double > &  q_op__,
wf::Wave_functions< double > &  ds_phi__ 
)

Apply strain derivative of S-operator to all scalar functions.

Definition at line 193 of file s_u_operator.cpp.

◆ pseudopotential_hmatrix()

template<typename T >
dmatrix< T > sirius::pseudopotential_hmatrix ( K_point kp__,
int  ispn__,
Hamiltonian &  H__ 
)
inline

Definition at line 6 of file pseudopotential_hmatrix.hpp.

◆ compute_residuals()

template<typename T >
static void sirius::compute_residuals ( sddk::memory_t  mem__,
wf::spin_range  spins__,
wf::num_bands  num_bands__,
sddk::mdarray< T, 1 > const &  eval__,
wf::Wave_functions< T > const &  hpsi__,
wf::Wave_functions< T > const &  opsi__,
wf::Wave_functions< T > &  res__ 
)
static

Compute band residuals.

Template Parameters
TPrecision type of the wave-functions (float or double).

Definition at line 128 of file residuals.hpp.

◆ apply_preconditioner()

template<typename T >
void sirius::apply_preconditioner ( sddk::memory_t  mem__,
wf::spin_range  spins__,
wf::num_bands  num_bands__,
wf::Wave_functions< T > &  res__,
sddk::mdarray< T, 2 > const &  h_diag__,
sddk::mdarray< T, 2 > const &  o_diag__,
sddk::mdarray< T, 1 > const &  eval__ 
)

Apply preconditioner to the residuals.

Definition at line 166 of file residuals.hpp.

◆ normalized_preconditioned_residuals()

template<typename T , typename F >
static auto sirius::normalized_preconditioned_residuals ( sddk::memory_t  mem__,
wf::spin_range  spins__,
wf::num_bands  num_bands__,
sddk::mdarray< T, 1 > const &  eval__,
wf::Wave_functions< T > const &  hpsi__,
wf::Wave_functions< T > const &  opsi__,
wf::Wave_functions< T > &  res__,
sddk::mdarray< T, 2 > const &  h_diag__,
sddk::mdarray< T, 2 > const &  o_diag__,
norm_tolerance__,
bool  gamma__ 
)
static

Definition at line 194 of file residuals.hpp.

◆ residuals()

template<typename T , typename F >
auto sirius::residuals ( Simulation_context ctx__,
sddk::memory_t  mem__,
wf::spin_range  sr__,
int  N__,
int  num_bands__,
int  num_locked__,
sddk::mdarray< real_type< F >, 1 > &  eval__,
la::dmatrix< F > &  evec__,
wf::Wave_functions< T > &  hphi__,
wf::Wave_functions< T > &  ophi__,
wf::Wave_functions< T > &  hpsi__,
wf::Wave_functions< T > &  opsi__,
wf::Wave_functions< T > &  res__,
sddk::mdarray< T, 2 > const &  h_diag__,
sddk::mdarray< T, 2 > const &  o_diag__,
bool  estimate_eval__,
norm_tolerance__,
std::function< bool(int, int)>  is_converged__ 
)

Compute residuals from eigen-vectors.

Template Parameters
TPrecision type of the wave-functions (float or double).
FType of the subspace (float or double for Gamma-point calculation, complex<float> or complex<double> otherwise.

The residuals of wave-functions are defined as:

\[ R_{i} = \hat H \psi_{i} - \epsilon_{i} \hat S \psi_{i} \]

Definition at line 277 of file residuals.hpp.

◆ generate_potential()

void sirius::generate_potential ( Hubbard_matrix const &  om__,
Hubbard_matrix um__ 
)

Definition at line 523 of file hubbard_potential_energy.cpp.

◆ energy()

double sirius::energy ( Hubbard_matrix const &  om__)

Definition at line 551 of file hubbard_potential_energy.cpp.

◆ one_electron_energy_hubbard() [2/2]

double sirius::one_electron_energy_hubbard ( Hubbard_matrix const &  om__,
Hubbard_matrix const &  pm__ 
)

Definition at line 593 of file hubbard_potential_energy.cpp.

◆ copy() [12/12]

void sirius::copy ( Hubbard_matrix const &  src__,
Hubbard_matrix dest__ 
)
inline

Definition at line 149 of file hubbard_matrix.hpp.

◆ update_density_matrix_deriv()

static void sirius::update_density_matrix_deriv ( la::lib_t  la__,
sddk::memory_t  mt__,
int  nwfh__,
int  nbnd__,
std::complex< double > *  alpha__,
la::dmatrix< std::complex< double > > const &  phi_hub_s_psi_deriv__,
la::dmatrix< std::complex< double > > const &  psi_s_phi_hub__,
std::complex< double > *  dn__,
int  ld__ 
)
static

Definition at line 43 of file hubbard_occupancies_derivatives.cpp.

◆ build_phi_hub_s_psi_deriv()

static void sirius::build_phi_hub_s_psi_deriv ( Simulation_context const &  ctx__,
int  nbnd__,
int  nawf__,
la::dmatrix< std::complex< double > > const &  ovlp__,
la::dmatrix< std::complex< double > > const &  inv_sqrt_O__,
la::dmatrix< std::complex< double > > const &  phi_atomic_s_psi__,
la::dmatrix< std::complex< double > > const &  phi_atomic_ds_psi__,
std::vector< int > const &  atomic_wf_offset__,
std::vector< int > const &  hubbard_wf_offset__,
la::dmatrix< std::complex< double > > &  phi_hub_s_psi_deriv__ 
)
static

Definition at line 59 of file hubbard_occupancies_derivatives.cpp.

◆ compute_inv_sqrt_O_deriv()

static void sirius::compute_inv_sqrt_O_deriv ( la::dmatrix< std::complex< double > > &  O_deriv__,
la::dmatrix< std::complex< double > > &  evec_O__,
std::vector< double > &  eval_O__,
int  nawf__ 
)
static

Definition at line 112 of file hubbard_occupancies_derivatives.cpp.

◆ generate_potential_collinear_nonlocal()

static void sirius::generate_potential_collinear_nonlocal ( Simulation_context const &  ctx__,
const int  index__,
sddk::mdarray< std::complex< double >, 3 > const &  om__,
sddk::mdarray< std::complex< double >, 3 > &  um__ 
)
static

Definition at line 32 of file hubbard_potential_energy.cpp.

◆ generate_potential_collinear_local()

static void sirius::generate_potential_collinear_local ( Simulation_context const &  ctx__,
Atom_type const &  atom_type__,
const int  idx_hub_wf,
sddk::mdarray< std::complex< double >, 3 > const &  om__,
sddk::mdarray< std::complex< double >, 3 > &  um__ 
)
static

Definition at line 54 of file hubbard_potential_energy.cpp.

◆ calculate_energy_collinear_nonlocal()

static double sirius::calculate_energy_collinear_nonlocal ( Simulation_context const &  ctx__,
const int  index__,
sddk::mdarray< std::complex< double >, 3 > const &  om__ 
)
static

Definition at line 165 of file hubbard_potential_energy.cpp.

◆ calculate_energy_collinear_local()

static double sirius::calculate_energy_collinear_local ( Simulation_context const &  ctx__,
Atom_type const &  atom_type__,
const int  idx_hub_wf,
sddk::mdarray< std::complex< double >, 3 > const &  om__ 
)
static

Definition at line 192 of file hubbard_potential_energy.cpp.

◆ generate_potential_non_collinear_local()

static void sirius::generate_potential_non_collinear_local ( Simulation_context const &  ctx__,
Atom_type const &  atom_type__,
const int  idx_hub_wf,
sddk::mdarray< std::complex< double >, 3 > const &  om__,
sddk::mdarray< std::complex< double >, 3 > &  um__ 
)
static

Definition at line 327 of file hubbard_potential_energy.cpp.

◆ calculate_energy_non_collinear_local()

static double sirius::calculate_energy_non_collinear_local ( Simulation_context const &  ctx__,
Atom_type const &  atom_type__,
const int  idx_hub_wf,
sddk::mdarray< std::complex< double >, 3 > const &  om__ 
)
static

Definition at line 417 of file hubbard_potential_energy.cpp.

◆ wave_function_factory()

template<typename T >
auto sirius::wave_function_factory ( Simulation_context const &  ctx__,
K_point< T > const &  kp__,
wf::num_bands  num_wf__,
wf::num_mag_dims  num_md__,
bool  mt_part__ 
)
inline

Definition at line 766 of file k_point.hpp.

◆ bisection_search()

template<class F >
double sirius::bisection_search ( F &&  f,
double  a,
double  b,
double  tol,
int  maxstep = 1000 
)

Definition at line 165 of file k_point_set.cpp.

◆ newton_minimization_chemical_potential()

template<class Nt , class DNt , class D2Nt >
auto sirius::newton_minimization_chemical_potential ( Nt &&  N,
DNt &&  dN,
D2Nt &&  ddN,
double  mu0,
double  ne,
double  tol,
int  maxstep = 1000 
)

Newton minimization to determine the chemical potential.

Parameters
Nnumber of electrons as a function of \(\mu\)
dN\(\partial_\mu N(\mu)\)
ddN\(\partial^2_\mu N(\mu)\)
mu0initial guess
netarget number of electrons
toltolerance
maxstepmax number of Newton iterations

Definition at line 207 of file k_point_set.cpp.

◆ generate_alm_block()

template<bool conjugate, typename T >
auto sirius::generate_alm_block ( Simulation_context const &  ctx__,
int  atom_begin__,
int  num_atoms__,
Matching_coefficients const &  alm__ 
)

Generate matching coefficients for a block of atoms.

Definition at line 11 of file generate_alm_block.hpp.

◆ generate_gvec_ylm()

auto sirius::generate_gvec_ylm ( Simulation_context const &  ctx__,
int  lmax__ 
)
inline

Generate complex spherical harmonics for the local set of G-vectors.

Definition at line 32 of file generate_gvec_ylm.hpp.

◆ generate_sbessel_mt()

auto sirius::generate_sbessel_mt ( Simulation_context const &  ctx__,
int  lmax__ 
)
inline

Compute values of spherical Bessel functions at MT boundary.

Definition at line 32 of file generate_sbessel_mt.hpp.

◆ unit_step_function_form_factors()

double sirius::unit_step_function_form_factors ( double  R__,
double  g__ 
)
inline

Utility function to generate LAPW unit step function.

Definition at line 34 of file step_function.hpp.

◆ init_step_function()

auto sirius::init_step_function ( Unit_cell const &  uc__,
fft::Gvec const &  gv__,
fft::Gvec_fft const &  gvec_fft__,
sddk::mdarray< std::complex< double >, 2 > const &  phase_factors_t__,
fft::spfft_transform_type< double >  spfft__ 
)
inline

Unit step function is defined to be 1 in the interstitial and 0 inside muffin-tins.

Unit step function is constructed from it's plane-wave expansion coefficients which are computed analytically:

\[ \Theta({\bf r}) = \sum_{\bf G} \Theta({\bf G}) e^{i{\bf Gr}}, \]

where

\[ \Theta({\bf G}) = \frac{1}{\Omega} \int \Theta({\bf r}) e^{-i{\bf Gr}} d{\bf r} = \frac{1}{\Omega} \int_{\Omega} e^{-i{\bf Gr}} d{\bf r} - \frac{1}{\Omega} \int_{MT} e^{-i{\bf Gr}} d{\bf r} = \delta_{\bf G, 0} - \sum_{\alpha} \frac{1}{\Omega} \int_{MT_{\alpha}} e^{-i{\bf Gr}} d{\bf r} \]

Integralof a plane-wave over the muffin-tin volume is taken using the spherical expansion of the plane-wave around central point \( \tau_{\alpha} \):

\[ \int_{MT_{\alpha}} e^{-i{\bf Gr}} d{\bf r} = e^{-i{\bf G\tau_{\alpha}}} \int_{MT_{\alpha}} 4\pi \sum_{\ell m} (-i)^{\ell} j_{\ell}(Gr) Y_{\ell m}(\hat {\bf G}) Y_{\ell m}^{*}(\hat {\bf r}) r^2 \sin \theta dr d\phi d\theta \]

In the above integral only \( \ell=m=0 \) term survives. So we have:

\[ \int_{MT_{\alpha}} e^{-i{\bf Gr}} d{\bf r} = 4\pi e^{-i{\bf G\tau_{\alpha}}} \Theta(\alpha, G) \]

where

\[ \Theta(\alpha, G) = \int_{0}^{R_{\alpha}} \frac{\sin(Gr)}{Gr} r^2 dr = \left\{ \begin{array}{ll} \displaystyle R_{\alpha}^3 / 3 & G=0 \\ \Big( \sin(GR_{\alpha}) - GR_{\alpha}\cos(GR_{\alpha}) \Big) / G^3 & G \ne 0 \end{array} \right. \]

are the so-called step function form factors. With this we have a final expression for the plane-wave coefficients of the unit step function:

\[ \Theta({\bf G}) = \delta_{\bf G, 0} - \sum_{\alpha} \frac{4\pi}{\Omega} e^{-i{\bf G\tau_{\alpha}}} \Theta(\alpha, G) \]

Definition at line 87 of file step_function.hpp.

◆ sum_fg_fl_yg()

auto sirius::sum_fg_fl_yg ( Simulation_context const &  ctx__,
int  lmax__,
std::complex< double > const *  fpw__,
sddk::mdarray< double, 3 > &  fl__,
sddk::matrix< std::complex< double > > &  gvec_ylm__ 
)
inline

Compute sum over plane-wave coefficients and spherical harmonics that apperas in Poisson solver and finding of the MT boundary values. The following operation is performed:

\[ q_{\ell m}^{\alpha} = \sum_{\bf G} 4\pi \rho({\bf G}) e^{i{\bf G}{\bf r}_{\alpha}}i^{\ell}f_{\ell}^{\alpha}(G) Y_{\ell m}^{*}(\hat{\bf G}) \]

Definition at line 39 of file sum_fg_fl_yg.hpp.

◆ make_matrix_view()

template<class numeric_t >
auto sirius::make_matrix_view ( nlcglib::buffer_protocol< numeric_t, 2 > &  buf)

Definition at line 228 of file adaptor.hpp.

◆ apply_hamiltonian()

void sirius::apply_hamiltonian ( Hamiltonian0< double > &  H0,
K_point< double > &  kp,
wf::Wave_functions< double > &  wf_out,
wf::Wave_functions< double > &  wf,
std::shared_ptr< wf::Wave_functions< double > >  swf 
)
inline

Definition at line 38 of file apply_hamiltonian.hpp.

◆ call_nlcg()

void sirius::call_nlcg ( Simulation_context ctx,
config_t::nlcg_t const &  nlcg_params,
Energy energy,
K_point_set kset,
Potential potential 
)
inline

Definition at line 39 of file call_nlcg.hpp.

◆ check_xc_potential()

void sirius::check_xc_potential ( Density const &  rho__)

Definition at line 30 of file check_xc_potential.cpp.

◆ xc_mt_paw()

double sirius::xc_mt_paw ( std::vector< XC_functional > const &  xc_func__,
int  lmax__,
int  num_mag_dims__,
SHT const &  sht__,
Radial_grid< double > const &  rgrid__,
std::vector< Flm const * >  rho__,
std::vector< double > const &  rho_core__,
std::vector< Flm > &  vxc__,
Flm exclm__ 
)

Definition at line 123 of file paw_potential.cpp.

◆ density_residual_hartree_energy()

double sirius::density_residual_hartree_energy ( Density const &  rho1__,
Density const &  rho2__ 
)

Definition at line 31 of file poisson.cpp.

◆ xc_mt()

double sirius::xc_mt ( Radial_grid< double > const &  rgrid__,
SHT const &  sht__,
std::vector< XC_functional > const &  xc_func__,
int  num_mag_dims__,
std::vector< Flm const * >  rho__,
std::vector< Flm * >  vxc__,
Flm exc__ 
)

Definition at line 276 of file xc_mt.cpp.

◆ xc_mt_nonmagnetic()

void sirius::xc_mt_nonmagnetic ( Radial_grid< double > const &  rgrid__,
SHT const &  sht__,
std::vector< XC_functional > const &  xc_func__,
Flm const &  rho_lm__,
Ftp rho_tp__,
Flm vxc_lm__,
Flm exc_lm__ 
)

Definition at line 35 of file xc_mt.cpp.

◆ xc_mt_magnetic()

void sirius::xc_mt_magnetic ( Radial_grid< double > const &  rgrid__,
SHT const &  sht__,
int  num_mag_dims__,
std::vector< XC_functional > const &  xc_func__,
std::vector< Ftp > const &  rho_tp__,
std::vector< Flm * >  vxc__,
Flm exc__ 
)

Definition at line 126 of file xc_mt.cpp.

◆ Radial_grid_factory()

template<typename T >
Radial_grid< T > sirius::Radial_grid_factory ( radial_grid_t  grid_type__,
int  num_points__,
rmin__,
rmax__,
double  p__ 
)

Definition at line 321 of file radial_grid.hpp.

◆ get_radial_grid_t()

std::pair< radial_grid_t, double > sirius::get_radial_grid_t ( std::string  str__)
inline

Definition at line 349 of file radial_grid.hpp.

◆ operator*() [5/5]

template<typename T , typename U = double>
Spline< T, U > sirius::operator* ( Spline< T, U > const &  a__,
Spline< T, U > const &  b__ 
)
inline

Definition at line 623 of file spline.hpp.

◆ inner() [7/8]

template<typename T >
T sirius::inner ( Spline< T > const &  f__,
Spline< T > const &  g__,
int  m__,
int  num_points__ 
)

Definition at line 657 of file spline.hpp.

◆ inner() [8/8]

template<typename T >
T sirius::inner ( Spline< T > const &  f__,
Spline< T > const &  g__,
int  m__ 
)

Definition at line 786 of file spline.hpp.

◆ is_initialized()

static bool & sirius::is_initialized ( )
inlinestatic

Return the status of the library (initialized or not).

Definition at line 61 of file sirius.hpp.

◆ initialize()

void sirius::initialize ( bool  call_mpi_init__ = true)
inline

Initialize the library.

Definition at line 82 of file sirius.hpp.

◆ finalize()

void sirius::finalize ( bool  call_mpi_fin__ = true,
bool  reset_device__ = true,
bool  fftw_cleanup__ = true 
)
inline

Shut down the library.

Definition at line 143 of file sirius.hpp.

◆ check_gvec() [1/2]

void sirius::check_gvec ( fft::Gvec const &  gvec__,
Crystal_symmetry const &  sym__ 
)
inline

Definition at line 32 of file check_gvec.hpp.

◆ check_gvec() [2/2]

void sirius::check_gvec ( fft::Gvec_shells const &  gvec_shells__,
Crystal_symmetry const &  sym__ 
)
inline

Definition at line 87 of file check_gvec.hpp.

◆ find_sym_atom()

static std::pair< std::vector< int >, std::vector< r3::vector< int > > > sirius::find_sym_atom ( int  num_atoms__,
sddk::mdarray< double, 2 > const &  positions__,
r3::matrix< int > const &  R__,
r3::vector< double > const &  t__,
double  tolerance__,
bool  inverse__ = false 
)
static

Definition at line 34 of file crystal_symmetry.cpp.

◆ get_spg_sym_op()

static space_group_symmetry_descriptor sirius::get_spg_sym_op ( int  isym_spg__,
SpglibDataset *  spg_dataset__,
r3::matrix< double > const &  lattice_vectors__,
int  num_atoms__,
sddk::mdarray< double, 2 > const &  positions__,
double  tolerance__ 
)
static

Definition at line 83 of file crystal_symmetry.cpp.

◆ get_identity_spg_sym_op()

static space_group_symmetry_descriptor sirius::get_identity_spg_sym_op ( int  num_atoms__)
static

Definition at line 157 of file crystal_symmetry.cpp.

◆ get_irreducible_reciprocal_mesh()

std::tuple< int, std::vector< double >, std::vector< std::array< double, 3 > > > sirius::get_irreducible_reciprocal_mesh ( Crystal_symmetry const &  sym__,
r3::vector< int >  k_mesh__,
r3::vector< int >  is_shift__ 
)
inline

Definition at line 33 of file get_irreducible_reciprocal_mesh.hpp.

◆ metric_tensor()

auto sirius::metric_tensor ( r3::matrix< double > const &  lat_vec__)
inline

Compute a metric tensor.

Definition at line 36 of file lattice.hpp.

◆ metric_tensor_error()

double sirius::metric_tensor_error ( r3::matrix< double > const &  lat_vec__,
r3::matrix< int > const &  R__ 
)
inline

Compute error of the symmetry-transformed metric tensor.

Definition at line 43 of file lattice.hpp.

◆ find_lat_sym()

auto sirius::find_lat_sym ( r3::matrix< double > const &  lat_vec__,
double  tol__,
double *  mt_error__ = nullptr 
)
inline

Definition at line 58 of file lattice.hpp.

◆ phi_by_sin_cos()

double sirius::phi_by_sin_cos ( double  sinp,
double  cosp 
)
inline

Return angle phi in the range [0, 2Pi) by its values of sin(phi) and cos(phi).

Definition at line 36 of file rotation.hpp.

◆ rotation_matrix_su2() [1/2]

auto sirius::rotation_matrix_su2 ( std::array< double, 3 >  u__,
double  theta__ 
)
inline

Generate SU(2) rotation matrix from the axes and angle.

Definition at line 48 of file rotation.hpp.

◆ rotation_matrix_su2() [2/2]

auto sirius::rotation_matrix_su2 ( r3::matrix< double >  R__)
inline

Generate SU2(2) rotation matrix from a 3x3 rotation matrix in Cartesian coordinates.

Create quaternion components from the 3x3 matrix. The components are just a w = Cos(\Omega/2) and {x,y,z} = unit rotation vector multiplied by Sin(\Omega/2)

See https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation and https://en.wikipedia.org/wiki/Rotation_group_SO(3)#Quaternions_of_unit_norm

Definition at line 70 of file rotation.hpp.

◆ axis_angle()

auto sirius::axis_angle ( r3::matrix< double >  R__)
inline

Get axis and angle from rotation matrix.

Definition at line 100 of file rotation.hpp.

◆ rot_mtrx_cart()

auto sirius::rot_mtrx_cart ( r3::vector< double >  euler_angles__)
inline

Generate rotation matrix from three Euler angles.

Euler angles \( \alpha, \beta, \gamma \) define the general rotation as three consecutive rotations:

  • about \( \hat e_z \) through the angle \( \gamma \) ( \( 0 \le \gamma < 2\pi \))
  • about \( \hat e_y \) through the angle \( \beta \) ( \( 0 \le \beta \le \pi \))
  • about \( \hat e_z \) through the angle \( \alpha \) ( \( 0 \le \gamma < 2\pi \))

The total rotation matrix is defined as a product of three rotation matrices:

\[ R(\alpha, \beta, \gamma) = \left( \begin{array}{ccc} \cos(\alpha) & -\sin(\alpha) & 0 \\ \sin(\alpha) & \cos(\alpha) & 0 \\ 0 & 0 & 1 \end{array} \right) \left( \begin{array}{ccc} \cos(\beta) & 0 & \sin(\beta) \\ 0 & 1 & 0 \\ -\sin(\beta) & 0 & \cos(\beta) \end{array} \right) \left( \begin{array}{ccc} \cos(\gamma) & -\sin(\gamma) & 0 \\ \sin(\gamma) & \cos(\gamma) & 0 \\ 0 & 0 & 1 \end{array} \right) = \left( \begin{array}{ccc} \cos(\alpha) \cos(\beta) \cos(\gamma) - \sin(\alpha) \sin(\gamma) & -\sin(\alpha) \cos(\gamma) - \cos(\alpha) \cos(\beta) \sin(\gamma) & \cos(\alpha) \sin(\beta) \\ \sin(\alpha) \cos(\beta) \cos(\gamma) + \cos(\alpha) \sin(\gamma) & \cos(\alpha) \cos(\gamma) - \sin(\alpha) \cos(\beta) \sin(\gamma) & \sin(\alpha) \sin(\beta) \\ -\sin(\beta) \cos(\gamma) & \sin(\beta) \sin(\gamma) & \cos(\beta) \end{array} \right) \]

Definition at line 174 of file rotation.hpp.

◆ euler_angles()

auto sirius::euler_angles ( r3::matrix< double > const &  rot__,
double  tolerance__ 
)
inline

Compute Euler angles corresponding to the proper rotation matrix.

Definition at line 196 of file rotation.hpp.

◆ apply_symmetry_to_density_matrix()

void sirius::apply_symmetry_to_density_matrix ( sddk::mdarray< std::complex< double >, 3 > const &  dm_ia__,
basis_functions_index const &  indexb__,
const int  num_mag_comp__,
std::vector< sddk::mdarray< double, 2 > > const &  rotm__,
sddk::mdarray< std::complex< double >, 2 > const &  spin_rot_su2__,
sddk::mdarray< std::complex< double >, 3 > &  dm_ja__ 
)
inline

Definition at line 33 of file symmetrize_density_matrix.hpp.

◆ symmetrize_density_matrix()

void sirius::symmetrize_density_matrix ( Unit_cell const &  uc__,
density_matrix_t dm__,
int  num_mag_comp__ 
)
inline

Symmetrize density matrix.

Density matrix arises in LAPW or PW methods. In PW it is computed in the basis of beta-projectors. Occupancy matrix is computed for the Hubbard-U correction. In both cases the matrix has the same structure and is symmetrized in the same way The symmetrization does depend explicitly on the beta or wfc. The last parameter is on when the atom has spin-orbit coupling and hubbard correction in that case, we must skip half of the indices because of the averaging of the radial integrals over the total angular momentum

We start from the spectral represntation of the occupancy operator defined for the irreducible Brillouin zone:

\[ \hat N_{IBZ} = \sum_{j} \sum_{{\bf k}}^{IBZ} | \Psi_{j{\bf k}}^{\sigma} \rangle w_{\bf k} n_{j{\bf k}} \langle \Psi_{j{\bf k}}^{\sigma'} | \]

and a set of localized orbitals with the pure angular character (this can be LAPW functions, beta-projectors or localized Hubbard orbitals) :

\[ |\phi_{\ell m}^{\alpha {\bf T}}\rangle \]

The orbitals are labeled by the angular and azimuthal quantum numbers ( \( \ell m \)), atom index ( \( \alpha \)) and a lattice translation vector ( \( {\bf T} \)) such that:

\[ \langle {\bf r} | \phi_{\ell m}^{\alpha {\bf T}} \rangle = \phi_{\ell m}({\bf r - r_{\alpha} - T}) \]

There might be several localized orbitals per atom. We wish to compute the symmetrized occupation matrix:

\[ n_{\ell m \alpha {\bf T} \sigma, \ell' m' \alpha' {\bf T}' \sigma'} = \langle \phi_{\ell m}^{\alpha {\bf T}} | \hat N | \phi_{\ell' m'}^{\alpha' {\bf T'}} \rangle = \sum_{\bf P} \sum_{j} \sum_{{\bf k}}^{IBZ} \langle \phi_{\ell m}^{\alpha {\bf T}} | \hat{\bf P} \Psi_{j{\bf k}}^{\sigma} \rangle w_{\bf k} n_{j{\bf k}} \langle \hat{\bf P} \Psi_{j{\bf k}}^{\sigma'} | \phi_{\ell' m'}^{\alpha' {\bf T'}} \rangle \]

Let's now label the overlap integrals between localized orbitals and KS wave-functions:

\[ A_{\ell m j{\bf k}}^{\alpha {\bf T} \sigma} = \langle \Psi_{j{\bf k}}^{\sigma} | \phi_{\ell m}^{\alpha {\bf T}} \rangle = \int \Psi_{j{\bf k}}^{\sigma *}({\bf r}) \phi_{\ell m}({\bf r} - {\bf r}_{\alpha} - {\bf T}) d{\bf r} \]

and check how it transforms under the symmetry operation \( \hat {\bf P} = \{ {\bf R} | {\bf t} \} \) applied to the KS states.

\[ \int \big( \hat {\bf P}\Psi_{j {\bf k}}^{\sigma *}({\bf r}) \big) \phi_{\ell m}({\bf r} - {\bf r}_{\alpha} - {\bf T}) d{\bf r} = \int \Psi_{j {\bf k}}^{\sigma *}({\bf r}) \big( \hat {\bf P}^{-1} \phi_{\ell m}({\bf r} - {\bf r}_{\alpha} - {\bf T}) \big) d{\bf r} \]

Let's first derive how the inverse symmetry operation acts on the localized orbital centered on the atom inside a unit cell (no T):

\[ \hat {\bf P}^{-1} \phi\big( {\bf r} - {\bf r}_{\alpha} \big) = \phi\big( {\bf R} {\bf r} + {\bf t} - {\bf r}_{\alpha} \big) = \\ \phi\big( {\bf R}({\bf r} - {\bf R}^{-1}({\bf r}_{\alpha} - {\bf t})) \big) = \tilde \phi \big( {\bf r} - {\bf R}^{-1}({\bf r}_{\alpha} - {\bf t}) \big) \]

This operation rotates the orbital and centers it at the position

\[ {\bf r}_{\beta} = {\bf R}^{-1}{\bf r}_{\alpha} - {\bf R}^{-1}{\bf t} = \hat {\bf P}^{-1}{\bf r}_{\alpha} \]

For example, suppose thar we have y-orbital centered at \( {\bf r}_{\alpha} = [1, 0] \) (black dot) and a symmetry operation \( \hat {\bf P} = \{ {\bf R} | {\bf t} \} \) that rotates by \( \pi/2 \) counterclockwise and translates by [1/2, 1/2]:

Under this symmetry operation the atom coordinate will transform into [1/2, 3/2] (red dot), but this is not(!) how the orbital is transformed. The origin of the atom will transform according to the inverse of \( \hat {\bf P} \) into \( {\bf r}_{\beta} = [-1/2, -1/2] \) (blue dot) such that \( \hat {\bf P} {\bf r}_{\beta} = {\bf r}_{\alpha} \):

To be more precise, we should highlight that the transformed atom coordinate can go out of the original unit cell and can be brought back with a translation vector:

\[ \hat {\bf P}^{-1}{\bf r}_{\alpha} = {\bf r}_{\beta} + {\bf T}_{P\alpha\beta} \]

Now let's derive how the inverse symmetry operation acts on the localized orbital \( \phi({\bf r}) \) centered on atom in the arbitrary unit cell:

\[ \hat {\bf P}^{-1} \phi\big( {\bf r} - {\bf r}_{\alpha} - {\bf T} \big) = \phi\big( {\bf R} {\bf r} + {\bf t} - {\bf r}_{\alpha} - {\bf T} \big) = \\ \phi\big( {\bf R}({\bf r} - {\bf R}^{-1}({\bf r}_{\alpha} + {\bf T} - {\bf t})) \big) = \tilde \phi\big( {\bf r} - {\bf R}^{-1}({\bf r}_{\alpha} + {\bf T} - {\bf t}) \big) = \tilde \phi\big( {\bf r} - {\bf r}_{\beta} - {\bf T}_{P\alpha\beta} - {\bf R}^{-1}{\bf T} \big) \]

Now let's check how the atomic orbitals transfrom under the rotational part of the symmetry operation. The atomic functions of ( \( \ell m \)) character is expressed as a product of radial function and a spherical harmonic:

\[ \phi_{\ell m}({\bf r}) = \phi_{\ell}(r) Y_{\ell m}(\theta, \phi) \]

Under rotation the spherical harmonic is transformed as:

\[ Y_{\ell m}({\bf P} \hat{\bf r}) = {\bf P}^{-1}Y_{\ell m}(\hat {\bf r}) = \sum_{m'} D_{m'm}^{\ell}({\bf P}^{-1}) Y_{\ell m'}(\hat {\bf r}) = \sum_{m'} D_{mm'}^{\ell}({\bf P}) Y_{\ell m'}(\hat {\bf r}) \]

so

\[ \tilde \phi_{\ell m}({\bf r}) =\hat {\bf P}^{-1} \phi_{\ell}(r) Y_{\ell m}(\theta, \phi) = \sum_{m'} D_{mm'}^{\ell}({\bf P}) \phi_{\ell}(r) Y_{\ell m'}(\theta, \phi) \]

We will use Bloch theorem to get rid of the translations in the argument of \( \tilde \phi \):

\[ \int \Psi_{j {\bf k}}^{\sigma *}({\bf r}) \tilde \phi_{\ell m} \big( {\bf r} - {\bf r}_{\beta} - {\bf T}_{P\alpha\beta} - {\bf R}^{-1}{\bf T} \big) d{\bf r} = e^{-i{\bf k}({\bf T}_{P\alpha\beta} + {\bf R}^{-1}{\bf T})} \int \Psi_{j {\bf k}}^{\sigma *}({\bf r}) \tilde \phi_{\ell m} \big( {\bf r} - {\bf r}_{\beta} \big) d{\bf r} \]

(the "-" in the phase factor appears because KS wave-functions are complex conjugate) and now we can write

\[ A_{\ell m j\hat {\bf P}{\bf k}}^{\alpha {\bf T} \sigma} = e^{-i{\bf k}({\bf T}_{P\alpha\beta} + {\bf R}^{-1}{\bf T})} \sum_{m'} D_{mm'}^{\ell}({\bf P}) A_{\ell m' j{\bf k}}^{\beta \sigma} \]

The final expression for the symmetrized matrix is then

\[ n_{\ell m \alpha {\bf T} \sigma, \ell' m' \alpha' {\bf T}' \sigma'} = \sum_{\bf P} \sum_{j} \sum_{{\bf k}}^{IBZ} A_{\ell m j\hat {\bf P}{\bf k}}^{\alpha {\bf T} \sigma *} w_{\bf k} n_{j{\bf k}} A_{\ell' m' j\hat {\bf P}{\bf k}}^{\alpha' {\bf T'} \sigma'} = \\ = \sum_{\bf P} \sum_{j} \sum_{{\bf k}}^{IBZ} e^{i{\bf k}({\bf T}_{P\alpha\beta} + {\bf R}^{-1}{\bf T})} e^{-i{\bf k}({\bf T}_{P\alpha'\beta'} + {\bf R}^{-1}{\bf T'})} \sum_{m_1 m_2} D_{mm_1}^{\ell *}({\bf P}) D_{m'm_2}^{\ell'}({\bf P}) A_{\ell m_1 j{\bf k}}^{\beta \sigma *} A_{\ell' m_2 j{\bf k}}^{\beta' \sigma'} w_{\bf k} n_{j{\bf k}} \]

In the case of \( \alpha = \alpha' \) and \( {\bf T}={\bf T}' \) all the phase-factor exponents disappear and we get an expression for the "on-site" occupation matrix:

\[ n_{\ell m \sigma, \ell' m' \sigma'}^{\alpha} = \sum_{\bf P} \sum_{j} \sum_{{\bf k}}^{IBZ} \sum_{m_1 m_2} D_{mm_1}^{\ell *}({\bf P}) D_{m'm_2}^{\ell'}({\bf P}) A_{\ell m_1 j{\bf k}}^{\beta \sigma *} A_{\ell' m_2 j{\bf k}}^{\beta \sigma'} w_{\bf k} n_{j{\bf k}} = \\ = \sum_{\bf P} \sum_{m_1 m_2} D_{mm_1}^{\ell *}({\bf P}) D_{m'm_2}^{\ell'}({\bf P}) \tilde n_{\ell m_1 \sigma, \ell' m_2 \sigma'}^{\beta} \]

To compute the overlap integrals between KS wave-functions and localized Hubbard orbitals we insert resolution of identity (in \( {\bf G+k} \) planve-waves) between bra and ket:

\[ \langle \phi_{\ell m}^{\alpha} | \Psi_{j{\bf k}}^{\sigma} \rangle = \sum_{\bf G} \phi_{\ell m}^{\alpha *}({\bf G+k}) \Psi_{j}^{\sigma}({\bf G+k}) \]

Definition at line 258 of file symmetrize_density_matrix.hpp.

◆ symmetrize_field4d()

void sirius::symmetrize_field4d ( Field4D f__)
inline

Definition at line 35 of file symmetrize_field4d.hpp.

◆ symmetrize_forces()

void sirius::symmetrize_forces ( Unit_cell const &  uc__,
sddk::mdarray< double, 2 > &  f__ 
)
inline

Definition at line 33 of file symmetrize_forces.hpp.

◆ symmetrize_mt_function()

template<typename Index_t >
void sirius::symmetrize_mt_function ( Crystal_symmetry const &  sym__,
mpi::Communicator const &  comm__,
int  num_mag_dims__,
std::vector< Spheric_function_set< double, Index_t > * >  frlm__ 
)
inline

Definition at line 35 of file symmetrize_mt_function.hpp.

◆ symmetrize_occupation_matrix()

void sirius::symmetrize_occupation_matrix ( Occupation_matrix om__)
inline

Definition at line 33 of file symmetrize_occupation_matrix.hpp.

◆ symmetrize_pw_function()

void sirius::symmetrize_pw_function ( Crystal_symmetry const &  sym__,
fft::Gvec_shells const &  gvec_shells__,
sddk::mdarray< std::complex< double >, 3 > const &  sym_phase_factors__,
int  num_mag_dims__,
std::vector< Smooth_periodic_function< double > * >  frg__ 
)
inline

Symmetrize scalar or vector function.

The following operation is performed:

\[ f_{\mathrm{sym}}({\bf r}) = \frac{1}{N_{\mathrm{sym}}} \sum_{\hat{\bf S}\hat{\bf P}} \hat {\bf S} \hat {\bf P}f({\bf r}) \]

where \( f({\bf r}) \) has to be understood as an unsymmetrized scalar or vector function. In the case of a scalar function \( \hat {\bf S} = 1 \). In the case of vector function \( \hat {\bf S} \) is rotation matrix acting on the Cartesian components of the function. \( \hat {\bf P} = \{{\bf R}|{\bf t}\} \) is a spacial part of the full magentic symmetry operatoin acting on the real-space coordinates.

For the function expanded in plane-waves we have:

\[ f_{\mathrm{sym}}({\bf r}) = \frac{1}{N_{\mathrm{sym}}} \sum_{\hat{\bf S}\hat{\bf P}} \hat {\bf S} \hat {\bf P}f({\bf r}) = \frac{1}{N_{\mathrm{sym}}} \sum_{\hat{\bf S}\hat{\bf P}} \hat {\bf S} \sum_{\bf G} f({\bf G}) e^{i{\bf G}\hat{\bf P}^{-1}{\bf r}} = \\ \frac{1}{N_{\mathrm{sym}}} \sum_{\hat{\bf S}\hat{\bf P}} \sum_{\bf G} \hat {\bf S} f({\bf G}) e^{i{\bf G}({\bf R}^{-1}{\bf r} - {\bf R}^{-1}{\bf t})} = \frac{1}{N_{\mathrm{sym}}} \sum_{\hat{\bf S}\hat{\bf P}} \sum_{\bf G} \hat {\bf S} f({\bf G}) e^{i{\bf G}'{\bf r}} e^{-i{\bf G}'{\bf t}} \]

where \( {\bf G}' = {\bf G}{\bf R}^{-1} = {\bf R}^{-T}{\bf G} \). The last expression establishes the link between unsymmetrized plane-wave coefficient at G-vector and symmetrized coefficient at G'. We will rewrite the expression using inverse relation \( {\bf G} = {\bf R}^{T}{\bf G'} \) and summing over G' (which is just a permutaion of G):

\[ f_{\mathrm{sym}}({\bf r}) = \sum_{\bf G'} e^{i{\bf G}'{\bf r}} \frac{1}{N_{\mathrm{sym}}} \sum_{\hat{\bf S}\hat{\bf P}} \hat {\bf S} f({\bf R}^{T}{\bf G'}) e^{-i{\bf G}'{\bf t}} \]

That gives an expression for the symmetrized plane-wave coefficient at G':

\[ f_{\mathrm{sym}}({\bf G}') = \frac{1}{N_{\mathrm{sym}}} \sum_{\hat{\bf S}\hat{\bf P}} \hat {\bf S} f({\bf R}^{T}{\bf G'}) e^{-i{\bf G}'{\bf t}} \]

Once \( f_{\mathrm{sym}}({\bf G}) \) has been calculated for a single G, its values at a star of G can be calculated using the following relation:

\[ f_{\mathrm{sym}}({\bf r}) = \hat{\bf S}\hat{\bf P} f_{\mathrm{sym}}({\bf r}) = \hat{\bf S} f_{\mathrm{sym}}(\hat {\bf P}^{-1}{\bf r}) \]

which leads to the following relation for the plane-wave coefficient:

\[ \sum_{\bf G} f_{\mathrm{sym}}({\bf G})e^{i{\bf G}{\bf r}} = \sum_{\bf G} \hat{\bf S}f_{\mathrm{sym}}({\bf G})e^{i{\bf G}\hat{\bf P}^{-1}{\bf r}} = \sum_{\bf G} \hat{\bf S}f_{\mathrm{sym}}({\bf G})e^{i{\bf G}{\bf R}^{-1}{\bf r}} e^{-i{\bf G}{\bf R}^{-1}{\bf t}} = \sum_{\bf G'} \hat{\bf S}f_{\mathrm{sym}}({\bf G})e^{i{\bf G}'{\bf r}} e^{-i{\bf G}'{\bf t}} = \sum_{\bf G'} \hat{\bf S}f_{\mathrm{sym}}({\bf G'})e^{i{\bf G}'{\bf r}} \]

and so

\[ f_{\mathrm{sym}}({\bf G}') = \hat{\bf S}f_{\mathrm{sym}}({\bf G})e^{-i{\bf G'}{\bf t}} \]

Parameters
[in]symDescription of the crystal symmetry.
[in]gvec_shellsDescription of the G-vector shells.
[in]sym_phase_factorsPhase factors associated with fractional translations.
[in]num_mag_dimsNumber of magnetic dimensions.
[in,out]frgArray of pointers to scalar and vector parts of the filed being symmetrized.

Definition at line 99 of file symmetrize_pw_function.hpp.

◆ symmetrize_stress_tensor()

void sirius::symmetrize_stress_tensor ( Crystal_symmetry const &  sym__,
r3::matrix< double > &  s__ 
)
inline

Definition at line 33 of file symmetrize_stress_tensor.hpp.

◆ call_test() [1/2]

template<typename F >
int sirius::call_test ( std::string  label__,
F &&  f__ 
)
inline

Definition at line 43 of file testing.hpp.

◆ call_test() [2/2]

template<typename F >
int sirius::call_test ( std::string  label__,
F &&  f__,
cmd_args const &  args__ 
)
inline

Definition at line 71 of file testing.hpp.

◆ random_symmetric()

template<typename T >
auto sirius::random_symmetric ( int  N__,
int  bs__,
la::BLACS_grid const &  blacs_grid__ 
)
inline

Definition at line 111 of file testing.hpp.

◆ random_positive_definite()

template<typename T >
auto sirius::random_positive_definite ( int  N__,
int  bs__ = 16,
la::BLACS_grid const *  blacs_grid__ = nullptr 
)
inline

Definition at line 148 of file testing.hpp.

◆ create_simulation_context()

auto sirius::create_simulation_context ( nlohmann::json const &  conf__,
r3::matrix< double >  L__,
int  num_atoms__,
std::vector< r3::vector< double > >  coord__,
bool  add_vloc__,
bool  add_dion__ 
)
inline

Definition at line 181 of file testing.hpp.

◆ randomize()

template<typename T >
void sirius::randomize ( wf::Wave_functions< T > &  wf__)
inline

Definition at line 262 of file testing.hpp.

◆ operator<<() [5/7]

std::ostream & sirius::operator<< ( std::ostream &  out,
ps_atomic_wf_descriptor const &  wfd 
)
inline

Definition at line 80 of file atom_type.hpp.

◆ begin() [2/3]

auto sirius::begin ( basis_functions_index const &  idx__)
inline

Definition at line 195 of file basis_functions_index.hpp.

◆ end() [2/3]

auto sirius::end ( basis_functions_index const &  idx__)
inline

Definition at line 200 of file basis_functions_index.hpp.

◆ operator<<() [6/7]

std::ostream & sirius::operator<< ( std::ostream &  out,
hubbard_orbital_descriptor const &  ho 
)
inline

Definition at line 353 of file hubbard_orbitals_descriptor.hpp.

◆ operator==()

bool sirius::operator== ( angular_momentum  lhs__,
angular_momentum  rhs__ 
)
inline

Definition at line 120 of file radial_functions_index.hpp.

◆ operator!=()

bool sirius::operator!= ( angular_momentum  lhs__,
angular_momentum  rhs__ 
)
inline

Definition at line 125 of file radial_functions_index.hpp.

◆ operator<<() [7/7]

std::ostream & sirius::operator<< ( std::ostream &  out,
angular_momentum  am 
)
inline

Output angular momentum to a stream.

Definition at line 131 of file radial_functions_index.hpp.

◆ begin() [3/3]

auto sirius::begin ( radial_functions_index const &  idx__)
inline

Definition at line 437 of file radial_functions_index.hpp.

◆ end() [3/3]

auto sirius::end ( radial_functions_index const &  idx__)
inline

Definition at line 442 of file radial_functions_index.hpp.

Variable Documentation

◆ sirius_integer_type

integer, parameter, public sirius::sirius_integer_type = 1

Definition at line 9 of file sirius.f90.

◆ sirius_logical_type

integer, parameter, public sirius::sirius_logical_type = 2

Definition at line 10 of file sirius.f90.

◆ sirius_string_type

integer, parameter, public sirius::sirius_string_type = 3

Definition at line 11 of file sirius.f90.

◆ sirius_number_type

integer, parameter, public sirius::sirius_number_type = 4

Definition at line 12 of file sirius.f90.

◆ sirius_object_type

integer, parameter, public sirius::sirius_object_type = 5

Definition at line 13 of file sirius.f90.

◆ sirius_array_type

integer, parameter, public sirius::sirius_array_type = 6

Definition at line 14 of file sirius.f90.

◆ sirius_integer_array_type

integer, parameter, public sirius::sirius_integer_array_type = 7

Definition at line 16 of file sirius.f90.

◆ sirius_logical_array_type

integer, parameter, public sirius::sirius_logical_array_type = 8

Definition at line 17 of file sirius.f90.

◆ sirius_number_array_type

integer, parameter, public sirius::sirius_number_array_type = 9

Definition at line 18 of file sirius.f90.

◆ sirius_string_array_type

integer, parameter, public sirius::sirius_string_array_type = 10

Definition at line 19 of file sirius.f90.

◆ sirius_object_array_type

integer, parameter, public sirius::sirius_object_array_type = 11

Definition at line 20 of file sirius.f90.

◆ sirius_array_array_type

integer, parameter, public sirius::sirius_array_array_type = 12

Definition at line 21 of file sirius.f90.

◆ speed_of_light

const double sirius::speed_of_light = 137.035999139

NIST value for the inverse fine structure (http://physics.nist.gov/cuu/Constants/index.html)

Definition at line 33 of file constants.hpp.

◆ bohr_radius

const double sirius::bohr_radius = 0.52917721067

Bohr radius in angstroms.

Definition at line 39 of file constants.hpp.

◆ pi

const double sirius::pi = 3.1415926535897932385

\( \pi \)

Definition at line 42 of file constants.hpp.

◆ twopi

const double sirius::twopi = 6.2831853071795864769

\( 2\pi \)

Definition at line 45 of file constants.hpp.

◆ fourpi

const double sirius::fourpi = 12.566370614359172954

\( 4\pi \)

Definition at line 48 of file constants.hpp.

◆ y00

const double sirius::y00 = 0.28209479177387814347

First spherical harmonic \( Y_{00} = \frac{1}{\sqrt{4\pi}} \).

Definition at line 51 of file constants.hpp.

◆ ha2ev

const double sirius::ha2ev = 27.21138505

Hartree in electron-volt units.

Definition at line 54 of file constants.hpp.

◆ storage_file_name

const char* const sirius::storage_file_name = "sirius.h5"

Definition at line 56 of file constants.hpp.

◆ pauli_matrix

const std::complex<double> sirius::pauli_matrix[4][2][2]
Initial value:
= {
{{1.0, 0.0}, {0.0, 1.0}},
{{1.0, 0.0}, {0.0, -1.0}},
{{0.0, 1.0}, {1.0, 0.0}},
{{0.0, std::complex<double>(0, -1)}, {std::complex<double>(0, 1), 0.0}}}

Pauli matrices in {I, Z, X, Y} order.

Definition at line 59 of file constants.hpp.

◆ global_rtgraph_timer

extern::rt_graph::Timer sirius::global_rtgraph_timer

Definition at line 28 of file profiler.cpp.

◆ is_real_v

template<class T >
constexpr bool sirius::is_real_v = std::is_same<T, real_type<T>>::value
constexpr

Definition at line 53 of file typedefs.hpp.

◆ libxc_functionals

const std::map<std::string, int> sirius::libxc_functionals

Definition at line 39 of file xc_functional_base.hpp.