Finite-temperature and dynamical observables for quantum systems with NumPy/JAX compatibility.
Thermal Physics (thermal.py)
- Partition functions, Boltzmann weights, free energy
- Heat capacity, susceptibilities, temperature scans
- Numerically stable evaluations of
$Z(\beta)$ and thermal averages
Spectral Functions (spectral/)
- Green's functions:
greens_function_quadratic,greens_function_manybody,greens_function_lanczos - Spectral functions from Green's functions or eigenvalues
- Momentum-resolved spectral functions
$A(k,\omega)$ - Density of states with Lorentzian/Gaussian broadening
Response Functions (response/)
- Dynamic structure factors
$S(q,\omega)$ - Generalized susceptibilities
$\chi(q,\omega)$ - Unified interface for many-body and mean-field systems
Entanglement (density_matrix.py, entropy.py)
- Reduced density matrices, Schmidt decompositions
- Von Neumann, Rényi, and participation entropies
- JAX-accelerated versions available
Single-Particle (sp/)
- Correlation matrices for quadratic Hamiltonians
- Slater determinant and BdG quasiparticle support
Utilities
eigenlevels.py: Level statistics (spacing ratios, unfolding)statistical.py: Windowed averaging, binning, jackknife estimatorsoperators.py: Operator parsing and selection
# Thermal properties
from general_python.physics import thermal
Z = thermal.partition_function(energies, beta=1.0)
C_V = thermal.heat_capacity(energies, beta=1.0)
# Spectral functions
from general_python.physics.spectral import spectral_function
A = spectral_function.spectral_function(omega=0.5, eigenvalues=E, eigenvectors=U, eta=0.01)
# Green's functions
from general_python.physics.spectral.spectral_backend import greens_function_quadratic
G = greens_function_quadratic(omega, eigenvalues, eigenvectors, eta=0.01)
# Response functions
from general_python.physics.response import unified_response
chi, method = unified_response.compute_response(E, V, operator, omega_grid)physics/
├── backend.py # Unified interface to spectral & thermal
├── thermal.py # Temperature-dependent properties
├── spectral/ # Green's functions & spectral functions
│ ├── spectral_backend.py # Core implementations
│ ├── greens_function.py # Green's function wrappers
│ ├── spectral_function.py# Spectral function wrappers
│ └── dos.py # Density of states
├── response/ # Dynamic response functions
│ ├── unified_response.py # Auto-selecting response calculator
│ ├── structure_factor.py # Structure factors
│ └── susceptibility.py # Susceptibilities
├── sp/ # Single-particle correlations
├── density_matrix.py # Density matrices
├── entropy.py # Entanglement entropies
└── statistical.py # Data analysis utilities
Thermal averages:
Green's function:
Spectral function:
Susceptibility:
Structure factor:
Copyright © 2025 Maksymilian Kliczkowski. All rights reserved.