20 #ifndef JDFTX_WANNIER_WANNIERMINIMIZER_H 21 #define JDFTX_WANNIER_WANNIERMINIMIZER_H 25 #include <core/LatticeUtils.h> 26 #include <electronic/Everything.h> 27 #include <electronic/ColumnBundle.h> 28 #include <electronic/matrix.h> 29 #include <electronic/ColumnBundleTransform.h> 30 #include <wannier/Wannier.h> 35 size_t ikStart()
const;
36 size_t ikStop()
const;
44 matrix randomMatrix(
int nRows,
int nCols);
53 void initTransformDependent();
56 void saveMLWF(
int iSpin);
62 bool report(
int iter);
63 double sync(
double x)
const;
67 {
bool operator<(
const Kpoint& other)
const;
68 bool operator==(
const Kpoint& other)
const;
85 virtual void initialize(
int iSpin)=0;
92 virtual double getOmega(
bool grad=
false)=0;
95 virtual double getOmegaI(
bool grad=
false)=0;
101 const std::vector< matrix3<int> >& sym;
107 std::vector<bool> pinned;
115 std::map<vector3<int>,
double> iCellMap, phononCellMap;
126 size_t ikStart, ikStop;
127 inline bool isMine(
size_t ik)
const {
return kDivision.
isMine(ik); }
128 inline int whose(
size_t ik)
const {
return kDivision.
whose(ik); }
131 bool isMine_q(
int ik,
int iSpin)
const {
return e.eInfo.
isMine(kMesh[ik].point.iReduced + iSpin*qCount); }
132 int whose_q(
int ik,
int iSpin)
const {
return e.eInfo.
whose(kMesh[ik].point.iReduced + iSpin*qCount); }
136 std::vector<ColumnBundle> Cother;
142 void axpyWfns_grad(
double alpha,
matrix& Omega_A,
const Kpoint& kpoint,
int iSpin,
const ColumnBundle& Omega_result)
const;
146 std::map< Kpoint, std::shared_ptr<ColumnBundle> > numericalOrbitals;
153 void dumpMatrix(
const matrix& H,
string varName,
bool realPartOnly,
int iSpin)
const;
161 #endif // JDFTX_WANNIER_WANNIERMINIMIZER_H Entry in the k-point mesh, including state of minimizer (subspace rotations)
Definition: WannierMinimizer.h:72
Base class for different wannier minimizers:
Definition: WannierMinimizer.h:48
void randomize(TptrCollection &x)
Initialize to normal random numbers:
Definition: ScalarFieldArray.h:154
Simulation grid descriptor.
Definition: GridInfo.h:45
int whose(size_t task) const
Which process number should handle this task number.
complex dot(const Tptr &X, const Tptr &Y)
Definition: Operators.h:196
std::set< Kpoint > kpoints
list of all k-points that will be in use (including those in FD formulae)
Definition: WannierMinimizer.h:119
std::vector< KmeshEntry > kMesh
k-point mesh with FD formula
Definition: WannierMinimizer.h:118
Basis basis
common basis (with indexing into full G-space)
Definition: WannierMinimizer.h:122
General complex matrix.
Definition: matrix.h:58
Definition: WannierMinimizer.h:32
int whose(int q) const
find out which process this state index belongs to
Definition: ElecInfo.h:56
matrix Omega_U
net rotation (nBands x nCenters) and intermediate gradient w.r.t it
Definition: WannierMinimizer.h:77
Entries in the k-point mesh.
Definition: WannierMinimizer.h:66
Definition: ElecInfo.h:35
std::vector< vector3<> > rPinned
Whether centers are pinned or free.
Definition: WannierMinimizer.h:108
bool needSuper
Where centers are pinned to (if they are)
Definition: WannierMinimizer.h:111
Tptr clone(const Tptr &X)
Clone (NOTE: operator= is by reference for the ScalarField classes)
Definition: Operators.h:111
std::shared_ptr< ColumnBundleTransform::BasisWrapper > basisSuperWrapper
look-up tables for initializing transforms
Definition: WannierMinimizer.h:120
bool isMine(int q) const
check if state index is local
Definition: ElecInfo.h:55
std::map< Kpoint, std::shared_ptr< ColumnBundleTransform > > transformMapSuper
wave-function transforms for each k-point to the common bases
Definition: WannierMinimizer.h:121
std::vector< vector3<> > rExpect
Expectation values for r per center in current group.
Definition: WannierMinimizer.h:106
Definition: Everything.h:41
Tptr & operator*=(Tptr &in, double scaleFac)
Scale.
Definition: Operators.h:115
Nonlinear minimization templates.
std::vector< double > rSqExpect
Expectation values for r^2 per center in current group.
Definition: WannierMinimizer.h:105
int nSpinor
number of spinor components
Definition: WannierMinimizer.h:104
int qCount
number of spins, and number of states per spin
Definition: WannierMinimizer.h:103
int nBands
number of Wannier centers (total and frozen) and source bands
Definition: WannierMinimizer.h:102
Definition: Minimize.h:46
void axpy(double alpha, const Tptr &X, Tptr &Y)
Generic axpy for complex data types (Note: null pointers are treated as zero)
Definition: Operators.h:158
Compute Maximally-Localized Wannier Functions.
Definition: Wannier.h:29
Kpoint point
point in the mesh
Definition: WannierMinimizer.h:73
bool isMine(size_t task) const
Whether current process handle this task number.
Definition: MPIUtil.h:96
Definition: ColumnBundle.h:30