votca 2024.2-dev
Loading...
Searching...
No Matches
statetracker.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_STATETRACKER_H
22#define VOTCA_XTP_STATETRACKER_H
23
24// Standard includes
25#include <memory>
26
27// Local VOTCA includes
28#include "logger.h"
29#include "orbitals.h"
30#include "qmstate.h"
31#include "statefilter_base.h"
32
33namespace votca {
34namespace xtp {
43
44 public:
45 void Initialize(const tools::Property& options);
46 void setLogger(Logger* log) { log_ = log; }
47 void setInitialState(const QMState& state) { statehist_.push_back(state); }
48 void PrintInfo() const;
49 QMState InitialState() const { return statehist_[0]; }
50 QMState CalcStateAndUpdate(const Orbitals& orbitals);
51 QMState CalcState(const Orbitals& orbitals) const;
52
53 void WriteToCpt(CheckpointWriter& w) const;
54
56
57 private:
58 void UpdateLastCoeff(const Orbitals& orbitals);
59 std::vector<Index> CollapseResults(
60 std::vector<std::vector<Index> >& results) const;
61 std::vector<Index> ComparePairofVectors(std::vector<Index>& vec1,
62 std::vector<Index>& vec2) const;
63
65
66 std::vector<QMState> statehist_;
67 std::vector<std::unique_ptr<StateFilter_base> > filters_;
68};
69} // namespace xtp
70} // namespace votca
71
72#endif // VOTCA_XTP_STATETRACKER_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
Tracks from a spectrum of states the state, which fullfills certain criteria.
void UpdateLastCoeff(const Orbitals &orbitals)
void Initialize(const tools::Property &options)
void setLogger(Logger *log)
std::vector< std::unique_ptr< StateFilter_base > > filters_
QMState CalcStateAndUpdate(const Orbitals &orbitals)
void setInitialState(const QMState &state)
void ReadFromCpt(CheckpointReader &r)
void WriteToCpt(CheckpointWriter &w) const
QMState CalcState(const Orbitals &orbitals) const
std::vector< Index > ComparePairofVectors(std::vector< Index > &vec1, std::vector< Index > &vec2) const
std::vector< QMState > statehist_
QMState InitialState() const
std::vector< Index > CollapseResults(std::vector< std::vector< Index > > &results) const
base class for all analysis tools
Definition basebead.h:33