You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced/e3tb/advanced_input.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,10 @@ In `common_options`, the user should define the some global param like:
12
12
"seed": 42
13
13
}
14
14
```
15
-
-`basis`sould align with the basis used to perform LCAO DFT calculations. The `"2s2p1d"` here indicates 2x`s` orbital, 2x`p`orbital and one `d` orbital. The
16
-
-`seed` controls the global random seed of all related package. `dtype` can be chosen between `float32` and `float64`, but the former are accurate enough in most cases. If you have multiple card, the
15
+
-`basis`should align with the basis used to perform LCAO DFT calculations. The `"2s2p1d"` here indicates 2x`s` orbital, 2x`p`orbital and one `d` orbital. The
16
+
-`seed` controls the global random seed of all related packages. `dtype` can be chosen between `float32` and `float64`, but the former is accurate enough in most cases. If you have multiple cards, the
17
17
-`device` can be setted as `cuda:0`, `cuda:1` and so on, where the number is the device id.
18
-
-`overlap` controls the fitting of overlap matrix. The user should provide overlap in the dataset when configuring the data_options if `overlap` is setted as True.
18
+
-`overlap` controls the fitting of the overlap matrix. The user should provide overlap in the dataset when configuring the data_options if `overlap` is setted as True.
19
19
20
20
In `train_options`, a common parameter looks like this:
21
21
```JSON
@@ -43,15 +43,15 @@ In `train_options`, a common parameter looks like this:
43
43
```
44
44
For `lr_scheduler`, please ensure the `patience` x `num_samples` / `batch_size` ranged between 2000 to 6000.
45
45
46
-
When the dataset contraining multiple elements, and you are fitting the Hamiltonian, it is suggested to open a tag in loss_options for better performance. Since most DFT software would allow for a uniform shift when computing the electrostatic potentials, therefore, bringing extra degree of freedom. The `onsite_shift` tag allow such freedom and make the model generalizable to all sort of elements combinations:
46
+
When the dataset contains multiple elements, and you are fitting the Hamiltonian, it is suggested to open a tag in loss_options for better performance. Most DFT software would allow for a uniform shift when computing the electrostatic potentials, therefore, bringing an extra degree of freedom. The `onsite_shift` tag allows such freedom and makes the model generalizable to all sorts of element combinations:
In `model_options`, we support two type of e3 group equivariant embedding methods: Strictly Localized Equivariant Message-passing or `slem`, and Localized Equivariant Message-passing or `lem`. Former one ensure strict localization by truncate the propagation of distant eighbours' information, therefore are suitable for bulk systems where the electron localization is enhanced by scattering effect. `lem` method, on the other hand, contrained such localization design inherently by incooperating a learnable decaying functions describing the dependency across distance.
54
+
In `model_options`, we support two types of e3 group equivariant embedding methods: Strictly Localized Equivariant Message-passing or `slem`, and Localized Equivariant Message-passing or `lem`. The former ensures strict localization by truncating the propagation of distant neighbours' information and, therefore is suitable for bulk systems where the electron localization is enhanced by the scattering effect. `Lem` method, on the other hand, contained such localization design inherently by incorporating learnable decaying functions describing the dependency across distance.
55
55
56
56
The model options for slem and lem are the same, here is an short example:
57
57
```JSON
@@ -73,9 +73,9 @@ The model options for slem and lem are the same, here is an short example:
73
73
```
74
74
Here, `method` indicates the e3 descripor employed.
75
75
76
-
`r_max` can be a float or int number, or a dict with atom speciesspecific float/int number, which indicates their cutoff envolope function, used to decaying the distant atom's effect smoothly. We highly suggest the user go to the DFT calculation files, and check the orbital's radial cutoff information to figure out how large this value should be.
76
+
`r_max` can be a float or int number, or a dict with atom species-specific float/int number, which indicates their cutoff envelope function, used to decay the distant atom's effect smoothly. We highly suggest the user go to the DFT calculation files and check the orbital's radial cutoff information to figure out how large this value should be.
77
77
78
-
`irreps_hidden`: Very important! This parameter decide mostly the representation capacity of the model, along with the model size and consumption of GPU memory. This parameter indicates the irreps of hidden equiraviant space, the definition here follows the for example, `64x0e` states `64`ireducible representation with `l=0` and `even` parity. For each basis setting, we provide a tool to generate least essential `irreps_hidden`, we also highly suggest the user to add at least 3 times of the number of essential irreps to enhance to representation capacity.
78
+
`irreps_hidden`: Very important! This parameter decides mostly the representation capacity of the model, along with the model size and consumption of GPU memory. This parameter indicates the irreps of hidden equivariant space, the definition here follows that for example, `64x0e` states `64`irreducible representation with `l=0` and `even` parity. For each basis set, we provide a tool to generate the least essential `irreps_hidden`, we also highly suggest the user add at least 3 times the number of essential irreps to enhance representation capacity.
`n_layers`: indicates the number of layers of the networks.
90
90
91
-
`env_embed_multiplicity`: dicide the irreps number when initilizating the edge and node features.
91
+
`env_embed_multiplicity`: decide the irreps number when initializing the edge and node features.
92
92
93
-
`avg_num_neighbors`: the averaged number of neighbors in the system given the cutoff radius setted as `r_max`. It is recommended to do a statistics of the system you are modeling, but just pick up a number ranged from 50 to 100 is also okay.
93
+
`avg_num_neighbors`: the averaged number of neighbours in the system given the cutoff radius set as `r_max`. It is recommended to do statistics of the system you are modelling, but just picking up a number ranging from 50 to 100 is also okay.
94
94
95
95
`latent_dim`: The scalar channel's dimension of the system. 32/64/128 is good enough.
Copy file name to clipboardExpand all lines: docs/advanced/e3tb/data_preparation.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# Data Preparation
2
-
We sugget the user to use a data parsing tool [dftio](https://github.com/floatingCatty/dftio) to directly converting the output data from DFT calculation into readable datasets. Our implementation support the parsed dataset format of `dftio`. User can just clone the `dftio`respository and run `pip install .` in its root directory. Then one can use the following parsing command for the parallel data processing directly from DFT output:
2
+
We suggest the user use a data parsing tool [dftio](https://github.com/floatingCatty/dftio) to directly convert the output data from DFT calculation into readable datasets. Our implementation supports the parsed dataset format of `dftio`. Users can just clone the `dftio`repository and run `pip install .` in its root directory. Then one can use the following parsing command for the parallel data processing directly from the DFT output:
-eig, --eigenvalue Whether to parse the kpoints and eigenvalues (default: False)
27
27
```
28
28
29
-
After parsing, the user need to write a info.json file into the dataset. For default dataset type, the `info.json` looks like:
29
+
After parsing, the user need to write a info.json file and put it in the dataset. For default dataset type, the `info.json` looks like:
30
30
31
31
```JSON
32
32
{
@@ -39,15 +39,15 @@ After parsing, the user need to write a info.json file into the dataset. For def
39
39
}
40
40
41
41
```
42
-
Here `pos_type` can be `cart`, `dirc` or `ase`. For `dftio` output dataset, we use `cart` by default. The `r_max`, in principle, should align with the orbital cutoff in DFT calculation. For single element, the `r_max` should be a float number, indicating the largest bond distance included. When the system have multiple atoms, the `r_max` can also be a dict of atomic speciesspecific number like `{A: 7.0, B: 8.0}`. Then the largest bond `A-A` would be 7 and `A-B` be (7+8)/2=7.5, and `B-B` would be 8. `pbc` can be a bool variable, indicating the open or close of the periodic boundary conditions of the model. It can also be a list of three bool elements like `[true, true, false]`, by what means we can set the periodicity of each direction independently.
42
+
Here `pos_type` can be `cart`, `dirc` or `ase`. For `dftio` output dataset, we use `cart` by default. The `r_max`, in principle, should align with the orbital cutoff inthe DFT calculation. For a single element, the `r_max` should be a float number, indicating the largest bond distance included. When the system has multiple atoms, the `r_max` can also be a dict of atomic species-specific number like `{A: 7.0, B: 8.0}`. Then the largest bond `A-A` would be 7 and `A-B` be (7+8)/2=7.5, and `B-B` would be 8. `pbc` can be a bool variable, indicating the open or close of the periodic boundary conditions of the model. It can also be a list of three bool elements like `[true, true, false]`, which means we can set the periodicity of each direction independently.
43
43
44
-
For LMDB type Dataset, the info.json is much simplier, which looks like:
44
+
For LMDB type Dataset, the info.json is much simpler, which looks like this:
45
45
```JSON
46
46
{
47
47
"r_max": 7.0
48
48
}
49
49
```
50
-
Where other information have been stored in the dataset. LMDB dataset is designfor handeling very large data that cannot be fit into the memory directly.
50
+
Where other information has been stored in the dataset. LMDB dataset is designedfor handeling very large data that cannot be fit into the memory directly.
51
51
52
52
Then you can set the `data_options`in the input parameters to point directly to the prepared dataset, like:
Copy file name to clipboardExpand all lines: docs/advanced/e3tb/loss_analysis.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,9 @@
1
1
# Loss Analysis
2
2
## function
3
-
The **DeePTB**contrains a module to help the user better understand the details of the error of **E3TB** module.
3
+
The **DeePTB**contains a module to help the user better understand the details of the error of the**E3TB** module.
4
4
We decompose the error of **E3TB** model into several parts:
5
-
- onsite blocks: for diagonal blocks of the predicted quantum tensors
6
-
the onsite blocks are further arranged according to the atom species.
7
-
- hopping blocks: for off-diagonal blocks
8
-
the hopping blocks error are then further arranged according to the atom-pair types.
5
+
- onsite blocks: for diagonal blocks of the predicted quantum tensors the onsite blocks are further arranged according to the atom species.
6
+
- hopping blocks: for off-diagonal blocks, the hopping block errors are then further arranged according to the atom-pair types.
9
7
10
8
## usage
11
9
For using this function, we need a dataset and the model. Just build them up in advance.
@@ -44,7 +42,7 @@ for data in tqdm(loader, desc="doing error analysis"):
44
42
data = model(ref_data)
45
43
ana(data, ref_data, running_avg=True)
46
44
```
47
-
The analysis results are stored in `ana.stats`, which is a dictionary of statistics. The user can checkout the value directly, or displaying the results by:
45
+
The analysis results are stored in `ana.stats`, which is a dictionary of statistics. The user can check the value directly, or display the results by:
48
46
49
47
```Python
50
48
ana.report()
@@ -73,7 +71,7 @@ RMSE: 0.0003886453341692686
73
71

74
72

75
73
76
-
If the user want to see the loss in a decomposed irreps format, one can set the `decompose` of `HamilLossAnalysis` class to `True`, and rerun the analysis. We can display the decomposed irreps results using the following code:
74
+
If the user wants to see the loss in a decomposed irreps format, one can set the `decompose` of the `HamilLossAnalysis` class to `True`, and rerun the analysis. We can display the decomposed irreps results using the following code:
Copy file name to clipboardExpand all lines: docs/quick_start/hands_on/e3tb_hands_on.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Bulk Silicon model
2
2
3
-
DeePTB support training a E3-equalvariant model to predict DFT Hamiltonian, density and overlap matrix under LCAO basis. Here, cubicphase bulk silicon has been chosen as a quick start example.
3
+
DeePTB supports training an E3-equalvariant model to predict DFT Hamiltonian, density and overlap matrix under LCAO basis. Here, cubic-phase bulk silicon has been chosen as a quick start example.
4
4
5
-
Silicon is a chemical element; it has symbol Si and atomic number 14. It is a hard, brittle crystalline solid with a blue-grey metallic luster, and is a tetravalent metalloid and semiconductor. The prepared files are located in:
5
+
Silicon is a chemical element; it has the symbol Si and atomic number 14. It is a hard, brittle crystalline solid with a blue-grey metallic lustre, and is a tetravalent metalloid and semiconductor. The prepared files are located in:
6
6
7
7
```
8
8
deeptb/examples/e3/
@@ -19,7 +19,7 @@ deeptb/examples/e3/
19
19
| `-- info.json
20
20
`-- input.json
21
21
```
22
-
We prepared one frame of silicon cubic bulk structure as an example. The data was computed using DFT software ABACUS, with a LCAO basis set contraining 1 `s` and 1 `p` orbital. The cutoff radius for the orbital is 7au, which means the largest bond would be less than 14 au. Therefore, the r_max should be setted as 7.4. So we have a info.json file like:
22
+
We prepared one frame of silicon cubic bulk structure as an example. The data was computed using DFT software ABACUS, with an LCAO basis set containing 1 `s` and 1 `p` orbital. The cutoff radius for the orbital is 7au, which means the largest bond would be less than 14 au. Therefore, the r_max should be set as 7.4. So we have an info.json file like:
23
23
24
24
```json
25
25
{
@@ -63,16 +63,16 @@ Here comes the `model_options`:
63
63
}
64
64
}
65
65
```
66
-
The `model_options`contrains`embedding` and `prediction` parts, denoting construction of representation for equivariant features, and arrange and rescale the features into quantum operators sub-blocks such as Hamiltonian, density and overlap matrix.
66
+
The `model_options`contains`embedding` and `prediction` parts, denoting the construction of representation for equivariant features, and arranging and rescaling the features into quantum operators sub-blocks such as Hamiltonian, density and overlap matrix.
67
67
68
-
In `embedding`, the `method`support`slem` and `lem` for now, where `slem`have a strictly localized dependency, which have better transferbility and data-efficiency, while `lem`have a adjustable semi-local dependency, which have better representation capacity, but would requires a little more data. `r_max` should align with the one defined in `info.json`.
68
+
In `embedding`, the `method`supports`slem` and `lem` for now, where `slem`has a strictly localized dependency, which has better transferability and dataefficiency, while `lem`has an adjustable semi-local dependency, which has better representation capacity, but would require a little more data. `r_max` should align with the one defined in `info.json`.
69
69
70
-
For `irreps_hidden`, this parameter defines the size of the hidden equivariant irreducible representation, which is highly related to the power of the model. There are certains rules to define this param. First, we should check the largest angular momentum defined in the DFT LCAO basis, the irreps's highest angular momentum should always be its double. For example, for `1s1p` basis, the irreps should contrains features with angular momentum from 0 to 2, which is 2 times 1, the angular momentum of `p` orbital. If basis contains `d` orbital, then the irreps should contrain angular momentum upto 4. `f` and `g` or even higher orbitals are also supported.
70
+
For `irreps_hidden`, this parameter defines the size of the hidden equivariant irreducible representation, which is highly related to the power of the model. There are certain rules to define this param. First, we should check the largest angular momentum defined in the DFT LCAO basis, the irreps's highest angular momentum should always be double. For example, for `1s1p` basis, the irreps should contain features with angular momentum from 0 to 2, which is 2 times 1, the angular momentum of `p` orbital. If the basis contains `d` orbital, then the irreps should contain angular momentum up to 4. `f` and `g` or even higher orbitals are also supported.
71
71
72
-
In `prediction`, we should use `e3tb` method to let the model know the output features are arranged as**E3TB** format. The neurons are defined for a simple MLP to predict the slater-kosterlike parameters for predicting the overlap matrix, for which [64,64] is usually fine.
72
+
In `prediction`, we should use the `e3tb` method to let the model know the output features are arranged in**E3TB** format. The neurons are defined for a simple MLP to predict the slater-koster-like parameters for predicting the overlap matrix, for which [64,64] is usually fine.
73
73
74
74
75
-
Now everything is prepared ! we can using the follwing command and we can train the first model:
75
+
Now everything is prepared! We can using the following command and we can train the first model:
Now you know how to train a **E3TB** model for Hamiltonian and overlap matrix. For better usage, we encourage the user to read the full input parameters for the **E3TB** model. Also, the **DeePTB** model support several postprocess tools, and the user can directly extract any predicted properties just using a few line of codes. Please see the basis_api for details.
94
+
Now you know how to train a **E3TB** model for Hamiltonian and overlap matrix. For better usage, we encourage the user to read the full input parameters for the **E3TB** model. Also, the **DeePTB** model supports several post-process tools, and the user can directly extract any predicted properties just using a few lines of code. Please see the basis_api for details.
0 commit comments