ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
mo_type.h
Go to the documentation of this file.
1#ifndef ABACUS_SOURCE_LCAO_MODULE_LR_UTILS_MO_TYPE_H
2#define ABACUS_SOURCE_LCAO_MODULE_LR_UTILS_MO_TYPE_H
3
4#include <stdexcept>
5namespace LR_Util
6{
7#ifndef MO_TYPE_H
8#define MO_TYPE_H
9 enum MO_TYPE { OO, VO, OV, VV, ALL };
10#endif
11/* the first index is contiguous in memory
12MO_TYPE: OO VO OV VV ALL
13nmo1 nocc nocc nvirt nvirt nocc+nvirt
14nmo2 nocc nvirt nocc nvirt nocc+nvirt
15imo1 0 0 nocc nocc 0
16imo2 0 nocc 0 nocc 0
17*/
18inline void set_dim(const MO_TYPE type, const int& nocc, const int& nvirt,
19 int& nmo1, int& nmo2, int& imo1, int& imo2)
20{
21 switch(type)
22 {
23 case MO_TYPE::OO:
24 nmo1 = nocc; nmo2 = nocc; imo1 = 0; imo2 = 0;
25 break;
26 case MO_TYPE::VO:
27 nmo1 = nocc; nmo2 = nvirt; imo1 = 0; imo2 = nocc;
28 break;
29 case MO_TYPE::OV:
30 nmo1 = nvirt; nmo2 = nocc; imo1 = nocc; imo2 = 0;
31 break;
32 case MO_TYPE::VV:
33 nmo1 = nvirt; nmo2 = nvirt; imo1 = nocc; imo2 = nocc;
34 break;
35 case MO_TYPE::ALL:
36 nmo1 = nocc + nvirt;
37 nmo2 = nocc + nvirt;
38 imo1 = 0;
39 imo2 = 0;
40 break;
41 default:
42 throw std::runtime_error("Error in LR::set_dim: unknown MO_TYPE");
43 }
44}
45}
46
47#endif // ABACUS_SOURCE_LCAO_MODULE_LR_UTILS_MO_TYPE_H
Definition exciton_plotter.cpp:368
void set_dim(const MO_TYPE type, const int &nocc, const int &nvirt, int &nmo1, int &nmo2, int &imo1, int &imo2)
Definition mo_type.h:18
MO_TYPE
Definition mo_type.h:9
@ VV
Definition mo_type.h:9
@ OV
Definition mo_type.h:9
@ OO
Definition mo_type.h:9
@ ALL
Definition mo_type.h:9
@ VO
Definition mo_type.h:9