Skip to content

Commit cdd058b

Browse files
DCM-Uni-PaderbornThomas D. Kuehne
andauthored
Add dense AO spectral localizers and quadratic pseudospectra (#6150)
Co-authored-by: Thomas D. Kuehne <tkuehne@cp2k.org>
1 parent 40c825a commit cdd058b

72 files changed

Lines changed: 8220 additions & 88 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/methods/properties/index.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ raman
1212
nmr
1313
stm_images
1414
inversion_topology
15+
spectral_localizer
16+
quadratic_pseudospectrum
1517
```
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Quadratic pseudospectrum
2+
3+
`FORCE_EVAL / PROPERTIES / QUADRATIC_PSEUDOSPECTRUM` finds states approximately localized in both
4+
position and energy from a converged GPW/GAPW calculation. It reports no topological index and
5+
requires no additional library.
6+
7+
For Hermitian covariant AO observables $A_j$, queries $\lambda_j$, positive weights $w_j$ and
8+
overlap $S$, the generalized eigenproblem is
9+
10+
$$
11+
Q c = q S c,\qquad
12+
Q=\sum_j w_j^2(A_j-\lambda_j S)S^{-1}(A_j-\lambda_j S).
13+
$$
14+
15+
The lowest eigenpairs describe joint approximate states. The output includes $\sqrt{q}$, separate
16+
energy/position residuals and expectation values. States satisfy $c^\dagger S c=1$. Residuals
17+
concern projected finite-basis operators, not exact continuum variances.
18+
19+
```text
20+
&PROPERTIES
21+
&QUADRATIC_PSEUDOSPECTRUM
22+
FORMULATION FINITE
23+
POSITION [bohr] 0 0 0
24+
ENERGY [hartree] 0.0
25+
KAPPA [hartree*bohr^-1] 0.01
26+
NSTATES 2
27+
&STATES
28+
&END
29+
&END
30+
&END
31+
```
32+
33+
## Observables
34+
35+
- `FINITE` uses analytic Cartesian moments. It requires matching `CELL/POISSON PERIODIC NONE`
36+
without explicit k-points.
37+
- `PERIODIC` uses sine/cosine coordinates on the full `MP_GRID` torus at the frozen SCF potential.
38+
Only periodic directions are localized. Nonperiodic mesh dimensions must be one.
39+
- `TRANSLATION` uses analytic translated-Gaussian overlaps for $U(a)\psi(r)=\psi(r+a)$. Specify
40+
repeated `TRANSLATION_VECTOR` and `WAVE_VECTOR` queries and positive `TRANSLATION_SCALE` instead
41+
of `KAPPA`. The target phase is $\exp(i k\cdot a)$ without an additional $2\pi$. This path
42+
includes the full continuum translation norm and reports leakage outside the AO span, rather than
43+
treating compressed AO translation matrices as unitary.
44+
45+
The periodic paths construct a complete analysis torus, independently of SCF symmetry reduction.
46+
`SOC T` uses post-SCF GTH spin-orbit coupling after a restricted calculation with suitable
47+
pseudopotentials.
48+
49+
## Output and limits
50+
51+
`SOLVER DENSE` uses a metric-aware dense reference calculation. `MAX_AO` bounds the complete scalar
52+
AO space, including periodic cells. `EPS_METRIC` rejects ill-conditioned overlap matrices, and
53+
`EPS_EIGEN` bounds eigenpair residuals. `NSTATES` selects the number of states.
54+
55+
The `STATES` print section writes complex AO coefficients. Spin-up precedes spin-down for SOC, with
56+
cell-major ordering inside each spin block on a torus. Individual vectors in a degenerate subspace
57+
are gauge dependent. Compare subspaces, residuals and observables instead of individual
58+
coefficients.
59+
60+
Choose energy, position and scales for the physical question and check basis and size dependence.
61+
Broader examples are available in
62+
[TopologicalCP2K](https://github.com/DCM-Uni-Paderborn/TopologicalCP2K).
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Spectral localizers
2+
3+
`FORCE_EVAL / PROPERTIES / SPECTRAL_LOCALIZER` evaluates a local topological index and protection
4+
gap from the converged GPW/GAPW Hamiltonian and AO overlap. It is independent of Wannier90 and Kubo
5+
transport. No additional library is required.
6+
7+
## Finite systems
8+
9+
For `CELL PERIODIC NONE` and `POISSON PERIODIC NONE`, the operators are the analytic Cartesian AO
10+
moments. For the ordered plane $(X,Y)$, the covariant localizer is
11+
12+
$$
13+
L=\begin{pmatrix}
14+
H-ES & \kappa[(X-xS)-i(Y-yS)]\\
15+
\kappa[(X-xS)+i(Y-yS)] & -(H-ES)
16+
\end{pmatrix},\qquad B=\operatorname{diag}(S,S).
17+
$$
18+
19+
Here $H$, $S$, $X$ and $Y$ are AO matrices, $(x,y)$ and $E$ are the query position and energy, and
20+
$\kappa$ has units of energy per length. For class A, the index is half the signature of $L$. The
21+
gap is the smallest absolute generalized eigenvalue of $(L,B)$, not a pivot magnitude. LAPACK
22+
pivoted LDL factorization is checked against the eigenvalue result.
23+
24+
```text
25+
&PROPERTIES
26+
&SPECTRAL_LOCALIZER
27+
FORMULATION FINITE
28+
INVARIANT CHERN
29+
PLANE XY
30+
POSITION [bohr] 0 0 0
31+
ENERGY [hartree] 0.0
32+
KAPPA [hartree*bohr^-1] 0.01
33+
&END
34+
&END
35+
```
36+
37+
Choose the energy and scale for the system. Repeated positions and lists of energies and scales
38+
produce scans. A real scalar Hamiltonian is not expected to have a nonzero class-A Chern index.
39+
40+
## Spin-orbit coupling and periodic systems
41+
42+
`SOC T` adds GTH spin-orbit coupling after a restricted SCF calculation in the complete AO spinor
43+
space. It needs SOC pseudopotential parameters and is not self-consistent noncollinear DFT.
44+
`INVARIANT Z2` additionally requires `TIME_REVERSAL T`. The code checks this symmetry and uses an
45+
orientation-sensitive Pfaffian sign in two dimensions. `DIMENSION 3` uses the class-AII chiral-block
46+
determinant construction and all three position directions.
47+
48+
`FORMULATION PERIODIC` uses analytic sine/cosine AO integrals on a complete Born-von-Karman torus.
49+
Set `MP_GRID` to its replication factors and use `ETA` (energy units) instead of `KAPPA`.
50+
Nonperiodic directions must have size one. For two dimensions, `PLANE` must agree with the two
51+
periodic directions in both `CELL` and `POISSON`. Three dimensions require `PERIODIC XYZ`. The torus
52+
is built at the frozen SCF potential, independently of the SCF mesh and its symmetry reduction.
53+
Finite Cartesian coordinates are not substituted for periodic position operators.
54+
55+
## Numerical controls
56+
57+
`SOLVER DENSE` is the reference implementation. `MAX_AO` bounds the complete scalar AO space
58+
including torus cells. Spinors double that space, and dense localizers require quadratic storage.
59+
`EPS_METRIC`, `MATRIX_TOLERANCE` and `EPS_GAP` control metric conditioning, operator checks and gap
60+
resolution. Unresolved gaps do not yield an index. `SPECTRAL_FLATTENING` optionally replaces the
61+
shifted Hamiltonian by its metric-covariant matrix sign after checking an electronic gap. Its scale
62+
and gap are distinct from the final localizer gap.
63+
64+
`DFT / PRINT / AO_MATRICES / POSITION` exports the finite AO moments in the same ordering as overlap
65+
and Hamiltonian matrices. `SOC` exports the three real antisymmetric GTH components, whose physical
66+
orbital operators include a factor of $i$. Both exports are restricted to isolated systems.
67+
68+
These are finite-basis local diagnostics. Check stability against basis, system size, query position
69+
and scale before interpreting a material index. Broader examples are available in
70+
[TopologicalCP2K](https://github.com/DCM-Uni-Paderborn/TopologicalCP2K).

‎src/CMakeLists.txt‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,16 @@ list(
678678
qs_ks_utils.F
679679
qs_ks_reference.F
680680
qs_kubo_transport.F
681+
qs_spectral_localizer.F
682+
qs_localizer_torus.F
683+
spectral_localizer.F
684+
quadratic_pseudospectrum.F
685+
qs_finite_ao.F
686+
qs_ao_translations.F
687+
qs_quadratic_pseudospectrum.F
688+
spectral_localizer_dbcsr.F
689+
spectral_localizer_flatten.F
690+
spectral_localizer_bloch.F
681691
qs_linres_atom_current.F
682692
qs_linres_current.F
683693
qs_linres_current_utils.F
@@ -1602,6 +1612,9 @@ set(CP2K_PROGS_F
16021612
kpoint_lattice_fft_unittest.F
16031613
kpoint_smearing_unittest.F
16041614
topology_wilson_unittest.F
1615+
spectral_localizer_unittest.F
1616+
quadratic_pseudospectrum_unittest.F
1617+
pw/pw_unittest.F
16051618
topology_symmetry_unittest.F
16061619
topology_curvature_unittest.F
16071620
topology_snapshot_unittest.F
@@ -1615,7 +1628,6 @@ set(CP2K_PROGS_F
16151628
qs_fod_unittest.F
16161629
qs_ot_complex_ref_unittest.F
16171630
subsys/cell_types_unittest.F
1618-
pw/realspace_grid_cube_unittest.F
16191631
metadyn_tools/graph.F
16201632
motion/dumpdcd.F
16211633
motion/xyz2dcd.F
@@ -2037,6 +2049,9 @@ list(
20372049
"kpoint_lattice_fft_unittest"
20382050
"kpoint_smearing_unittest"
20392051
"topology_wilson_unittest"
2052+
"spectral_localizer_unittest"
2053+
"quadratic_pseudospectrum_unittest"
2054+
"pw_unittest"
20402055
"topology_symmetry_unittest"
20412056
"topology_curvature_unittest"
20422057
"topology_snapshot_unittest"
@@ -2050,7 +2065,6 @@ list(
20502065
"qs_fod_unittest"
20512066
"qs_ot_complex_ref_unittest"
20522067
"cell_types_unittest"
2053-
"realspace_grid_cube_unittest"
20542068
"graph"
20552069
"dumpdcd"
20562070
"xyz2dcd"
@@ -2081,6 +2095,10 @@ add_executable(gapw_1c_basis_unittest gapw_1c_basis_unittest.F)
20812095
add_executable(kpoint_lattice_fft_unittest kpoint_lattice_fft_unittest.F)
20822096
add_executable(kpoint_smearing_unittest kpoint_smearing_unittest.F)
20832097
add_executable(topology_wilson_unittest topology_wilson_unittest.F)
2098+
add_executable(spectral_localizer_unittest spectral_localizer_unittest.F)
2099+
add_executable(quadratic_pseudospectrum_unittest
2100+
quadratic_pseudospectrum_unittest.F)
2101+
add_executable(pw_unittest pw/pw_unittest.F)
20842102
add_executable(topology_symmetry_unittest topology_symmetry_unittest.F)
20852103
add_executable(topology_curvature_unittest topology_curvature_unittest.F)
20862104
add_executable(topology_snapshot_unittest topology_snapshot_unittest.F)
@@ -2097,7 +2115,6 @@ add_executable(qs_charge_mixing_unittest qs_charge_mixing_unittest.F)
20972115
add_executable(qs_fod_unittest qs_fod_unittest.F)
20982116
add_executable(qs_ot_complex_ref_unittest qs_ot_complex_ref_unittest.F)
20992117
add_executable(cell_types_unittest subsys/cell_types_unittest.F)
2100-
add_executable(realspace_grid_cube_unittest pw/realspace_grid_cube_unittest.F)
21012118
add_executable(graph metadyn_tools/graph.F)
21022119
add_executable(dumpdcd motion/dumpdcd.F)
21032120
add_executable(xyz2dcd motion/xyz2dcd.F)

‎src/common/bibliography.F‎

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ MODULE bibliography
9898
KuhneHeskeProdan2020, Schreder2021, Schreder2024_1, Schreder2024_2, &
9999
Shiga2022, Lindh1995, Chai2024a, Rullan2026, Sundararaman2017, Andreussi2019, &
100100
Chai2025a, Neugebauer2023, Chai2024b, Moynihan2017, Cococcioni2005, &
101-
Cances2000, Herbst2022, Zhang2025, Gresch2017, Soluyanov2011, Davidson1975, &
102-
Olsen1988, Stratmann1998, Vecharynski2017, Stathopoulos1998, Bai2012, &
103-
Fukaya2014, Schreder2024_3
101+
Cances2000, Herbst2022, Zhang2025, Gresch2017, Soluyanov2011, Dixon2023, Doll2025, &
102+
Wong2026, Loring2015, Cerjan2023, Bairnsfather2026, Davidson1975, &
103+
Olsen1988, Stratmann1998, Vecharynski2017, Stathopoulos1998, Bai2012, Fukaya2014, Schreder2024_3
104104

105105
CONTAINS
106106

@@ -2317,6 +2317,41 @@ SUBROUTINE add_all_references()
23172317
source="Phys. Rev. B", volume="83", pages="235401", &
23182318
year=2011, doi="10.1103/PhysRevB.83.235401")
23192319

2320+
CALL add_reference(key=Dixon2023, &
2321+
authors=s2a("K. Y. Dixon", "T. A. Loring", "A. Cerjan"), &
2322+
title="Classifying topology in photonic heterostructures with gapless environments", &
2323+
source="Phys. Rev. Lett.", volume="131", pages="213801", &
2324+
year=2023, doi="10.1103/PhysRevLett.131.213801")
2325+
2326+
CALL add_reference(key=Wong2026, &
2327+
authors=s2a("S. Wong", "I. Yamazaki", "C. Siefert", "I. Duff", "T. A. Loring", "A. Cerjan"), &
2328+
title="Efficient local classification of parity-based material topology", &
2329+
source="Phys. Rev. B", volume="114", pages="084201", &
2330+
year=2026, doi="10.1103/6hj9-tgct")
2331+
2332+
CALL add_reference(key=Loring2015, &
2333+
authors=s2a("T. A. Loring"), &
2334+
title="K-theory and pseudospectra for topological insulators", &
2335+
source="Ann. Phys.", volume="356", pages="383-416", &
2336+
year=2015, doi="10.1016/j.aop.2015.02.031")
2337+
2338+
CALL add_reference(key=Doll2025, &
2339+
authors=s2a("N. Doll", "T. A. Loring", "H. Schulz-Baldes"), &
2340+
title="Topological indices for periodic gapped Hamiltonians and fuzzy tori", &
2341+
source="Math. Phys. Anal. Geom.", volume="28", pages="13", &
2342+
year=2025, doi="10.1007/s11040-025-09508-0")
2343+
2344+
CALL add_reference(key=Cerjan2023, &
2345+
authors=s2a("A. Cerjan", "T. A. Loring", "F. Vides"), &
2346+
title="Quadratic pseudospectrum for identifying localized states", &
2347+
source="J. Math. Phys.", volume="64", pages="023501", &
2348+
year=2023, doi="10.1063/5.0098336")
2349+
2350+
CALL add_reference(key=Bairnsfather2026, &
2351+
authors=s2a("C. A. Bairnsfather", "R. M. Kaufmann", "T. A. Loring", "A. Cerjan"), &
2352+
title="Band Unfolding via the Quadratic Pseudospectrum", &
2353+
source="arXiv", pages="2605.05423", year=2026, doi="10.48550/arXiv.2605.05423")
2354+
23202355
CALL add_reference(key=Davidson1975, &
23212356
authors=s2a("E. R. Davidson"), &
23222357
title="The iterative calculation of a few of the lowest eigenvalues and corresponding "// &

‎src/cp_dbcsr_output.F‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,10 @@ SUBROUTINE write_matrix_gen(matrix, matrix_name, before, after, para_env, &
579579
DO irow = first_row, last_row
580580
IF (omit_headers) THEN
581581
WRITE (UNIT=output_unit, FMT=fmtstr2) &
582-
irow, (matrix(irow, jcol), jcol=from, to)
582+
(matrix(irow, jcol), jcol=from, to)
583583
ELSE
584584
WRITE (UNIT=output_unit, FMT=fmtstr2) &
585-
(matrix(irow, jcol), jcol=from, to)
585+
irow, (matrix(irow, jcol), jcol=from, to)
586586
END IF
587587
END DO
588588
END DO

‎src/input_cp2k_print_dft.F‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,23 @@ SUBROUTINE create_print_dft_section(section)
486486
CALL section_add_keyword(print_key, keyword)
487487
CALL keyword_release(keyword)
488488

489+
CALL keyword_create(keyword, __LOCATION__, name="POSITION", &
490+
description="Print the analytic AO matrices <mu|x,y,z|nu> in Bohr, relative to "// &
491+
"the coordinate origin, in the same AO ordering as OVERLAP and KOHN_SHAM_MATRIX. "// &
492+
"Only isolated GPW/GAPW systems; not a periodic Berry-phase operator. "// &
493+
"Use NDIGITS 16 for numerical postprocessing.", &
494+
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
495+
CALL section_add_keyword(print_key, keyword)
496+
CALL keyword_release(keyword)
497+
498+
CALL keyword_create(keyword, __LOCATION__, name="SOC", &
499+
description="Print the three real antisymmetric AO GTH SOC components Vx, Vy, Vz in hartree. "// &
500+
"The physical orbital operators are i*Vx, i*Vy, i*Vz. "// &
501+
"Requires a restricted, isolated GPW/GAPW calculation with GTH SOC potentials.", &
502+
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
503+
CALL section_add_keyword(print_key, keyword)
504+
CALL keyword_release(keyword)
505+
489506
CALL keyword_create(keyword, __LOCATION__, name="FERMI_CONTACT", &
490507
description="If the printkey is activated controls the printing of the Fermi contact matrix", &
491508
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)

0 commit comments

Comments
 (0)