-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'non_collinear_XC' into 'master'
main modifications needed to implement non collinear XC functional Closes #152 and #157 See merge request npneq/inq!1082
- Loading branch information
Showing
6 changed files
with
317 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,6 +150,10 @@ namespace hamiltonian { | |
} | ||
return refs; | ||
} | ||
|
||
auto & nspin() const { | ||
return nspin_; | ||
} | ||
|
||
private: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* -*- indent-tabs-mode: t -*- */ | ||
|
||
#include <inq/inq.hpp> | ||
#include <stdio.h> | ||
|
||
using namespace inq; | ||
using namespace inq::magnitude; | ||
|
||
inq::utils::match match(3.0e-4); | ||
|
||
template <class EnvType> | ||
auto compute_GS(EnvType const & env, systems::ions const & ions) { | ||
|
||
auto electrons = systems::electrons(env.par(), ions, options::electrons{}.cutoff(30.0_Ha).extra_states(2).spin_polarized()); | ||
ground_state::initial_guess(ions, electrons); | ||
auto result_col = ground_state::calculate(ions, electrons, options::theory{}.lda(), inq::options::ground_state{}.steepest_descent().energy_tolerance(1.e-8_Ha).max_steps(1000)); | ||
auto mag = observables::total_magnetization(electrons.spin_density()); | ||
|
||
auto electrons_nc = systems::electrons(env.par(), ions, options::electrons{}.cutoff(30.0_Ha).extra_states(2).spin_non_collinear()); | ||
ground_state::initial_guess(ions, electrons_nc); | ||
auto result_nc = ground_state::calculate(ions, electrons_nc, options::theory{}.lda(), inq::options::ground_state{}.steepest_descent().energy_tolerance(1.e-8_Ha).max_steps(1000).mixing(0.1)); | ||
auto mag_nc = observables::total_magnetization(electrons_nc.spin_density()); | ||
|
||
match.check("total energy", result_col.energy.total(), result_nc.energy.total()); | ||
match.check("total magnetization", mag.length(), mag_nc.length()); | ||
} | ||
|
||
|
||
int main (int argc, char ** argv) { | ||
auto env = input::environment{}; | ||
|
||
auto ions = systems::ions(systems::cell::cubic(10.0_b)); | ||
ions.insert("H", {0.0_b, 0.0_b, 0.0_b}); | ||
compute_GS(env, ions); | ||
|
||
auto d = 1.21_A; | ||
ions = systems::ions(systems::cell::cubic(10.0_b)); | ||
ions.insert("O", {0.0_b, 0.0_b, d/2}); | ||
ions.insert("O", {0.0_b, 0.0_b,-d/2}); | ||
compute_GS(env, ions); | ||
} |
Oops, something went wrong.