ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
to_wannier90_lcao.h
Go to the documentation of this file.
1#ifndef TOWannier90_LCAO_H
2#define TOWannier90_LCAO_H
3
9#include "source_base/timer.h"
11#include "source_base/vector3.h"
12#include "source_base/ylm.h"
17#include "source_cell/klist.h"
22#include "source_psi/psi.h"
23#include "to_wannier90.h"
24
25#include <algorithm>
26#include <cmath>
27#include <cstdlib>
28#include <iostream>
29#include <map>
30#include <set>
31#include <vector>
32
33#ifdef __LCAO
34#include "fR_overlap.h"
36
37class Coordinate_3D
38{
39 public:
40 double x = 0;
41 double y = 0;
42 double z = 0;
43
44 Coordinate_3D(double x = 0.0, double y = 0.0, double z = 0.0) : x(x), y(y), z(z)
45 {
46 }
47
48 bool operator<(const Coordinate_3D& other) const
49 {
50 const double threshold = 1e-8;
51 if (std::abs(x - other.x) >= threshold)
52 return x < other.x;
53 if (std::abs(y - other.y) >= threshold)
54 return y < other.y;
55 return std::abs(z - other.z) >= threshold && z < other.z;
56 }
57};
58
59class toWannier90_LCAO : public toWannier90
60{
61 public:
62 toWannier90_LCAO(const bool& out_wannier_mmn,
63 const bool& out_wannier_amn,
64 const bool& out_wannier_unk,
65 const bool& out_wannier_eig,
66 const bool& out_wannier_wvfn_formatted,
67 const std::string& nnkpfile,
68 const std::string& wannier_spin,
69 const LCAO_Orbitals& orb
70 );
71 ~toWannier90_LCAO();
72
73 void calculate(const UnitCell& ucell,
74 const Grid_Driver& gd,
75 const ModuleBase::matrix& ekb,
76 const K_Vectors& kv,
77 const psi::Psi<std::complex<double>>& psi,
78 const Parallel_Orbitals* pv);
79
80 void calculate(const UnitCell& ucell,
81 const Grid_Driver& gd,
82 const ModuleBase::matrix& ekb,
83 const K_Vectors& kv,
84 const psi::Psi<double>& psi,
85 const Parallel_Orbitals* pv)
86 {
87 ModuleBase::WARNING_QUIT("toWannier90_LCAO::calculate",
88 "The wave function is real (double type), indicating 'gamma_only = 1'. "
89 "The Wannier90 interface does not support Gamma-only calculations. "
90 "Please set 'gamma_only 0' in your INPUT file.");
91 }
92
93 void cal_Amn(const UnitCell& ucell, const K_Vectors& kv, const psi::Psi<std::complex<double>>& psi);
94 void cal_Mmn(const UnitCell& ucell, const K_Vectors& kv, const psi::Psi<std::complex<double>>& psi);
95 void out_unk(const psi::Psi<std::complex<double>>& psi);
96
97 protected:
98 // Radial section of trial orbitals
99 const int mesh_r = 1001; // unit is a.u.
100 const double dr = 0.01;
101 std::vector<std::vector<Numerical_Orbital_Lm>> A_orbs;
102
103 const LCAO_Orbitals& orb_;
104
105 // Use default element orbital information
106 int orb_r_ntype = 0;
107
109 ORB_gaunt_table MGT;
110 double kmesh_times = 1;
111
113 std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> orbs;
114 std::map<size_t, std::map<size_t, std::map<size_t, Center2_Orb::Orb11>>> center2_orb11_A;
115
116 std::vector<ModuleBase::Vector3<double>> R_coor_car;
117 std::vector<std::vector<std::vector<double>>> psi_psiA_R;
118
119 std::vector<int> iw2it;
120 std::vector<int> iw2ia;
121 std::vector<int> iw2iL;
122 std::vector<int> iw2iN;
123 std::vector<int> iw2im;
124 std::vector<int> iw2iorb;
125
126 const Parallel_Orbitals* ParaV = nullptr;
127
128 void initialize_orb_table(const UnitCell& ucell);
129 void produce_basis_orb();
130 void set_R_coor(const UnitCell& ucell, const Grid_Driver& gd);
131 void count_delta_k(const UnitCell& ucell, const K_Vectors& kv);
132
133 std::vector<Coordinate_3D> delta_k_all;
134 std::map<Coordinate_3D, int> delta_k_all_index;
135
136 void unkdotkb(const UnitCell& ucell,
137 const K_Vectors& kv,
138 const psi::Psi<std::complex<double>>& psi_in,
139 const int& ik,
140 const int& ikb,
143
144 void produce_trial_in_lcao();
145 void construct_overlap_table_project();
146 void cal_orbA_overlap_R(const UnitCell& ucell);
147
148 void unkdotA(const K_Vectors& kv,
149 const psi::Psi<std::complex<double>>& psi_in,
150 const int& ik,
152
153 std::vector<FR_overlap<std::complex<double>>> FR;
154};
155#endif
156#endif
bool operator<(const Abfs::Vector3_Order< T > &v1, const Abfs::Vector3_Order< T > &v2)
Definition sltk_grid_driver.h:40
Definition klist.h:12
Definition ORB_read.h:18
Definition complexmatrix.h:13
Definition sph_bessel_recursive.h:49
3 elements vector
Definition vector3.h:24
Definition matrix.h:18
Definition ORB_atomic_lm.h:21
Definition ORB_gaunt_table.h:9
Definition parallel_orbitals.h:9
Definition unitcell.h:15
Definition psi.h:37
Definition to_wannier90.h:18
void cal_Amn()
Definition to_wannier90.cpp:124
void cal_Mmn()
Definition to_wannier90.cpp:128
void out_unk()
Definition to_wannier90.cpp:120
void calculate()
Definition to_wannier90.cpp:69
double x[440]
Definition sincos.cpp:28
void WARNING_QUIT(const std::string &, const std::string &)
Combine the functions of WARNING and QUIT.
Definition test_delley.cpp:14
Definition exx_lip.h:23
#define threshold
Definition sph_bessel_recursive_test.cpp:4