28 std::vector<Index> vStart, std::vector<Index> vTarget)
const {
29 if (vStart.size() != vTarget.size()) {
30 throw std::runtime_error(
31 "Can't compute transpositions, reorder vectors have different "
34 std::vector<Transposition> transpositions;
35 for (
Index i = 0; i < static_cast<Index>(vStart.size()); i++) {
36 std::vector<Index>::iterator it;
37 it = std::find(vStart.begin(), vStart.end(), vTarget[i]);
38 Index pos = std::distance(vStart.begin(), it);
39 std::swap(vStart[i], vStart[pos]);
44 return transpositions;
49 return std::vector<Index>{input.begin() + start,
50 input.begin() + start + size};
54 std::array<Index, 49> multipliers,
bool reverse)
55 : multipliers_(multipliers), reorder_(reorder), reverse_(reverse) {
58 Index currentFunction = 0;
59 for (
int l = 0; l < 7; l++) {
70 currentFunction += nrOfFunctions;
77 for (
const AOShell& shell : basis) {
78 Index currentFunction = shell.getStartIndex();
82 std::vector<Index> shellmultiplier =
86 for (
Index i = 0; i < shell.getNumFunc(); i++) {
87 moCoefficients.row(currentFunction + i) *= double(shellmultiplier[i]);
94 moCoefficients.row(currentFunction + transposition.first)
95 .swap(moCoefficients.row(currentFunction + transposition.second));
100 std::vector<Index> shellmultiplier =
104 for (
Index i = 0; i < shell.getNumFunc(); i++) {
105 moCoefficients.row(currentFunction + i) *= double(shellmultiplier[i]);
114 Matrixoperator.transposeInPlace();
116 Matrixoperator.transposeInPlace();
Container to hold Basisfunctions for all atoms.
std::vector< Transposition > computeTranspositions(std::vector< Index > vStart, std::vector< Index > vTarget) const
OrbTranspositions transpositions_
OrbReorder(std::array< Index, 49 > reorder, std::array< Index, 49 > multipliers, bool reverse=false)
std::array< Index, 49 > reorder_
void reorderOrbitals(Eigen::MatrixXd &moCoefficients, const AOBasis &basis)
void reorderOperator(Eigen::MatrixXd &Matrixoperator, const AOBasis &basis)
std::vector< Index > copySegment(const std::array< Index, 49 > &input, Index start, Index size) const
std::array< Index, 49 > votcaOrder_
std::array< Index, 49 > multipliers_
std::pair< Index, Index > Transposition
base class for all analysis tools