ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
grad_degen.h File Reference
#include <cstddef>
#include <utility>
#include <vector>
Include dependency graph for grad_degen.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LR::JTDirection
 The outcome of the Jahn-Teller search: the displacement direction that lowers one branch of the multiplet fastest, and the electronic state that follows it. More...

Namespaces

namespace  LR

Functions

std::vector< std::vector< int > > LR::group_degenerate_states (const std::vector< double > &omega, const double thr)
 Split states into multiplets of (near-)degenerate excitation energies.
std::vector< std::pair< int, int > > LR::degenerate_pairs (const int d)
 The $(k,l)$, $k<l$ pairs of a $d$-dimensional multiplet, lexicographically.
template<typename T>
void LR::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.
template<typename TMat>
std::vector< std::vector< TMat > > LR::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, i.e. route (A2) above.
JTDirection LR::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 fast as possible.
std::vector< double > LR::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 the degeneracy.

Detailed Description

Algebra of the degenerate-subspace gradient matrix $G^{(A\alpha)}_{kl}=\langle X_k|\partial A/\partial R_{A\alpha}|X_l\rangle$.

At a $d$-fold degeneracy no single state has a gradient vector: the branch slopes along a displacement $u$ are the eigenvalues of $M(u)=\sum_{A\alpha}u_{A\alpha}G^{(A\alpha)}$, whose eigenvectors depend on $u$. The full first-order object is $3N$ matrices of size $d\times d$, and only $\operatorname{Tr}M$ is basis-invariant.

The per-state analytic gradient implemented in esolver_lr_grad.cpp is, restricted to one multiplet, a quadratic form in the excitation vector: every ingredient ($D^X$, $T$, $R$, $Z$, $D^Z$, $W^X$, $\Lambda$) is built from $X\otimes X$, the CPSCF operator $L$ depends only on the ground state, and $\Omega$ is a constant inside the multiplet. Write it $\mathcal F[X]$. Because every $X$ in the degenerate subspace is itself a legitimate eigenvector with the same $\Omega$, $\mathcal F[X]=G[X,X]$ holds on the whole diagonal – and a symmetric bilinear form is determined by its diagonal. So the existing code already contains all of $G$; it has only ever been evaluated on the basis the diagonalizer happened to return.

Recovering the off-diagonal elements is then the polarization identity. With $X_\pm=(X_k\pm X_l)/\sqrt2$ and $\mathcal F[\alpha X]=\alpha^2\mathcal F[X]$, (A1) $G_{kl}=\tfrac12(\mathcal F[X_+]-\mathcal F[X_-])$, (A2) $G_{kl}=\mathcal F[X_+]-\tfrac12(G_{kk}+G_{ll})$, and (A2) reuses the $d$ diagonal gradients the code already computes, so the whole matrix costs $d(d+1)/2$ evaluations – exactly its number of independent components.

The construction admits two checks that need no finite differences and are worth running on any new case: $\mathcal F[2X]=4\mathcal F[X]$ (it is a quadratic form at all), and covariance under a rotation of the subspace basis, $\mathcal F[X'_k]=(U^\top GU)_{kk}$ with $X'_k=\sum_lU_{lk}X_l$. Both are exercised in test/test_grad_degen.cpp.

The alternative – deriving an explicitly bilinear Z-vector right-hand side that takes two different $X$ – yields the same $G$, but it has to re-derive every factor and hand-polarize the $g^{xc}$ potential, so it is the more expensive and more error-prone route.

This header holds only the basis-independent bookkeeping, so that it is unit-testable without a ground state: grouping states into multiplets, enumerating the pairs, forming the normalized combination, and assembling $G$. Everything needing the parallel layout or the Z-vector solver stays in esolver_lr_grad.cpp.