votca 2024-dev
Loading...
Searching...
No Matches
orbreorder.h
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#pragma once
21#ifndef VOTCA_XTP_ORBREORDER_H
22#define VOTCA_XTP_ORBREORDER_H
23
24#include <algorithm>
25#include <array>
26
27#include "eigen.h"
28#include "votca/xtp/orbitals.h"
29
30namespace votca {
31namespace xtp {
32
33// structure to store a transposition
34using Transposition = std::pair<Index, Index>;
35
37 public:
38 OrbReorder(std::array<Index, 49> reorder, std::array<Index, 49> multipliers,
39 bool reverse = false);
40
41 ~OrbReorder() = default;
42
43 void reorderOrbitals(Eigen::MatrixXd& moCoefficients, const AOBasis& basis);
44 void reorderOperator(Eigen::MatrixXd& Matrixoperator, const AOBasis& basis);
45
46 private:
47 // structure to store the transpositions for the first 7 shell types (i.e.
48 // s=0, p, d, f, g, h, i=6)
49 using OrbTranspositions = std::array<std::vector<Transposition>, 7>;
50 std::array<Index, 49> multipliers_;
51 std::array<Index, 49> reorder_;
52 // clang-format off
53 // the ordering of the m quantumnumbers for every shell
54 std::array<Index, 49> votcaOrder_={{
55 0, //s
56 -1,0,1, //p
57 -2,-1,0,1,2, //d
58 -3,-2,-1,0,1,2,3, //f
59 -4,-3,-2,-1,0,1,2,3,4, //g
60 -5,-4,-3,-2,-1,0,1,2,3,4,5, // h
61 -6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6 // i
62}};
63
64 // clang-format on
66
67 std::vector<Transposition> computeTranspositions(
68 std::vector<Index> vStart, std::vector<Index> vTarget) const;
69 std::vector<Index> copySegment(const std::array<Index, 49>& input,
70 Index start, Index size) const;
72};
73
74} // namespace xtp
75} // namespace votca
76
77#endif // VOTCA_XTP_ORBREORDER_H
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
std::vector< Transposition > computeTranspositions(std::vector< Index > vStart, std::vector< Index > vTarget) const
Definition orbreorder.cc:27
OrbTranspositions transpositions_
Definition orbreorder.h:65
std::array< Index, 49 > reorder_
Definition orbreorder.h:51
void reorderOrbitals(Eigen::MatrixXd &moCoefficients, const AOBasis &basis)
Definition orbreorder.cc:74
void reorderOperator(Eigen::MatrixXd &Matrixoperator, const AOBasis &basis)
std::vector< Index > copySegment(const std::array< Index, 49 > &input, Index start, Index size) const
Definition orbreorder.cc:47
std::array< Index, 49 > votcaOrder_
Definition orbreorder.h:54
std::array< std::vector< Transposition >, 7 > OrbTranspositions
Definition orbreorder.h:49
std::array< Index, 49 > multipliers_
Definition orbreorder.h:50
std::pair< Index, Index > Transposition
Definition orbreorder.h:34
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26