This directory contains examples for using DeePTB's Pardiso backend for band structure and density-of-states calculations.
min.vasp: Example structure file (C84 fullerene)nnsk.iter_ovp0.000.pth: Pre-trained DeePTB modelband.json: Configuration file for band structure calculationdos.json: Configuration file for density-of-states calculation
-
pardiso_tutorial.ipynb⭐: Complete tutorial covering:- Python API usage (
to_pardiso_json()) - CLI integration (
dptb pdso) - Manual Julia execution
- Result visualization
- Backward compatibility
- Python API usage (
-
dptb_to_Pardiso_new.ipynb: Legacy notebook (kept for reference) -
dptb_to_Pardiso.ipynb: Original notebook (deprecated)
test_pardiso_new.py: Automated test script for the export workflow
dptb pdso \
band.json \
-i nnsk.iter_ovp0.000.pth \
-stu min.vasp \
-o ./outputWith custom solver parameters:
dptb pdso \
band.json \
-i nnsk.iter_ovp0.000.pth \
-stu min.vasp \
-o ./output \
--ill_project false \
--ill_threshold 1e-3Results will be in ./output/results/.
To calculate DOS instead of bands:
dptb pdso \
dos.json \
-i nnsk.iter_ovp0.000.pth \
-stu min.vasp \
-o ./output_dosTo reuse an existing Pardiso export directory without re-running DeePTB:
dptb pdso \
band.json \
-d ./output \
-o ./rerun_outputfrom dptb.postprocess.unified.system import TBSystem
# Initialize
tbsys = TBSystem(data="min.vasp", calculator="nnsk.iter_ovp0.000.pth")
# Export
tbsys.to_pardiso_json(output_dir="pardiso_data")
# Run Julia backend
import subprocess
subprocess.run([
"julia", "../../dptb/postprocess/pardiso/main.jl",
"--input_dir", "pardiso_data",
"--output_dir", "results",
"--config", "band.json"
])Open pardiso_tutorial.ipynb in Jupyter for a complete walkthrough.
band.json example:
{
"task_options": {
"task": "band",
"eig_solver": "numpy",
"kline_type": "abacus",
"kpath": [
[0.0, 0.0, 0.0, 30],
[0.0, 0.0, 0.5, 1]
],
"klabels": ["G", "Z"],
"E_fermi": -9.03841,
"emin": -2,
"emax": 2
},
"num_band": 30,
"max_iter": 400,
"isspinful": "false"
}dos.json uses the same export format with task: "dos" and a Monkhorst-Pack-style kmesh:
{
"task_options": {
"task": "dos",
"eig_solver": "numpy",
"kmesh": [1, 1, 1],
"fermi_level": -9.03841,
"epsilon": 0.05,
"omegas": [-2.0, 2.0, 401]
},
"num_band": 30,
"max_iter": 400,
"isspinful": "false"
}The example configs use "eig_solver": "numpy" so they run on machines without MKL/Pardiso. On Linux systems with MKL/Pardiso available, remove this field or set it to "pardiso" to use the Pardiso eigensolver path.
After running the workflow, you'll get:
structure.json: Structure and basis informationpredicted_hamiltonians.h5: Hamiltonian matrix blockspredicted_overlaps.h5: Overlap matrix blocks
bandstructure.h5: Band structure data (HDF5 format, band task)bands.dat: Text format band data (band task)egvals.dat: Eigenvalues on the DOS k-mesh (DOS task)dos.dat: Text format DOS data whenepsilonandomegasare configured (DOS task)
For legacy workflows, use to_pardiso_debug() to export .dat files:
tbsys.to_pardiso_debug(output_dir="legacy_data")The Julia backend will automatically detect and load these files if structure.json is missing.
Edit band.json or dos.json:
num_band: Number of bands to calculate (default: 30)max_iter: Maximum iterations for eigenvalue solver (default: 400)emin,emax: Plotting energy window for band structurekmesh: K-point mesh for DOS calculationsepsilon,omegas: Gaussian broadening and energy grid for DOS output
For ill-conditioned systems, run Julia with:
julia main.jl --input_dir data --output_dir results --config band.json --ill_project trueIssue: structure.json not found
- Solution: Run
tbsys.to_pardiso_json()first
Issue: Eigenvalues don't converge
- Solution: Increase
max_iterin config or adjustE_fermi
Issue: Dimension mismatch for spinful systems
- Solution: Ensure
isspinfulmatches your model (checkhasattr(model, 'soc_param'))