Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #379 from votca/for/stable/merge_master
Browse files Browse the repository at this point in the history
Merge bugfixes from master
  • Loading branch information
junghans authored Feb 10, 2020
2 parents 65fdaee + 7e3fc38 commit eee367d
Show file tree
Hide file tree
Showing 179 changed files with 289,499 additions and 1,996 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ For more detailed information about the changes see the history of the
* fix copyright (#363)
* remove old doxygen target (#365)
* fix some gcc10 warnings (#376)
* Add external fields to dft calculations (#351, #353)
* added def2 and cc basis sets (#355)
* added apdft (#350)
* added test to cubefile reader (#344)
* fix state tracker (#333)
* grid class refator (#335)
* changed ppm screening (#371)

## Version 1.6_rc1 (released 04.12.19)
* completely new statefile in hdf5 format for larger systems
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![codecov](https://codecov.io/gh/votca/xtp/branch/master/graph/badge.svg)](https://codecov.io/gh/votca/xtp)
[![Build Status](https://travis-ci.org/votca/xtp.svg?branch=master)](https://travis-ci.org/votca/xtp)
[![pipeline status](https://gitlab.com/votca/xtp/badges/master/pipeline.svg)](https://gitlab.com/votca/xtp/commits/master)
[![DOI](https://zenodo.org/badge/50048374.svg)](https://zenodo.org/badge/latestdoi/50048374)

VOTCA-XTP is a library which allows you to calculate the electronic properties of organic materials, e.g.
- excited state properties via GW-BSE
Expand Down
47 changes: 47 additions & 0 deletions include/votca/xtp/IndexParser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2009-2019 The VOTCA Development Team
* (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License")
*
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#pragma once
#ifndef VOTCA_XTP_INDEXPARSER_H
#define VOTCA_XTP_INDEXPARSER_H

#include <string>
#include <vector>
#include <votca/tools/types.h>

/**
* \brief Parser to read strings containing indexes in the format "1 2:7 8"
* and returning a sorted expanded std::vector<Index> with only unique entries
* It can also do the opposite
*/

namespace votca {
namespace xtp {

class IndexParser {
public:
std::vector<Index> CreateIndexVector(const std::string& Ids) const;

std::string CreateIndexString(const std::vector<Index>& indeces) const;
};

} // namespace xtp
} // namespace votca

#endif // VOTCA_XTP_ATOMCONTAINER_H
45 changes: 45 additions & 0 deletions include/votca/xtp/amplitude_integration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2009-2019 The VOTCA Development Team
* (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License")
*
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#pragma once
#ifndef XTP_AMPLITUDE_INTEGRATION_H
#define XTP_AMPLITUDE_INTEGRATION_H

#include <votca/xtp/aobasis.h>
#include <votca/xtp/eigen.h>
#include <votca/xtp/regular_grid.h>
namespace votca {
namespace xtp {

template <class Grid>
class AmplitudeIntegration {
public:
explicit AmplitudeIntegration(const Grid& grid) : _grid(grid){};

std::vector<std::vector<double> > IntegrateAmplitude(
const Eigen::VectorXd& amplitude);

private:
std::vector<std::vector<double> > SetupAmplitudeContainer();
const Grid _grid;
};

} // namespace xtp
} // namespace votca
#endif // XTP_NUMERICAL_INTEGRATION_H
2 changes: 1 addition & 1 deletion include/votca/xtp/bse_population.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct BSE_Population {
if (pop.H.size() < 1) {
return out;
}
Eigen::VectorXd diff = pop.H - pop.E;
Eigen::VectorXd diff = pop.H + pop.E;
out << "GroundstateCharge:" << pop.Gs << "\n";
out << "Index hole electron dQ Qeff\n";
for (Index i = 0; i < pop.H.size(); ++i) {
Expand Down
55 changes: 55 additions & 0 deletions include/votca/xtp/cubefile_writer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2009-2019 The VOTCA Development Team
* (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License")
*
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#pragma once
#ifndef VOTCA_XTP_CUBEFILE_WRITER_H
#define VOTCA_XTP_CUBEFILE_WRITER_H

#include <votca/xtp/logger.h>
#include <votca/xtp/orbitals.h>
#include <votca/xtp/regular_grid.h>
/**
* \brief Writes an orbital file to a .cube file
*/

namespace votca {
namespace xtp {
class CubeFile_Writer {

public:
CubeFile_Writer(Eigen::Array<Index, 3, 1> steps, double padding, Logger& log)
: _steps(steps), _padding(padding), _log(log){};

void WriteFile(const std::string& filename, const Orbitals& orb,
QMState state, bool dostateonly) const;

private:
std::vector<std::vector<double> > CalculateValues(
const Orbitals& orb, QMState state, bool dostateonly,
const Regular_Grid& grid) const;

Eigen::Array<Index, 3, 1> _steps;
double _padding;
Logger& _log;
};

} // namespace xtp
} // namespace votca

#endif // VOTCA_XTP_CUBEFILE_WRITER_H
10 changes: 5 additions & 5 deletions include/votca/xtp/davidsonsolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,18 @@ class DavidsonSolver {
// target the lowest diagonal element
ProjectedSpace proj = initProjectedSpace(neigen, size_initial_guess);
RitzEigenPair rep;
XTP_LOG(Log::error, _log)
<< TimeStamp() << " iter\tSearch Space\tNorm" << flush;

for (_i_iter = 0; _i_iter < _iter_max; _i_iter++) {

bool do_restart = (proj.search_space() > _max_search_space);

if (do_restart) {
restart(rep, proj, size_initial_guess);

} else {
updateProjection(A, proj);
rep = getGuessVectors(A, proj);
extendProjection(rep, proj);
}
updateProjection(A, proj);
rep = getGuessVectors(A, proj);

printIterationData(rep, proj, neigen);

Expand All @@ -108,6 +107,7 @@ class DavidsonSolver {
storeNotConvergedData(rep, proj.root_converged, neigen);
break;
}
extendProjection(rep, proj);
}

printTiming(start);
Expand Down
62 changes: 62 additions & 0 deletions include/votca/xtp/density_integration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright 2009-2019 The VOTCA Development Team
* (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License")
*
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#pragma once
#ifndef XTP_DENSITY_INTEGRATION_H
#define XTP_DENSITY_INTEGRATION_H

#include <votca/xtp/aobasis.h>
#include <votca/xtp/eigen.h>
#include <votca/xtp/regular_grid.h>
#include <votca/xtp/vxc_grid.h>
namespace votca {
namespace xtp {

struct Gyrationtensor {
double mass;
Eigen::Vector3d centroid;
Eigen::Matrix3d gyration;
};

template <class Grid>
class DensityIntegration {
public:
explicit DensityIntegration(const Grid& grid) : _grid(grid){};

double IntegrateDensity(const Eigen::MatrixXd& density_matrix);
double IntegratePotential(const Eigen::Vector3d& rvector) const;
Eigen::Vector3d IntegrateField(const Eigen::Vector3d& rvector) const;
Eigen::MatrixXd IntegratePotential(const AOBasis& externalbasis) const;

Gyrationtensor IntegrateGyrationTensor(const Eigen::MatrixXd& density_matrix);

const std::vector<std::vector<double> >& getDensities() const {
return _densities;
}

private:
void SetupDensityContainer();
const Grid _grid;

std::vector<std::vector<double> > _densities;
};

} // namespace xtp
} // namespace votca
#endif // XTP_NUMERICAL_INTEGRATION_H
20 changes: 12 additions & 8 deletions include/votca/xtp/dftengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
#include <votca/xtp/convergenceacc.h>
#include <votca/xtp/ecpaobasis.h>
#include <votca/xtp/logger.h>
#include <votca/xtp/numerical_integrations.h>
#include <votca/xtp/staticsite.h>
#include <votca/xtp/vxc_grid.h>
#include <votca/xtp/vxc_potential.h>

namespace votca {
namespace xtp {
Expand Down Expand Up @@ -60,6 +61,8 @@ class DFTEngine {
private:
void Prepare(QMMolecule& mol);

Vxc_Potential<Vxc_Grid> SetupVxc(const QMMolecule& mol);

Eigen::MatrixXd OrthogonalizeGuess(const Eigen::MatrixXd& GuessMOs) const;
void PrintMOs(const Eigen::VectorXd& MOEnergies, Log::Level level);
void CalcElDipole(const Orbitals& orb) const;
Expand All @@ -76,12 +79,14 @@ class DFTEngine {
Mat_p_Energy IntegrateExternalDensity(const QMMolecule& mol,
const Orbitals& extdensity) const;

Eigen::MatrixXd IntegrateExternalField(const QMMolecule& mol) const;

tools::EigenSystem IndependentElectronGuess(const Mat_p_Energy& H0) const;
tools::EigenSystem ModelPotentialGuess(const Mat_p_Energy& H0,
const QMMolecule& mol) const;
tools::EigenSystem ModelPotentialGuess(
const Mat_p_Energy& H0, const QMMolecule& mol,
const Vxc_Potential<Vxc_Grid>& vxcpotential) const;

Eigen::MatrixXd AtomicGuess(const QMMolecule& mol) const;
std::string ReturnSmallGrid(const std::string& largegrid);

Eigen::MatrixXd RunAtomicDFT_unrestricted(const QMAtom& uniqueAtom) const;

Expand Down Expand Up @@ -112,10 +117,6 @@ class DFTEngine {

// numerical integration Vxc
std::string _grid_name;
std::string _grid_name_small;
bool _use_small_grid;
NumericalIntegration _gridIntegration;
NumericalIntegration _gridIntegration_small;

// AO Matrices
AOOverlap _dftAOoverlap;
Expand Down Expand Up @@ -145,6 +146,9 @@ class DFTEngine {
std::string _orbfilename;
std::string _gridquality;
std::string _state;

Eigen::Vector3d _extfield = Eigen::Vector3d::Zero();
bool _integrate_ext_field = false;
};

} // namespace xtp
Expand Down
48 changes: 48 additions & 0 deletions include/votca/xtp/filterfactory.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright 2009-2019 The VOTCA Development Team
* (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License")
*
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#pragma once
#ifndef VOTCA_XTP_FILTERFACTORY_H
#define VOTCA_XTP_FILTERFACTORY_H

#include <votca/tools/objectfactory.h>
#include <votca/xtp/statefilter_base.h>

namespace votca {
namespace xtp {

class FilterFactory
: public tools::ObjectFactory<std::string, StateFilter_base> {
private:
FilterFactory() = default;

public:
static void RegisterAll(void);
friend FilterFactory &Filter();
};

inline FilterFactory &Filter() {
static FilterFactory _instance;
return _instance;
}

} // namespace xtp
} // namespace votca

#endif // VOTCA_XTP_QMPACKAGEFACTORY_H
Loading

0 comments on commit eee367d

Please sign in to comment.