Skip to content

Commit 4071bce

Browse files
committed
update readme
1 parent eb079ed commit 4071bce

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ Installing **DeePTB** is straightforward. We recommend using a virtual environme
5656
3. Navigate to the root directory and install DeePTB:
5757
```bash
5858
cd DeePTB
59-
BUILD_FORTRAN=ON USE_INTEL=ON USE_OPENMP=ON pip install .
59+
BUILD_FORTRAN=ON pip install .
6060
```
61-
Note: by default, the optical response module is not installed. To install it, you need to set the `BUILD_FORTRAN=ON` flag. The `USE_INTEL=ON` flag is used to enable the Intel MKL library, and the `USE_OPENMP=ON` flag is used to enable OpenMP parallelization. Both `USE_INTEL` and `USE_OPENMP` are `ON` by default.
62-
61+
Note: by default, the optical response module is not installed. To install it, you need to set the `BUILD_FORTRAN=ON` flag. By default we set the CMakeList.txt to use the intel compiler with openmp enabled. If you want to use other compilers, you need to modify the CMakeList.txt file.
62+
6363
## Usage
6464
For a comprehensive guide and usage tutorials, visit [our documentation website](https://deeptb.readthedocs.io/en/latest/).
6565

dptb/postprocess/optical/optical_cond.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
import numpy as np
33
from dptb.data import AtomicDataDict
44
from dptb.data import AtomicData
5-
5+
import sys
66
import torch
77
from dptb.nn.hr2hk import HR2HK
88
from dptb.nn.hr2dhk import Hr2dHk
9-
from dptb.postprocess.fortran import ac_cond as acdf2py
109
import math
1110
from dptb.utils.make_kpoints import kmesh_sampling_negf
1211
import time
@@ -15,6 +14,10 @@
1514
from ase.io import read
1615
import matplotlib.pyplot as plt
1716

17+
try:
18+
from dptb.postprocess.fortran import ac_cond as acdf2py
19+
except ImportError:
20+
acdf2py = None
1821

1922
log = logging.getLogger(__name__)
2023

@@ -32,6 +35,9 @@ def __init__(self, model:torch.nn.Module, results_path: str=None, use_gui: bool=
3235
self.use_gui = use_gui
3336
self.device = device
3437
os.makedirs(results_path, exist_ok=True)
38+
if acdf2py is None:
39+
log.warning('ac_cond_f is not available, please install the fortran code to calculate the AC conductivity')
40+
sys.exit(1)
3541

3642
def get_accond(self,
3743
struct,

0 commit comments

Comments
 (0)