25#ifndef __RADIAL_FUNCTIONS_INDEX_HPP__
26#define __RADIAL_FUNCTIONS_INDEX_HPP__
67 RTE_THROW(
"l can't be negative");
77 RTE_THROW(
"l can't be negative");
79 if (s__ != -1 && s__ != 0 && s__ != 1) {
80 RTE_THROW(
"wrong value of s");
82 if (l__ == 0 && s__ == -1) {
83 RTE_THROW(
"incompatible combination of l and s quantum numbers");
114 inline auto s()
const
120inline bool operator==(angular_momentum lhs__, angular_momentum rhs__)
122 return (lhs__.l() == rhs__.l()) && (lhs__.s() == rhs__.s());
125inline bool operator!=(angular_momentum lhs__, angular_momentum rhs__)
127 return !(lhs__ == rhs__);
134 out <<
"{l: " << am.
l() <<
"}";
136 out <<
"{l: " << am.
l() <<
", j: " << am.
j() <<
"}";
166 RTE_ASSERT(
order >= 0);
184 std::vector<radial_function_index_descriptor>
vrd_;
202 if (s != 0 && l > 0) {
203 RTE_THROW(
"for l > 0 full-j radial functions are added in pairs");
214 std::array<int, 2> idx({-1, -1});
216 idx[std::max(s, 0)] =
size;
246 if (l != am2__.
l()) {
247 RTE_THROW(
"orbital quantum numbers are different");
256 RTE_THROW(
"spin quantum numbers are the same");
260 RTE_THROW(
"spin quantum numbers can't be zero in case of full orbital momentum");
289 std::array<int, 2> idx({-1, -1});
291 idx[std::max(s1, 0)] =
size;
292 idx[std::max(s2, 0)] =
size + 1;
303 return vrd_[idx__].am;
309 return vrd_[idx__].order;
324 result = std::max(result,
vrd_[i].
am.l());
336 if (
vrd_[i].
am.l() == l__) {
354 for (
int l = 0; l <= this->
lmax(); l++) {
355 result = std::max(result, this->
max_order(l));
370 RTE_ASSERT(idxlo__ >= 0 && idxlo__ + offset_lo_ < this->
size());
402 return static_cast<int>(
vrd_.size());
413 size += j.subshell_size();
437inline auto begin(radial_functions_index
const& idx__)
439 return idx__.begin();
442inline auto end(radial_functions_index
const& idx__)
Angular momentum quantum number.
int s_
Spin quantum number in the units of 1/2.
auto l() const
Get orbital quantum number l.
angular_momentum(int l__)
Constructor.
auto subshell_size() const
The size of the subshell for the angular momentum l or j.
int l_
Orbital quantum number l.
auto two_j() const
Get twice the total angular momentum 2j = 2l +/- 1.
auto s() const
Get spin quantum number s.
angular_momentum(int l__, int s__)
Constructor.
auto j() const
Get total angular momentum j = l +/- 1/2.
Radial basis function index.
auto const & operator[](rf_index i__) const
Return radial function descriptor for a given index.
void add_lo(angular_momentum am__)
Add local-orbital type of radial function.
std::vector< radial_function_index_descriptor > vrd_
List of radial function index descriptors.
auto num_lo(int l__) const
Number of local orbitals for a given l.
auto full_j(int l__, int o__) const
Check if the angular momentum is treated as full (j = l +/- 1/2).
auto index_of(angular_momentum am__, int order__) const
Return index of radial function.
auto subshell_size(int l__, int o__) const
Return the subshell size for a given l and order.
auto max_order() const
Return maximum order of the radial functions across all angular momentums.
int size() const
Return total number of radial functions.
auto index_of(rf_lo_index idxlo__) const
Return index of local orbital.
auto subshell(int l__, int o__) const
Return the angular mementum(s) of the subshell with given l and order.
auto order(rf_index idx__) const
Return order of the radial function.
auto lmax_lo() const
Maximum angular momentum quantum number for local orbitals.
auto am(rf_index idx__) const
Return angular momentum of the radial function.
int offset_lo_
Starting index of local orbitals (if added in LAPW case).
void add(angular_momentum am1__, angular_momentum am2__)
Add two component of the spinor radial function.
auto end() const
End iterator of radial function descriptor list.
auto lmax() const
Return maximum angular momentum quantum number.
auto begin() const
Begin iterator of radial function descriptor list.
auto max_order(int l__) const
Return maximum order of the radial functions for a given angular momentum.
std::vector< std::vector< std::array< int, 2 > > > index_by_j_order_
Store index of the radial function by angular momentum j and order of the function for a given j....
radial_functions_index()
Default constructor.
void add(angular_momentum am__)
Add a single radial function with a given angular momentum.
Namespace of the SIRIUS library.
std::ostream & operator<<(std::ostream &out, hbar &&b)
Inject horisontal bar to ostream.
strong_type< int, struct __rf_lo_index_tag > rf_lo_index
Local orbital radial function index.
strong_type< int, struct __rf_index_tag > rf_index
Radial function index.
Eror and warning handling during run-time execution.
A wrapper class to create strong types.
Descriptor for the atomic radial functions.
int order
Order of a function for a given .
angular_momentum am
Total angular momentum.
rf_lo_index idxlo
If this is a local orbital radial function, idxlo is it's index in the list of local orbital descript...