votca 2026-dev
Loading...
Searching...
No Matches
chargeresponse.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2026 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_CHARGERESPONSE_H
22#define VOTCA_XTP_CHARGERESPONSE_H
23
24// Standard includes
25#include <string>
26#include <vector>
27
28// Local VOTCA includes
29#include "checkpoint.h"
30#include "eigen.h"
31
32namespace votca {
33namespace xtp {
34
59 public:
60 ChargeResponse() = default;
61 ChargeResponse(std::vector<std::string> elements, Eigen::MatrixXd pi);
62
64 void LoadFromFile(const std::string& filename);
65
66 bool empty() const { return pi_.size() == 0; }
67 Index size() const { return Index(pi_.rows()); }
68 const Eigen::MatrixXd& Pi() const { return pi_; }
69 const std::vector<std::string>& Elements() const { return elements_; }
70
74 ChargeResponse Permuted(const std::vector<Index>& order) const;
75
76 void WriteToCpt(CheckpointWriter& w) const;
78
79 private:
80 // Throws unless pi_ is square, matches elements_, symmetric, charge
81 // conserving and positive semidefinite to a relative tolerance; then
82 // removes the rounding of the file (symmetrizes and projects onto the
83 // charge-conserving vectors).
84 void Check(const std::string& source);
85
86 std::vector<std::string> elements_;
87 Eigen::MatrixXd pi_;
88};
89
90} // namespace xtp
91} // namespace votca
92
93#endif // VOTCA_XTP_CHARGERESPONSE_H
Charge-response matrix Pi of one molecule type.
std::vector< std::string > elements_
const std::vector< std::string > & Elements() const
void WriteToCpt(CheckpointWriter &w) const
ChargeResponse Permuted(const std::vector< Index > &order) const
void ReadFromCpt(CheckpointReader &r)
const Eigen::MatrixXd & Pi() const
void Check(const std::string &source)
void LoadFromFile(const std::string &filename)
Reads a .crm file and checks it (see Check). Positions are in bohr.
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26