votca 2024.1-dev
Loading...
Searching...
No Matches
statefilter_base.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 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_STATEFILTER_BASE_H
22#define VOTCA_XTP_STATEFILTER_BASE_H
23
24// Standard includes
25#include <string>
26
27// VOTCA includes
29#include <votca/tools/types.h>
30
31// Local VOTCA includes
32#include "logger.h"
33#include "orbitals.h"
34
35namespace votca {
36namespace xtp {
37
45 public:
46 StateFilter_base() = default;
47 virtual ~StateFilter_base() = default;
48
49 virtual std::string Identify() const = 0;
50 virtual void Initialize(const tools::Property&) = 0;
51
52 virtual void Info(Logger&) const = 0;
53
54 virtual bool NeedsInitialState() const = 0;
55
56 virtual void UpdateHist(const Orbitals&, QMState) = 0;
57
58 virtual std::vector<Index> CalcIndeces(const Orbitals&,
59 QMStateType) const = 0;
60
61 virtual void WriteToCpt(CheckpointWriter&) = 0;
62
63 virtual void ReadFromCpt(CheckpointReader&) = 0;
64
65 protected:
66 std::vector<Index> ReduceAndSortIndecesUp(const Eigen::VectorXd& overlap,
67 Index offset,
68 double threshold) const;
69 std::vector<Index> ReduceAndSortIndecesDown(const Eigen::VectorXd& overlap,
70 Index offset,
71 double threshold) const;
72
73 private:
74 template <bool larger>
75 std::vector<Index> ReduceAndSortIndeces(const Eigen::VectorXd& overlap,
76 Index offset, double threshold) const;
77};
78
79} // namespace xtp
80} // namespace votca
81
82#endif // VOTCA_XTP_STATEFILTER_BASE_H
class to manage program options with xml serialization functionality
Definition property.h:55
Logger is used for thread-safe output of messages.
Definition logger.h:164
container for molecular orbitals
Definition orbitals.h:46
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
Definition qmstate.h:132
Base Class for statefilter.
virtual void WriteToCpt(CheckpointWriter &)=0
virtual std::string Identify() const =0
virtual void Info(Logger &) const =0
virtual void ReadFromCpt(CheckpointReader &)=0
std::vector< Index > ReduceAndSortIndecesUp(const Eigen::VectorXd &overlap, Index offset, double threshold) const
virtual std::vector< Index > CalcIndeces(const Orbitals &, QMStateType) const =0
virtual void UpdateHist(const Orbitals &, QMState)=0
virtual bool NeedsInitialState() const =0
std::vector< Index > ReduceAndSortIndecesDown(const Eigen::VectorXd &overlap, Index offset, double threshold) const
std::vector< Index > ReduceAndSortIndeces(const Eigen::VectorXd &overlap, Index offset, double threshold) const
virtual void Initialize(const tools::Property &)=0
virtual ~StateFilter_base()=default
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26