@@ -58,7 +58,7 @@ Installing **DeePTB** is straightforward with UV, a fast Python package manager.
5858- ** Requirements**
5959 - Git
6060 - Python 3.10 to 3.13
61- - UV, the recommended installer frontend
61+ - UV, used by ` install.sh ` as the fast installer frontend
6262 - For GPU installs: an NVIDIA driver compatible with the selected CUDA runtime
6363
6464- ** From Source** (Recommended)
@@ -107,9 +107,34 @@ Installing **DeePTB** is straightforward with UV, a fast Python package manager.
107107 - Automatically create a virtual environment (` .venv` )
108108 - Install a tested PyTorch / PyG / ` torch-scatter` binary-wheel combination
109109 - Refuse unsupported Python or CUDA/backend combinations instead of falling back to source builds
110- - Install all other dependencies
110+ - Install all runtime and test dependencies
111111
112- 4. ** Install optional dependencies** (if needed):
112+ 4. ** Activate the standalone environment** :
113+
114+ ` install.sh` installs DeePTB into ` .venv` under the current DeePTB
115+ repository. Activate it before running ` dptb` :
116+
117+ ` ` ` bash
118+ source .venv/bin/activate # On Unix/macOS
119+ .venv\Scripts\activate # On Windows
120+ dptb --help
121+ ` ` `
122+
123+ 5. ** Validate the installation** :
124+ DeePTB is under active development, so new installations should run the
125+ test suite once before production use.
126+
127+ ` ` ` bash
128+ python -m pytest ./dptb/tests/
129+ ` ` `
130+
131+ For a faster local check while iterating:
132+
133+ ` ` ` bash
134+ python -m pytest ./dptb/tests/ -m " not slow"
135+ ` ` `
136+
137+ 6. ** Install optional dependencies** (if needed):
113138 ` ` ` bash
114139 # For 3D Fermi surface plotting
115140 ./install.sh auto --extra 3Dfermi
@@ -121,13 +146,6 @@ Installing **DeePTB** is straightforward with UV, a fast Python package manager.
121146 ./install.sh auto --extra pybinding
122147 ` ` `
123148
124- 5. ** Run DeePTB** :
125- ` ` ` bash
126- source .venv/bin/activate # On Unix/macOS
127- .venv\Scripts\activate # On Windows
128- dptb --help
129- ` ` `
130-
131149- ** Developer Install**
132150
133151 ` pyproject.toml` declares the broader source-compatible range
@@ -138,39 +156,61 @@ Installing **DeePTB** is straightforward with UV, a fast Python package manager.
138156 uv sync
139157 ` ` `
140158
141- For new machines, prefer ` install.sh ` because it selects a tested
142- ` torch-scatter ` binary wheel for the requested CPU/GPU backend .
159+ This path is for developers who intentionally manage their own environment.
160+ For a tested standalone DeePTB environment, prefer ` install.sh ` .
143161
144- - ** Easy Installation** (PyPI )
162+ - ** Library Installation** (Existing Environment )
145163
146164 > [! WARNING]
147- > PyPI installation requires a compatible PyTorch and ` torch-scatter ` binary
148- > wheel to be installed first . The source install path above is easier for new
149- > machines .
165+ > This path is for downstream projects or existing environments that import
166+ > DeePTB as a library . The environment must provide a compatible PyTorch and
167+ > ` torch-scatter ` binary wheel .
150168
151- ** For CPU** :
152- ` ` ` bash
153- # 1. Install torch_scatter matching the tested CPU Torch version
154- pip install torch-scatter -f https://data.pyg.org/whl/torch-2.12.1+cpu.html
169+ DeePTB keeps a broad Torch compatibility range so downstream projects can
170+ choose their own CPU/GPU backend. In that case, install PyTorch first, then
171+ install a ` torch-scatter` binary wheel matching the current Torch version and
172+ backend. If you are working from a DeePTB source checkout, the helper can
173+ inspect the current environment and print the matching PyG wheel command:
155174
156- # 2. Install DeePTB
157- pip install dptb
175+ ` ` ` bash
176+ python - << 'PY '
177+ import torch
178+ print("torch:", torch.__version__)
179+ print("cuda runtime:", torch.version.cuda)
180+ print("cuda available:", torch.cuda.is_available())
181+ PY
182+
183+ python docs/auto_install_torch_scatter.py --dry-run
184+ python docs/auto_install_torch_scatter.py
158185 ```
159186
160- ** For GPU** (example with CUDA 12.8 / RTX 50):
187+ Then install DeePTB from the current source checkout:
188+
161189 ```bash
162- # 1. Install torch with CUDA support .
163- pip install torch==2.10.0 --index-url https://download.pytorch.org/whl/cu128
190+ pip install .
191+ ```
164192
165- # 2. Install torch_scatter matching the Torch/CUDA pair.
166- pip install torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cu128.html
193+ Use `pip install -e .` instead if you want an editable developer install.
194+ Published package installs, such as `pip install dptb`, were not part of this
195+ compatibility test pass; prefer a source checkout until that path is tested.
167196
168- # 3. Install DeePTB
169- pip install dptb
170- ` ` `
197+ For standalone DeePTB use on a new machine, use the **From Source** installer
198+ above instead; it creates `.venv` and selects a tested Torch / PyG /
199+ `torch-scatter` combination.
171200
172- > [! TIP]
173- > For easier installation with automatic GPU/CPU detection, use the ** From Source** method above instead.
201+ Example manual `torch-scatter` commands:
202+
203+ ```bash
204+ # CPU, torch 2.12.1
205+ pip install --only-binary torch-scatter \
206+ torch-scatter==2.1.2 \
207+ -f https://data.pyg.org/whl/torch-2.12.1+cpu.html
208+
209+ # CUDA 12.8 / torch 2.10.0
210+ pip install --only-binary torch-scatter \
211+ torch-scatter==2.1.2+pt210cu128 \
212+ -f https://data.pyg.org/whl/torch-2.10.0+cu128.html
213+ ```
174214
175215- **Julia Backend** (Optional - for High-Performance Pardiso Solver)
176216
@@ -215,7 +255,7 @@ Installing **DeePTB** is straightforward with UV, a fast Python package manager.
215255
216256To ensure the code is correctly installed, please run the unit tests first:
217257```bash
218- uv run pytest ./dptb/tests/
258+ python -m pytest ./dptb/tests/
219259```
220260Be careful if not all tests pass!
221261
0 commit comments