votca 2026-dev
Loading...
Searching...
No Matches
ipodcoupling.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_IPODCOUPLING_H
22#define VOTCA_XTP_IPODCOUPLING_H
23
24// VOTCA includes
26
27// Local VOTCA includes
28#include "votca/xtp/atom.h"
29#include "votca/xtp/orbitals.h"
31
32namespace votca {
33namespace xtp {
34
49class IPodCoupling final : public ParallelXJobCalc<std::vector<Job> > {
50 public:
51 std::string Identify() const { return "ipodcoupling"; }
52 Job::JobResult EvalJob(const Topology& top, Job& job, QMThread& opThread);
53 void WriteJobFile(const Topology& top);
54 void ReadJobFile(Topology& top);
55
56 protected:
57 void ParseSpecificOptions(const tools::Property& user_options);
58
59 private:
60 void SetJobToFailed(Job::JobResult& jres, Logger& pLog,
61 const std::string& errormessage);
62 void WriteLoggerToFile(const std::string& logfile, Logger& logger);
63
64 // Returns the "j" value (stored in eV) of the coupling element of podprop
65 // with the given levelA/levelB, converted to Hartree; NaN if the levels
66 // were outside the range computed in EvalJob. As in
67 // IQM::GetDFTCouplingFromProp (iqm.cc).
68 double GetPODCouplingFromProp(const tools::Property& podprop, Index levelA,
69 Index levelB) const;
70
71 // Returns the atom of seg whose external bond points to segment
72 // target_segment_id (a segment may have external bonds to several
73 // segments). Throws if there is none, i.e. if the bond path reported by
74 // FindLinkingSegments() does not exist at the atom level; a silent
75 // fallback would produce a wrong supermolecule geometry.
77 Index target_segment_id) const;
78
79 // Returns PBC-corrected copies of the linker segments (the Topology is
80 // not modified, as for QMPair::Seg2PbCopy()). Walks the covalent chain
81 // seg1_positioned -> linkers[0] -> ... -> seg2_positioned one bond at a
82 // time with Topology::PbShortestConnect(), anchored on the bonded
83 // boundary atoms (FindBoundaryAtomTowardSegment) rather than on centers
84 // of mass, which can be far from the bond in large segments.
85 //
86 // seg1_positioned and seg2_positioned must already be positioned
87 // (typically seg1 and pair->Seg2PbCopy()). The last hop to
88 // seg2_positioned is validated like all others and throws if broken.
89 std::vector<Segment> PositionLinkersAlongChain(
90 const Topology& top, const Segment& seg1_positioned,
91 const std::vector<const Segment*>& linkers,
92 const Segment& seg2_positioned) const;
93
96
97 // numberofstatesA/B of PODCoupling::CalculateCouplings, read from the
98 // "levA"/"levB" options as in the podcoupling tool. Unlike that tool,
99 // the fragments are derived from the segment mapping, not user input.
102
103 // Include linking segments found by Topology::FindLinkingSegments
104 // (default off, as in IQM). Selection is by covalent connectivity
105 // between seg_A and seg_B, not by a segment-type list as in IQM's
106 // linker_names; the number of linkers is not capped.
107 bool include_linkers_ = false;
108
109 // Tasks, as in IQM, plus "podcoupling".
110 bool do_dft_input_ = false;
111 bool do_dft_run_ = false;
112 bool do_dft_parse_ = false;
113 bool do_podcoupling_ = false;
114
115 bool store_dft_ = false;
116};
117
118} // namespace xtp
119} // namespace votca
120#endif // VOTCA_XTP_IPODCOUPLING_H
class to manage program options with xml serialization functionality
Definition property.h:55
H-saturated, DFT + POD2-based electronic coupling calculator.
void WriteJobFile(const Topology &top)
std::string Identify() const
Calculator name.
void ParseSpecificOptions(const tools::Property &user_options)
std::vector< Segment > PositionLinkersAlongChain(const Topology &top, const Segment &seg1_positioned, const std::vector< const Segment * > &linkers, const Segment &seg2_positioned) const
void ReadJobFile(Topology &top)
tools::Property podcoupling_options_
Job::JobResult EvalJob(const Topology &top, Job &job, QMThread &opThread)
const Atom & FindBoundaryAtomTowardSegment(const Segment &seg, Index target_segment_id) const
tools::Property dftpackage_options_
void WriteLoggerToFile(const std::string &logfile, Logger &logger)
void SetJobToFailed(Job::JobResult &jres, Logger &pLog, const std::string &errormessage)
double GetPODCouplingFromProp(const tools::Property &podprop, Index levelA, Index levelB) const
Logger is used for thread-safe output of messages.
Definition logger.h:164
Container for segments and box and atoms.
Definition topology.h:41
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26