ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
angmom_op_mat.h
Go to the documentation of this file.
1#ifndef ANGMOM_OP_MAT_H
2#define ANGMOM_OP_MAT_H
3
89#include <cmath>
90#include <vector>
91#include <map>
92#include <tuple>
93#include <complex>
94#include <fstream>
95#include <memory>
100
102
103namespace ModuleIO
104{
124 std::complex<double> cal_LzijR(
125 const std::unique_ptr<TwoCenterIntegrator>& calculator,
126 const int it, const int ia, const int il, const int iz, const int mi,
127 const int jt, const int ja, const int jl, const int jz, const int mj,
128 const ModuleBase::Vector3<double>& vR);
129
149 std::complex<double> cal_LyijR(
150 const std::unique_ptr<TwoCenterIntegrator>& calculator,
151 const int it, const int ia, const int il, const int iz, const int im,
152 const int jt, const int ja, const int jl, const int jz, const int jm,
153 const ModuleBase::Vector3<double>& vR);
154
174 std::complex<double> cal_LxijR(
175 const std::unique_ptr<TwoCenterIntegrator>& calculator,
176 const int it, const int ia, const int il, const int iz, const int im,
177 const int jt, const int ja, const int jl, const int jz, const int jm,
178 const ModuleBase::Vector3<double>& vR);
179
180 // The calculation of <phi_i|Lx/Ly/Lz|phi_j> matrix elements is written to
181 // three real CSR files, lx_nao.csr, ly_nao.csr and lz_nao.csr (or
182 // lxg{istep+1}_nao.csr etc. when out_app_flag = 2). Each R block follows the
183 // same self-describing header and CSR layout as the H(R)/S(R) output, so
184 // the values are indexed by the global NAO orbital index (row) and column
185 // index instead of the (it, ia, il, iz, im ...) tuple. Because the NAO
186 // basis is real, every matrix element is purely imaginary; the files store
187 // only the imaginary part, and the real part is identically zero.
189 {
190 public:
191 // the default constructor is meaningless
192 Angmom_op() = delete;
207 Angmom_op(
208 const std::string& orbital_dir,
209 const UnitCell& ucell,
210 const double& search_radius,
211 const int tdestructor,
212 const int tgrid,
213 const int tatom,
214 const bool searchpbc,
215 const std::string& out_level,
216 const bool gamma_only,
217 std::ofstream* ptr_log = nullptr,
218 const int rank = 0);
219 ~Angmom_op() = default;
220
239 void calculate(const std::string& prefix,
240 const std::string& outdir,
241 const UnitCell& ucell,
242 const Parallel_Orbitals& pv,
243 const int precision,
244 const int rank,
245 const int istep,
246 const int out_app_flag);
247
248 private:
249 std::ofstream fallback_ofs_;
250 // ofsrunning
251 std::ofstream* ofs_ = nullptr;
252 // the two-center-integrator
253 std::unique_ptr<TwoCenterIntegrator> calculator_;
254 // the spherical bessel transformer
256 // the radial collection
257 std::unique_ptr<RadialCollection> orb_;
258
259 // neighboring searcher
260 std::unique_ptr<Grid_Driver> neighbor_searcher_;
261 };
262} // namespace ModuleIO
263
264#endif // ANGMOM_OP_MAT_H
A class that provides spherical Bessel transforms.
Definition sph_bessel_tf.h:69
ModuleBase::SphericalBesselTransformer sbt_
Definition angmom_op_mat.h:255
std::unique_ptr< Grid_Driver > neighbor_searcher_
Definition angmom_op_mat.h:260
std::ofstream * ofs_
Definition angmom_op_mat.h:251
std::ofstream fallback_ofs_
Definition angmom_op_mat.h:249
std::unique_ptr< TwoCenterIntegrator > calculator_
Definition angmom_op_mat.h:253
std::unique_ptr< RadialCollection > orb_
Definition angmom_op_mat.h:257
void calculate(const std::string &prefix, const std::string &outdir, const UnitCell &ucell, const Parallel_Orbitals &pv, const int precision, const int rank, const int istep, const int out_app_flag)
Calculate and write <phi_i|Lx/Ly/Lz|phi_j> matrix elements.
Definition angmom_op_mat.cpp:442
Definition parallel_orbitals.h:16
Provide the basic information about unitcell.
Definition unitcell.h:16
Internal helpers shared by the R-space sparse text writers. Declared here (instead of duplicated in e...
Definition csr_reader.cpp:8
std::complex< double > cal_LyijR(const std::unique_ptr< TwoCenterIntegrator > &calculator, const int it, const int ia, const int il, const int iz, const int im, const int jt, const int ja, const int jl, const int jz, const int jm, const ModuleBase::Vector3< double > &vR)
calculate the <phi_i|Ly|phi_j> matrix elements, in which the Lz are the angular momentum operators,...
Definition angmom_op_mat.cpp:297
std::complex< double > cal_LxijR(const std::unique_ptr< TwoCenterIntegrator > &calculator, const int it, const int ia, const int il, const int iz, const int im, const int jt, const int ja, const int jl, const int jz, const int jm, const ModuleBase::Vector3< double > &vR)
calculate the <phi_i|Lx|phi_j> matrix elements, in which the Lz are the angular momentum operators,...
Definition angmom_op_mat.cpp:230
std::complex< double > cal_LzijR(const std::unique_ptr< TwoCenterIntegrator > &calculator, const int it, const int ia, const int il, const int iz, const int mi, const int jt, const int ja, const int jl, const int jz, const int mj, const ModuleBase::Vector3< double > &vR)
calculate the <phi_i|Lz|phi_j> matrix elements, in which the Lz are the angular momentum operators,...
Definition angmom_op_mat.cpp:215
Grid_Driver class for neighbor search interface.