votca 2026-dev
Loading...
Searching...
No Matches
gaussianwriter.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2021 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_GAUSSIANWRITER_H
22#define VOTCA_XTP_GAUSSIANWRITER_H
23
24// Local VOTCA includes
25#include "votca/xtp/logger.h"
26#include "votca/xtp/orbitals.h"
28#include "votca/xtp/qmtool.h"
29#include <fstream>
30
31namespace votca {
32namespace xtp {
34 public:
35 GaussianWriter(Logger& log) : log_(log) { gaussianMultipliers.fill(-1); }
36
37 ~GaussianWriter() = default;
38
39 void WriteFile(const std::string& basename, const Orbitals& orbitals,
41 0, false),
42 bool diff2gs = false) const;
43
47 void UseBSEOrbitals(bool flag) { use_bse_orbitals_ = flag; }
48
49 private:
51 bool use_bse_orbitals_ = false;
52 Index toGaussianL(L l) const;
53 Eigen::MatrixXd moCoefficients(const Orbitals& orbitals) const;
54 Eigen::VectorXd moEnergies(const Orbitals& orbitals) const;
55 std::string reorderedMOCoefficients(const Orbitals& orbitals) const;
56 std::string densityMatrixToString(const Orbitals& orbitals,
57 const QMState& state, bool diff2gs) const;
58 // Setup the reordering parameters
59 std::array<Index, 49> gaussianMultipliers;
60 // clang-format off
61 // the ordering of the m quantumnumbers for every shell in gaussian
62 std::array<Index, 49> gaussianOrder={{
63 0, //s
64 1,-1,0, //p
65 0,1,-1,2,-2, //d
66 0,1,-1,2,-2,3,-3, //f
67 0,1,-1,2,-2,3,-3,4,-4, //g
68 0,1,-1,2,-2,3,-3,4,-4,5,-5, // h
69 0,1,-1,2,-2,3,-3,4,-4,5,-5,6,-6 // i
70 }};
71 // clang-format on
72};
73
74} // namespace xtp
75} // namespace votca
76
77#endif
std::array< Index, 49 > gaussianMultipliers
std::string densityMatrixToString(const Orbitals &orbitals, const QMState &state, bool diff2gs) const
std::array< Index, 49 > gaussianOrder
std::string reorderedMOCoefficients(const Orbitals &orbitals) const
Eigen::MatrixXd moCoefficients(const Orbitals &orbitals) const
void WriteFile(const std::string &basename, const Orbitals &orbitals, const QMState state=QMState(QMStateType::statetype::Gstate, 0, false), bool diff2gs=false) const
Eigen::VectorXd moEnergies(const Orbitals &orbitals) const
void UseBSEOrbitals(bool flag)
Logger is used for thread-safe output of messages.
Definition logger.h:164
Container for molecular orbitals and derived one-particle data.
Definition orbitals.h:47
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
Definition qmstate.h:135
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26