votca 2024.1-dev
Loading...
Searching...
No Matches
OscillatorStrength_filter.cc
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// Local private VOTCA includes
22
23namespace votca {
24namespace xtp {
25
27 threshold_ = options.get(".").as<double>();
28}
29
32 << "Using oscillator strength tracker with threshold " << threshold_
33 << std::flush;
34}
35
37
39 const Orbitals& orb, QMStateType type) const {
40
41 if (type != QMStateType::Singlet) {
42 throw std::runtime_error(
43 "OscillatorStrength filter only works for singlets.");
44 }
45 Eigen::VectorXd oscs = orb.Oscillatorstrengths();
46 std::vector<Index> indexes;
47 for (Index i = 0; i < oscs.size(); i++) {
48 if (oscs[i] > threshold_) {
49 indexes.push_back(i);
50 }
51 }
52 return indexes;
53}
54
58
62
63} // namespace xtp
64} // namespace votca
class to manage program options with xml serialization functionality
Definition property.h:55
Property & get(const std::string &key)
get existing property
Definition property.cc:79
T as() const
return value as type
Definition property.h:283
Logger is used for thread-safe output of messages.
Definition logger.h:164
container for molecular orbitals
Definition orbitals.h:46
Eigen::VectorXd Oscillatorstrengths() const
Definition orbitals.cc:428
void Initialize(const tools::Property &options) final
std::vector< Index > CalcIndeces(const Orbitals &orb, QMStateType type) const final
void UpdateHist(const Orbitals &orb, QMState state) final
void ReadFromCpt(CheckpointReader &r) final
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
Definition qmstate.h:132
#define XTP_LOG(level, log)
Definition logger.h:40
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26