46 double mean = std::reduce(v.begin(), v.end()) / ((double)v.size());
47 double sq_sum = std::inner_product(v.begin(), v.end(), v.begin(), 0.0);
48 double stdev = std::sqrt(sq_sum / ((
double)v.size()) - mean * mean);
55 std::vector<double> individual_timings;
56 individual_timings.reserve(repetitions);
58 std::cout << name << std::endl;
59 for (
Index i = 0; i < repetitions; i++) {
60 std::chrono::time_point<std::chrono::steady_clock> start =
61 std::chrono::steady_clock::now();
63 std::chrono::time_point<std::chrono::steady_clock> end =
64 std::chrono::steady_clock::now();
65 individual_timings.push_back(
66 std::chrono::duration_cast<std::chrono::duration<double> >(end - start)
71 if (count != repetitions) {
72 std::cout <<
"sth went wrong with the count" << std::endl;
75 std::cout <<
"avg:" << mean1 <<
" std:" << std1 << std::endl;
77 output.
add(
"avg", std::to_string(mean1));
78 output.
add(
"std", std::to_string(std1));
80 for (
double time : individual_timings) {
81 runs.
add(
"timing", std::to_string(time));
90 std::cout <<
"\n\nCreating benchmark for " <<
job_name_ <<
".orb"
95 std::cout <<
"Repetitions:" <<
repetitions_ << std::endl;
105 std::cout <<
"BasisSet:" << basis.
Name() <<
" size:" << basis.
AOBasisSize()
107 std::cout <<
"AuxBasisSet:" << auxbasis.
Name()
108 <<
" size:" << auxbasis.
AOBasisSize() << std::endl;
118 output.
add(
"Basisset", basis.
Name());
120 output.
add(
"AuxBasisset", auxbasis.
Name());
121 output.
add(
"AuxBasissetsize", std::to_string(auxbasis.
AOBasisSize()));
146 double frequency = 0.5;
147 Eigen::MatrixXd result =
156 frequency += result.sum();
158 Eigen::MatrixXd Hqp_fake = Eigen::MatrixXd::Random(hqp_size, hqp_size);
159 Eigen::VectorXd epsilon_inv_fake = result.diagonal();
172 HxOperator hx_op(epsilon_inv_fake, Mmn, Hqp_fake);
174 Index spacesize = 100;
175 Eigen::MatrixXd state = Eigen::MatrixXd::Random(s_op.
size(), spacesize);
176 Eigen::MatrixXd result_op = Eigen::MatrixXd::Zero(s_op.
size(), spacesize);
180 result_op += s_op * state;
187 result_op += t_op * state;
194 result_op += sbtda_op * state;
201 result_op += hx_op * state;
205 std::ofstream outputfile;
207 outputfile << output << std::endl;
209 frequency += result_op.sum();
Container to hold Basisfunctions for all atoms.
Index AOBasisSize() const
const std::string & Name() const
void configure(BSEOperator_Options opt)
void ParseOptions(const tools::Property &user_options)
Logger is used for thread-safe output of messages.
Container for molecular orbitals and derived one-particle data.
Index getHomo() const
Return the default HOMO index used by spin-agnostic callers.
Index getBSEcmax() const
Return the highest conduction orbital included in BSE.
const AOBasis & getAuxBasis() const
Return the auxiliary AO basis, throwing if it has not been initialized.
Index getBSEvmin() const
Return the lowest valence orbital included in BSE.
Index getRPAmax() const
Return the upper RPA orbital index.
Index getGWAmin() const
Return the lower GW orbital index.
const tools::EigenSystem & MOs() const
Return read-only access to alpha/restricted molecular orbitals.
Index getGWAmax() const
Return the upper GW orbital index.
void ReadFromCpt(const std::string &filename)
Read the orbital container from a checkpoint file on disk.
Index getRPAmin() const
Return the lower RPA orbital index.
const AOBasis & getDftBasis() const
Return the DFT AO basis, throwing if it has not been initialized.
Eigen::MatrixXd calculate_epsilon_i(double frequency) const
void setRPAInputEnergies(const Eigen::VectorXd &rpaenergies)
Eigen::MatrixXd calculate_epsilon_r(double frequency) const
void configure(Index homo, Index rpamin, Index rpamax)
void Fill(const AOBasis &auxbasis, const AOBasis &dftbasis, const Eigen::MatrixXd &dft_orbitals)
void Initialize(Index basissize, Index mmin, Index mmax, Index nmin, Index nmax)
void MultiplyRightWithAuxMatrix(const Eigen::MatrixXd &matrix)
Charge transport classes.
tools::Property RunPart(T &&payload, const std::string &name, Index repetitions)
bool XTP_HAS_MKL_OVERLOAD()
BSE_OPERATOR< 1, 2, 1, 0 > SingletOperator_TDA
BSE_OPERATOR< 1, 0, 1, 0 > TripletOperator_TDA
BSE_OPERATOR< 0, 2, 0, 1 > SingletOperator_BTDA_B
BSE_OPERATOR< 0, 1, 0, 0 > HxOperator
std::pair< double, double > CalcStatistics(const std::vector< double > &v)
Provides a means for comparing floating point numbers.