@@ -5,37 +5,60 @@ This guide will help you install DeePTB, a Python package that utilizes deep lea
5
5
## Prerequisites
6
6
7
7
Before installing DeePTB, ensure you have the following prerequisites:
8
+ - Git
9
+ - Python 3.9 to 3.12.
10
+ - Torch 2.0.0 to 2.5.1 ([ PyTorch Installation] ( https://pytorch.org/get-started/locally ) ).
11
+ - ifermi (optional, for 3D fermi-surface plotting).
12
+ - TBPLaS (optional).
8
13
9
- - Python 3.8 or later.
10
- - PyTorch 1.13.0 or later.
11
- - Git (to clone the repository).
12
-
13
- ### Optional
14
- - ifermi (for 3D fermi-surface plotting).
15
-
16
- ## Virtual Environment (Recommended)
17
-
18
- We recommend using a virtual environment to manage dependencies. Create one with the following command:
19
-
20
- ``` bash
21
- python -m venv /path/to/new/virtual/environment
22
- ```
23
-
24
- Activate the virtual environment:
25
-
26
- - On macOS and Linux:
27
- ``` bash
28
- source /path/to/new/virtual/environment/bin/activate
29
- ```
30
- - On Windows:
31
- ``` bash
32
- \p ath\t o\n ew\v irtual\e nvironment\S cripts\a ctivate
33
- ```
14
+ ## Installation Methods
34
15
35
- For more details on virtual environments, see the [ Python documentation] ( https://docs.python.org/3/tutorial/venv.html ) .
36
16
37
- ## Installation Methods
38
17
18
+ ### From Source
19
+
20
+ Highly recommended to install DeePTB from source to get the latest features and bug fixes.
21
+ 1 . ** Setup Python environment** :
22
+
23
+ Using conda (recommended, python >=3.9, <=3.12 ), e.g.,
24
+ ``` bash
25
+ conda create -n dptb_venv python=3.10
26
+ conda activate dptb_venv
27
+ ```
28
+ or using venv (make sure python > =3.9,< =3.12)
29
+ ` ` ` bash
30
+ python -m venv dptb_venv
31
+ source dptb_venv/bin/activate
32
+
33
+ 2. ** Clone DeePTB and Navigate to the root directory** :
34
+ ` ` ` bash
35
+ git clone https://github.com/deepmodeling/DeePTB.git
36
+ cd DeePTB
37
+ ```
38
+ 3. ** Install ` torch` and ` torch-scatter` ** (two ways):
39
+ - ** Recommended** : Install torch and torch-scatter using the following commands:
40
+
41
+ ` ` ` bash
42
+ python docs/auto_install_torch_scatter.py
43
+ ` ` `
44
+
45
+ - ** Manual** : Install torch and torch-scatter manually:
46
+ 1. install torch:
47
+ ` ` ` bash
48
+ pip install " torch>=2.0.0,<=2.5.0"
49
+ ` ` `
50
+
51
+ 2. install torch-scatter:
52
+ ` ` ` bash
53
+ pip install torch-scatter -f https://data.pyg.org/whl/torch-${version} +${CUDA} .html
54
+ ` ` `
55
+ where ` ${version} ` is the version of torch, e.g., 2.5.0, and ` ${CUDA} ` is the CUDA version, e.g., cpu, cu118, cu121, cu124. See [torch_scatter doc](https://github.com/rusty1s/pytorch_scatter) for more details.
56
+
57
+ 4. ** Install DeePTB** :
58
+ ` ` ` bash
59
+ pip install .
60
+ ` ` `
61
+
39
62
# ## From PyPi
40
63
41
64
1. Install PyTorch first by following the instructions on [PyTorch: Get Started](https://pytorch.org/get-started/locally).
@@ -44,22 +67,6 @@ For more details on virtual environments, see the [Python documentation](https:/
44
67
pip install dptb
45
68
` ` `
46
69
47
- ### From Source
48
-
49
- 1 . Clone the DeePTB repository:
50
- ``` bash
51
- git clone https://github.com/deepmodeling/DeePTB.git
52
- ```
53
- 2 . Change to the repository directory:
54
- ``` bash
55
- cd DeePTB
56
- ```
57
- 3 . Install DeePTB and its dependencies:
58
- ``` bash
59
- pip install .
60
- ```
61
-
62
-
63
70
# ## Additional Tips
64
71
65
72
- Keep your DeePTB installation up-to-date by pulling the latest changes from the repository and re-installing.
0 commit comments