7171
7272namespace ModuleIO
7373{
74+ /* *
75+ * @brief calculate the <phi_i|Lz|phi_j> matrix elements, in which the Lz
76+ * are the angular momentum operators, |phi_i> and |phi_j> are the numerical
77+ * atomic orbitals (NAOs).
78+ *
79+ * @param calculator the std::unique_ptr<TwoCenterIntegrator> instance
80+ * @param it atomtype index of the first atom
81+ * @param ia atomic index of the first atom within the atomtype
82+ * @param il angular momentum index of the first atom
83+ * @param iz zeta function index of the first atom
84+ * @param mi magnetic quantum number of the first atom
85+ * @param jt atomtype index of the second atom
86+ * @param ja atomic index of the second atom within the atomtype
87+ * @param jl angular momentum index of the second atom
88+ * @param jz zeta function index of the second atom
89+ * @param mj magnetic quantum number of the second atom
90+ * @param vR the vector from the first atom to the second atom
91+ * @return std::complex<double>
92+ */
7493 std::complex <double > cal_LzijR (
7594 const std::unique_ptr<TwoCenterIntegrator>& calculator,
7695 const int it, const int ia, const int il, const int iz, const int mi,
7796 const int jt, const int ja, const int jl, const int jz, const int mj,
7897 const ModuleBase::Vector3<double >& vR);
7998
99+ /* *
100+ * @brief calculate the <phi_i|Ly|phi_j> matrix elements, in which the Lz
101+ * are the angular momentum operators, |phi_i> and |phi_j> are the numerical
102+ * atomic orbitals (NAOs).
103+ *
104+ * @param calculator the std::unique_ptr<TwoCenterIntegrator> instance
105+ * @param it atomtype index of the first atom
106+ * @param ia atomic index of the first atom within the atomtype
107+ * @param il angular momentum index of the first atom
108+ * @param iz zeta function index of the first atom
109+ * @param mi magnetic quantum number of the first atom
110+ * @param jt atomtype index of the second atom
111+ * @param ja atomic index of the second atom within the atomtype
112+ * @param jl angular momentum index of the second atom
113+ * @param jz zeta function index of the second atom
114+ * @param mj magnetic quantum number of the second atom
115+ * @param vR the vector from the first atom to the second atom
116+ * @return std::complex<double>
117+ */
80118 std::complex <double > cal_LyijR (
81119 const std::unique_ptr<TwoCenterIntegrator>& calculator,
82120 const int it, const int ia, const int il, const int iz, const int im,
83121 const int jt, const int ja, const int jl, const int jz, const int jm,
84122 const ModuleBase::Vector3<double >& vR);
85123
124+ /* *
125+ * @brief calculate the <phi_i|Lx|phi_j> matrix elements, in which the Lz
126+ * are the angular momentum operators, |phi_i> and |phi_j> are the numerical
127+ * atomic orbitals (NAOs).
128+ *
129+ * @param calculator the std::unique_ptr<TwoCenterIntegrator> instance
130+ * @param it atomtype index of the first atom
131+ * @param ia atomic index of the first atom within the atomtype
132+ * @param il angular momentum index of the first atom
133+ * @param iz zeta function index of the first atom
134+ * @param mi magnetic quantum number of the first atom
135+ * @param jt atomtype index of the second atom
136+ * @param ja atomic index of the second atom within the atomtype
137+ * @param jl angular momentum index of the second atom
138+ * @param jz zeta function index of the second atom
139+ * @param mj magnetic quantum number of the second atom
140+ * @param vR the vector from the first atom to the second atom
141+ * @return std::complex<double>
142+ */
86143 std::complex <double > cal_LxijR (
87144 const std::unique_ptr<TwoCenterIntegrator>& calculator,
88145 const int it, const int ia, const int il, const int iz, const int im,
@@ -103,7 +160,20 @@ namespace ModuleIO
103160 class AngularMomentumExpectationCalculator
104161 {
105162 public:
106- AngularMomentumExpectationCalculator () = delete ; // the default constructor is meaningless
163+ // the default constructor is meaningless
164+ AngularMomentumExpectationCalculator () = delete ;
165+ /* *
166+ * @brief Construct a new Angular Momentum Expectation Calculator object
167+ *
168+ * @param orbital_dir the directory of the orbital file
169+ * @param ucell the unit cell object
170+ * @param search_radius the search radius for the neighboring atoms
171+ * @param tdestructor test flag, for destructor
172+ * @param tgrid test flag, for grid
173+ * @param tatom test flag, for atom input
174+ * @param searchpbc
175+ * @param ptr_log pointer to the ofstream object for logging
176+ */
107177 AngularMomentumExpectationCalculator (
108178 const std::string& orbital_dir,
109179 const UnitCell& ucell,
@@ -112,13 +182,15 @@ namespace ModuleIO
112182 const int tgrid,
113183 const int tatom,
114184 const bool searchpbc,
115- std::ofstream* ptr_log = nullptr );
185+ std::ofstream* ptr_log = nullptr ,
186+ const int rank = 0 );
116187 ~AngularMomentumExpectationCalculator () = default ;
117188
118- void calculate (std::ofstream* ofs,
119- const UnitCell& ucell,
120- const char dir = ' x' ,
121- const int precision = 10 );
189+ void calculate (const std::string& prefix,
190+ const std::string& outdir,
191+ const UnitCell& ucell,
192+ const int precision = 10 ,
193+ const int rank = 0 );
122194
123195 private:
124196 // ofsrunning
@@ -132,5 +204,21 @@ namespace ModuleIO
132204
133205 // neighboring searcher
134206 std::unique_ptr<Grid_Driver> neighbor_searcher_;
207+
208+ /* *
209+ * @brief calculate the <phi_i|Lx/Ly/Lz|phi_j> matrix elements. Due to
210+ * the large size of the matrix, the result will be printed to file
211+ * directly.
212+ *
213+ * @param ofs pointer to the ofstream object for printing, if nullptr,
214+ * the result will not be printed
215+ * @param ucell the unit cell object
216+ * @param dir the direction of the angular momentum operator, 'x', 'y' or 'z'
217+ * @param precision the precision of the output, default is 10
218+ */
219+ void kernel (std::ofstream* ofs,
220+ const UnitCell& ucell,
221+ const char dir = ' x' ,
222+ const int precision = 10 );
135223 };
136224} // namespace ModuleIO
0 commit comments