33 bool do_amplitude = (state.
Type().isSingleParticleState());
35 Eigen::VectorXd amplitude;
60 const std::vector<std::vector<double>>& gridvalues) {
62 for (
const auto& box : gridvalues) {
63 size +=
Index(box.size());
65 std::vector<double> result;
67 for (
const auto& box : gridvalues) {
68 result.insert(result.end(), box.begin(), box.end());
75 bool dostateonly)
const {
78 Eigen::Array3d padding = Eigen::Array3d::Ones() *
padding_;
87 bool do_amplitude = (state.
Type().isSingleParticleState());
88 std::ofstream out(filename);
90 throw std::runtime_error(
"Bad file handle: " + filename);
95 out << boost::format(
"Transition state: %1$s \n") % state.
ToString();
96 }
else if (do_amplitude) {
97 out << boost::format(
"%1$s with energy %2$f eV \n") % state.
ToString() %
101 out << boost::format(
102 "Difference electron density of excited state %1$s \n") %
105 out << boost::format(
"Total electron density of %1$s state\n") %
110 out <<
"Created by VOTCA-XTP \n";
112 out << boost::format(
"-%1$lu %2$f %3$f %4$f \n") % orb.
QMAtoms().
size() %
113 start.x() % start.y() % start.z();
115 out << boost::format(
"%1$lu %2$f %3$f %4$f \n") % orb.
QMAtoms().
size() %
116 start.x() % start.y() % start.z();
118 Eigen::Array<Index, 3, 1> steps = grid.
getSteps();
120 out << boost::format(
"%1$d %2$f 0.0 0.0 \n") % steps.x() % stepsizes.x();
121 out << boost::format(
"%1$d 0.0 %2$f 0.0 \n") % steps.y() % stepsizes.y();
122 out << boost::format(
"%1$d 0.0 0.0 %2$f \n") % steps.z() % stepsizes.z();
125 double x = atom.getPos().x();
126 double y = atom.getPos().y();
127 double z = atom.getPos().z();
128 std::string element = atom.getElement();
130 Index crg = atom.getNuccharge();
131 out << boost::format(
"%1$d %2$d %3$f %4$f %5$f\n") % atnum % crg % x % y %
136 out << boost::format(
" 1 %1$d \n") % (state.
StateIdx() + 1);
139 Eigen::TensorMap<Eigen::Tensor<double, 3>> gridvalues(
140 grid_values.data(), steps.z(), steps.y(), steps.x());
141 for (
Index ix = 0; ix < steps.x(); ix++) {
142 for (
Index iy = 0; iy < steps.y(); iy++) {
144 for (
Index iz = 0; iz < steps.z(); iz++) {
145 out << boost::format(
"%1$E ") % gridvalues(iz, iy, ix);
147 if (Nrecord == 6 || iz == (steps.z() - 1)) {
Container to hold Basisfunctions for all atoms.
std::vector< std::vector< double > > IntegrateAmplitude(const Eigen::VectorXd &litude)
void WriteFile(const std::string &filename, const Orbitals &orb, QMState state, bool dostateonly) const
std::vector< std::vector< double > > CalculateValues(const Orbitals &orb, QMState state, bool dostateonly, const Regular_Grid &grid) const
Eigen::Array< Index, 3, 1 > steps_
const std::vector< std::vector< double > > & getDensities() const
double IntegrateDensity(const Eigen::MatrixXd &density_matrix)
container for molecular orbitals
Eigen::MatrixXd CalculateQParticleAORepresentation() const
Eigen::MatrixXd DensityMatrixWithoutGS(const QMState &state) const
Eigen::MatrixXd DensityMatrixFull(const QMState &state) const
const Eigen::MatrixXd & getLMOs() const
double getExcitedStateEnergy(const QMState &state) const
const tools::EigenSystem & MOs() const
const QMMolecule & QMAtoms() const
const std::string & getDFTbasisName() const
const AOBasis & getDftBasis() const
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
std::string ToString() const
bool isTransition() const
const QMStateType & Type() const
Eigen::Vector3d getStartingPoint() const
Eigen::Array< Index, 3, 1 > getSteps() const
void GridSetup(const Eigen::Array< Index, 3, 1 > &steps, const Eigen::Array3d &padding, const QMMolecule &atoms, const AOBasis &basis)
Eigen::Array3d getStepSizes() const
#define XTP_LOG(level, log)
std::vector< double > FlattenValues(const std::vector< std::vector< double > > &gridvalues)
base class for all analysis tools