votca 2024.2-dev
Loading...
Searching...
No Matches
aobasis.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2023 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_AOBASIS_H
22#define VOTCA_XTP_AOBASIS_H
23
24// Local VOTCA includes
25#include "aoshell.h"
26
27#include "eigen.h"
28#include <libint2/shell.h>
29
30namespace votca {
31namespace xtp {
32class QMMolecule;
33class BasisSet;
34class CheckpointWriter;
35class CheckpointReader;
36
42class AOBasis {
43 public:
44 void Fill(const BasisSet& bs, const QMMolecule& atoms);
45
46 Index AOBasisSize() const { return AOBasisSize_; }
47
48 using AOShellIterator = std::vector<AOShell>::const_iterator;
49 AOShellIterator begin() const { return aoshells_.begin(); }
50 AOShellIterator end() const { return aoshells_.end(); }
51
52 const AOShell& getShell(Index idx) const { return aoshells_[idx]; }
53
54 const std::vector<const AOShell*> getShellsofAtom(Index AtomId) const;
55
56 Index getNumofShells() const { return Index(aoshells_.size()); }
57
59 Index totalPrimitives = 0;
60 for (const AOShell& shell : aoshells_) {
61 totalPrimitives += shell.getSize();
62 }
63 return totalPrimitives;
64 }
65
66 Index getMaxNprim() const;
67
68 Index getMaxL() const;
69
70 std::vector<Index> getMapToBasisFunctions() const;
71
72 const std::vector<Index>& getFuncPerAtom() const { return FuncperAtom_; }
73
74 std::vector<libint2::Shell> GenerateLibintBasis() const;
75
76 std::vector<std::vector<Index>> ComputeShellPairs(
77 double threshold = 1e-20) const;
78
79 AOShell& addShell(const Shell& shell, const QMAtom& atom, Index startIndex);
80
81 const std::string& Name() const { return name_; }
82
83 void UpdateShellPositions(const QMMolecule& mol);
84
85 void WriteToCpt(CheckpointWriter& w) const;
86
88
89 void add(const AOBasis& other);
90
91 void clear();
92 std::string name_ = "";
93
94 friend std::ostream& operator<<(std::ostream& out, const AOBasis& aobasis);
95
96 private:
97 void FillFuncperAtom();
98
99 std::vector<AOShell> aoshells_;
100
101 std::vector<Index> FuncperAtom_;
102
104};
105
106} // namespace xtp
107} // namespace votca
108
109#endif // VOTCA_XTP_AOBASIS_H
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
Index getMaxL() const
Definition aobasis.cc:29
AOShellIterator begin() const
Definition aobasis.h:49
void UpdateShellPositions(const QMMolecule &mol)
Definition aobasis.cc:128
const std::vector< const AOShell * > getShellsofAtom(Index AtomId) const
Definition aobasis.cc:63
Index AOBasisSize() const
Definition aobasis.h:46
AOShellIterator end() const
Definition aobasis.h:50
void Fill(const BasisSet &bs, const QMMolecule &atoms)
Definition aobasis.cc:85
void add(const AOBasis &other)
Definition aobasis.cc:73
Index getNumberOfPrimitives() const
Definition aobasis.h:58
std::vector< Index > getMapToBasisFunctions() const
Definition aobasis.cc:45
const AOShell & getShell(Index idx) const
Definition aobasis.h:52
const std::string & Name() const
Definition aobasis.h:81
const std::vector< Index > & getFuncPerAtom() const
Definition aobasis.h:72
Index getNumofShells() const
Definition aobasis.h:56
Index getMaxNprim() const
Definition aobasis.cc:37
void WriteToCpt(CheckpointWriter &w) const
Definition aobasis.cc:141
void ReadFromCpt(CheckpointReader &r)
Definition aobasis.cc:163
std::string name_
Definition aobasis.h:92
friend std::ostream & operator<<(std::ostream &out, const AOBasis &aobasis)
Definition aobasis.cc:189
AOShell & addShell(const Shell &shell, const QMAtom &atom, Index startIndex)
Definition aobasis.cc:57
std::vector< std::vector< Index > > ComputeShellPairs(double threshold=1e-20) const
std::vector< Index > FuncperAtom_
Definition aobasis.h:101
std::vector< AOShell > aoshells_
Definition aobasis.h:99
std::vector< AOShell >::const_iterator AOShellIterator
Definition aobasis.h:48
std::vector< libint2::Shell > GenerateLibintBasis() const
Definition aobasis.cc:119
container for QM atoms
Definition qmatom.h:37
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26