1#ifndef ABACUS_SOURCE_LCAO_MODULE_LR_GRAD_DEGEN_H
2#define ABACUS_SOURCE_LCAO_MODULE_LR_GRAD_DEGEN_H
82 const T inv_sqrt2 =
static_cast<T>(0.70710678118654752440);
83 for (
size_t i = 0; i < nloc; ++i)
85 Xplus[i] = inv_sqrt2 * (Xk[i] + Xl[i]);
99 template <
typename TMat>
101 const std::vector<TMat>& plus,
102 const std::vector<std::pair<int, int>>& pairs)
104 const int d =
static_cast<int>(diag.size());
105 std::vector<std::vector<TMat>> g(d, std::vector<TMat>(d));
106 for (
int k = 0; k < d; ++k)
110 for (
size_t ip = 0; ip < pairs.size(); ++ip)
112 const int k = pairs[ip].first;
113 const int l = pairs[ip].second;
115 const TMat off = plus[ip] - (diag[k] + diag[l]) * 0.5;
191 const std::vector<double>& mixing,
192 std::vector<double>& jt_part);
#define T
Definition exp.cpp:237
Definition esolver_lr_lcao_tddft.h:28
JTDirection find_jt_direction(const std::vector< double > &gflat, const int ncoord, const int d)
Find the Jahn-Teller direction: the displacement that splits the multiplet and lowers one branch as f...
Definition grad_jt.cpp:173
std::vector< double > split_symmetric_part(const std::vector< double > &gflat, const int ncoord, const int d, const std::vector< double > &mixing, std::vector< double > &jt_part)
Split a branch gradient into the part shared by the whole multiplet and the part that actually breaks...
Definition grad_jt.cpp:244
std::vector< std::vector< int > > group_degenerate_states(const std::vector< double > &omega, const double thr)
Split states into multiplets of (near-)degenerate excitation energies.
Definition grad_degen.cpp:10
std::vector< std::vector< TMat > > assemble_grad_matrix(const std::vector< TMat > &diag, const std::vector< TMat > &plus, const std::vector< std::pair< int, int > > &pairs)
Assemble $G_{kl}$ of one multiplet from the diagonal gradients and the combinations,...
Definition grad_degen.h:100
std::vector< std::pair< int, int > > degenerate_pairs(const int d)
The $(k,l)$, $k<l$ pairs of a $d$-dimensional multiplet, lexicographically.
Definition grad_degen.cpp:60
void combine_normalized(const T *const Xk, const T *const Xl, const size_t nloc, T *const Xplus)
$X_+=(X_k+X_l)/\sqrt2$, normalized when $X_k$ and $X_l$ are orthonormal.
Definition grad_degen.h:79
The outcome of the Jahn-Teller search: the displacement direction that lowers one branch of the multi...
Definition grad_degen.h:125
std::vector< double > mixing
$v$, that branch's $d$ coefficients in the multiplet basis
Definition grad_degen.h:127
double slope
$|q(v)|$, the branch's steepest descent rate
Definition grad_degen.h:128
int iterations
iterations used by the winning start
Definition grad_degen.h:130
std::vector< double > displacement
the $3N$ direction, normalized, laid out (atom, xyz)
Definition grad_degen.h:126
int restarts_agreeing
how many starting points reached this same optimum
Definition grad_degen.h:129