25#ifndef __DFT_GROUND_STATE_HPP__
26#define __DFT_GROUND_STATE_HPP__
35using json = nlohmann::json;
69 std::shared_ptr<Hamiltonian0<double>>
H0_;
89 if (!
ctx_.full_potential()) {
96 kset_.comm().allreduce(&n, 1);
97 if (
ctx_.verbosity() >= 2) {
98 RTE_OUT(
ctx_.
out()) <<
"local op. applied: " << n << std::endl;
100 double d =
ctx_.evp_work_count();
101 kset_.comm().allreduce(&d, 1);
102 if (
ctx_.verbosity() >= 2) {
103 RTE_OUT(
ctx_.
out()) <<
"evp. work count: " << d << std::endl;
105 n =
ctx_.num_itsol_steps();
106 kset_.comm().allreduce(&n, 1);
107 if (
ctx_.verbosity() >= 2) {
108 RTE_OUT(
ctx_.
out()) <<
"numbef of iterative solver steps: " << n << std::endl;
123 inline Density& density()
128 inline Potential& potential()
133 inline K_point_set& k_point_set()
138 inline Force& forces()
143 inline Stress& stress()
148 inline double ewald_energy()
const
153 inline double scf_correction_energy()
const
160 double total_energy()
const;
169 json find(
double density_tol,
double energy_tol,
double initial_tolerance,
int num_dft_iter,
bool write_state);
174 double energy_kin_sum_pw()
const;
namespace for Niels Lohmann
The whole DFT ground state implementation.
Potential potential_
Instance of the Potential class.
double scf_correction_energy_
Correction to total energy from the SCF density minimisation.
void initial_state()
Generate initial density, potential and a subspace of wave-functions.
void print_info(std::ostream &out__) const
Print the basic information (total energy, charges, moments, etc.).
Force forces_
Atomic forces.
Density density_
Instance of the Density class.
Simulation_context & ctx_
Context of simulation.
K_point_set & kset_
Set of k-points that are used to generate density.
double ewald_energy_
Store Ewald energy which is computed once and which doesn't change during the run.
json find(double density_tol, double energy_tol, double initial_tolerance, int num_dft_iter, bool write_state)
Run the SCF ground state calculation and find a total energy minimum.
Simulation_context const & ctx() const
Return reference to a simulation context.
std::shared_ptr< Hamiltonian0< double > > H0_
k-point independent part of the Hamiltonian.
void update()
Update the parameters after the change of lattice vectors or atomic positions.
Unit_cell & unit_cell_
Alias of the unit cell.
DFT_ground_state(K_point_set &kset__)
Constructor.
Stress stress_
Lattice stress.
json check_scf_density()
A quick check of self-constent density in case of pseudopotential.
Generate charge density and magnetization from occupied spinor wave-functions.
Generate effective potential from charge density and magnetization.
Simulation context is a set of parameters and objects describing a single simulation.
auto const & gvec() const
Return const reference to Gvec object.
std::ostream & out() const
Return output stream.
int num_loc_op_applied(int n=0) const
Keep track of the total number of wave-functions to which the local operator was applied.
Representation of a unit cell.
Contains definition of sirius::Force class.
Contains declaration and partial implementation of sirius::Hubbard class.
Interface to nlohmann::json library and helper functions.
Contains declaration and partial implementation of sirius::K_point_set class.
Namespace of the SIRIUS library.
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.
Contains definition of sirius::Stress tensor class.