1#ifndef ABACUS_LR_SPECTRUM_WEIGHTS_H
2#define ABACUS_LR_SPECTRUM_WEIGHTS_H
13 return nspin_global == 1 ? 0.5 * ks_weight : ks_weight;
18inline std::vector<double>
spatial_k_weights(
const std::vector<double>& ks_weights,
const int nspin_global)
20 std::vector<double> weights(ks_weights);
21 for (
double& weight : weights)
32 const std::complex<double>& velocity,
const T& x,
const T& y,
33 const double gap,
const bool use_ks_gap,
const std::vector<double>& weights,
34 const int spin,
const int ik,
const int nk)
36 const double weight = weights[spin * nk + ik] * nk;
37 const std::complex<double> excitation = velocity * x;
38 const std::complex<double> deexcitation = std::conj(velocity) * y;
41 return (excitation - deexcitation) * (weight / gap);
43 return (excitation + deexcitation) * weight;
#define T
Definition exp.cpp:237
Definition exciton_plotter.cpp:368
std::complex< double > weighted_velocity_transition(const std::complex< double > &velocity, const T &x, const T &y, const double gap, const bool use_ks_gap, const std::vector< double > &weights, const int spin, const int ik, const int nk)
Definition spectrum_weights.h:31
double spatial_k_weight(const double ks_weight, const int nspin_global)
Definition spectrum_weights.h:11
std::vector< double > spatial_k_weights(const std::vector< double > &ks_weights, const int nspin_global)
Definition spectrum_weights.h:18