votca 2026-dev
Loading...
Searching...
No Matches
activeregion.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_ACTIVEREGION_H
22#define VOTCA_XTP_ACTIVEREGION_H
23
24// Standard includes
25#include <string>
26#include <vector>
27
28// Local VOTCA includes
29#include "eigen.h"
30#include "orbitals.h"
31
32namespace votca {
33namespace xtp {
34
48 public:
49 struct Options {
50 bool grow = false;
51 // frontier orbitals: occupied levels within this window below the HOMO
52 // (and, with include_virtuals, virtual levels within it above the
53 // LUMO), in Hartree
54 double window = 0.1 / 27.211386245988;
55 // per-atom Mulliken population of a frontier orbital above which a
56 // neighbouring atom is added
57 double threshold = 0.0025;
58 bool include_virtuals = false;
59 };
60
61 struct Report {
62 std::vector<Index> atoms; // final active atoms, sorted
63 std::vector<Index> added; // atoms added by the growth
64 std::vector<Index> orbitals; // frontier orbitals (MO indices)
65 Eigen::VectorXd energies; // their energies
66 Eigen::VectorXd coverage_input; // population on the input region
67 Eigen::VectorXd coverage_final; // population on the final region
68 // atoms above the threshold in molecules without active atoms (no
69 // bond path to the region; add them by hand if they belong to it)
70 std::vector<Index> unreachable;
71 // inactive heavy atoms bonded to two or more active atoms: leaving them
72 // out cuts several bonds (e.g. a ring atom); grow adds them
73 std::vector<Index> enclosed;
74 // inactive hydrogens bonded to an active atom; grow adds them
75 std::vector<Index> cut_hydrogens;
76 std::string Format() const;
77 };
78
80 static std::vector<std::vector<Index>> BondGraph(const QMMolecule& mol);
81
84 static Eigen::MatrixXd AtomPopulations(const Orbitals& orb,
85 const Eigen::MatrixXd& mos);
86
93 static void CheckConnected(const QMMolecule& mol,
94 const std::vector<Index>& active);
95
105 static Report Evaluate(const Orbitals& full, const std::vector<Index>& active,
106 const Options& options);
107};
108
109} // namespace xtp
110} // namespace votca
111
112#endif // VOTCA_XTP_ACTIVEREGION_H
Checks and grows the active region of a projection-based embedding from the frontier orbitals of the ...
static Report Evaluate(const Orbitals &full, const std::vector< Index > &active, const Options &options)
Checks the input region, and with options.grow adds every atom whose population in a frontier orbital...
static Eigen::MatrixXd AtomPopulations(const Orbitals &orb, const Eigen::MatrixXd &mos)
static std::vector< std::vector< Index > > BondGraph(const QMMolecule &mol)
Bonded neighbours of each atom (covalent radii, factor 1.2).
static void CheckConnected(const QMMolecule &mol, const std::vector< Index > &active)
Throws unless the active atoms of every molecule (connected component of the bond graph) form a singl...
Container for molecular orbitals and derived one-particle data.
Definition orbitals.h:47
Provides a means for comparing floating point numbers.
Definition basebead.h:33
std::vector< Index > enclosed
std::vector< Index > orbitals
std::vector< Index > cut_hydrogens
std::vector< Index > unreachable