|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <gtest/gtest.h>#include <cmath>#include <vector>#include "source_base/matrix.h"#include "../grad_degen.h"Functions | |
| TEST (GradMatrixDegenerate, PolarizationRecoversBilinearForm) | |
| The whole point: route A2 reproduces the bilinear form exactly, off-diagonal included. | |
| TEST (GradMatrixDegenerate, IsSymmetric) | |
| G is symmetric by construction; assert it so a future refactor cannot lose it silently. | |
| TEST (GradMatrixDegenerate, RotationCovariance) | |
| TEST (GradMatrixDegenerate, TraceIsBasisInvariantButDiagonalIsNot) | |
| TEST (GradMatrixDegenerate, CombineNormalizedKeepsNorm) | |
| TEST (GradMatrixDegenerate, PairOrder) | |
| TEST (GradMatrixDegenerate, GroupingCollectsMultiplets) | |
| TEST (GradMatrixDegenerate, GroupingSortsAndHandlesEdgeCases) | |
| TEST (GradMatrixDegenerate, GroupingDoesNotChain) | |
| TEST (GradMatrixDegenerate, AssemblesModuleBaseMatrix) | |
| The template has to work on the type the driver actually uses. | |
| TEST | ( | GradMatrixDegenerate | , |
| AssemblesModuleBaseMatrix | ) |
The template has to work on the type the driver actually uses.
| TEST | ( | GradMatrixDegenerate | , |
| CombineNormalizedKeepsNorm | ) |
| TEST | ( | GradMatrixDegenerate | , |
| GroupingCollectsMultiplets | ) |
| TEST | ( | GradMatrixDegenerate | , |
| GroupingDoesNotChain | ) |
Anchoring to the group's first member, not the predecessor: a ladder of steps each below thr must NOT chain into one group whose total spread exceeds it.
| TEST | ( | GradMatrixDegenerate | , |
| GroupingSortsAndHandlesEdgeCases | ) |
| TEST | ( | GradMatrixDegenerate | , |
| IsSymmetric | ) |
G is symmetric by construction; assert it so a future refactor cannot lose it silently.
| TEST | ( | GradMatrixDegenerate | , |
| PairOrder | ) |
| TEST | ( | GradMatrixDegenerate | , |
| PolarizationRecoversBilinearForm | ) |
The whole point: route A2 reproduces the bilinear form exactly, off-diagonal included.
| TEST | ( | GradMatrixDegenerate | , |
| RotationCovariance | ) |
Section 5.4.5(ii), the strongest check: rotating the basis of the degenerate subspace must rotate G, $G'=U^\top G U$. This is what would fail if the pipeline were not a pure quadratic form, and it needs no finite differences.
| TEST | ( | GradMatrixDegenerate | , |
| TraceIsBasisInvariantButDiagonalIsNot | ) |
The trace is basis-invariant while the individual diagonal elements are not – the reason the validation tables compare group means (section 1.1).