Skip to content

Commit 93d5411

Browse files
Merge pull request #29 from deepmodeling/devel
Devel
2 parents fe09978 + 239d09d commit 93d5411

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+667
-3347
lines changed

README.md

Lines changed: 93 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [3.1. Input Files Preperation](#31-input-files-preperation)
1313
- [3.1.1. Global Setting](#311-global-setting)
1414
- [3.1.2. Calculation Parameters](#312-calculation-parameters)
15+
- [3.1.2.1. Gamma Line Settings](#3121-gamma-line-settings)
1516
- [3.2. Submittion Command](#32-submittion-command)
1617
- [4. Quick Start](#4-quick-start)
1718
- [4.1. In the Bohrium](#41-in-the-bohrium)
@@ -22,7 +23,7 @@
2223

2324
APEX adopts the functionality of the second-generation alloy properties calculations and is developed utilizing the [dflow](https://github.com/deepmodeling/dflow) framework. By integrating the benefits of cloud-native workflows, APEX streamlines the intricate procedure of automatically testing various configurations and properties. Owing to its cloud-native characteristic, APEX provides users with a more intuitive and user-friendly interaction, enhancing the overall user experience by eliminating concerns related to process control, task scheduling, observability, and disaster tolerance.
2425

25-
The comprehensive architecture of APEX is illustrated as follows:
26+
The comprehensive architecture of APEX is demonstrated below:
2627

2728
<div>
2829
<img src="./docs/images/apex_demo.png" alt="Fig1" style="zoom: 35%;">
@@ -44,7 +45,7 @@ APEX currently offers computation methods for the following alloy properties:
4445
* Vacancy formation energy
4546
* Generalized stacking fault energy (Gamma line)
4647

47-
Moreover, APEX supports three types of calculators: **LAMMPS** for molecular dynamics simulations, and **VASP** and **ABACUS** for first-principles calculations. For information on extending these functions, please refer to the [Extensibility](#5-extensibility) section.
48+
Moreover, APEX supports three types of calculators: **LAMMPS** for molecular dynamics simulations, and **VASP** and **ABACUS** for first-principles calculations.
4849

4950
## 2. Easy Install
5051
Easy install by
@@ -66,7 +67,7 @@ pip install .
6667
In APEX, all essential input parameters must be organized in specific JSON files within the **current working directory** before proceeding. There are two distinct types of JSON files that will be discussed in detail.
6768

6869
#### 3.1.1. Global Setting
69-
The instructions regarding global configuration, [dflow](https://github.com/deepmodeling/dflow), and [DPDispatcher](https://github.com/deepmodeling/dpdispatcher/tree/master) specific settings must be saved in JSON format within a file named precisely as `global.json`. The table below describes some crucial keywords, classified into three categories:
70+
The instructions regarding global configuration, [dflow](https://github.com/deepmodeling/dflow), and [DPDispatcher](https://github.com/deepmodeling/dpdispatcher/tree/master) specific settings must be saved in JSON format within a file named exactly as `global.json`. The table below describes some crucial keywords, classified into three categories:
7071

7172
* **Dflow**
7273
| Key words | Data structure | Default | Description |
@@ -102,17 +103,17 @@ The instructions regarding global configuration, [dflow](https://github.com/deep
102103
| cpu_scass_type | String | None | CPU node type on Bohrium to run the first-principle jobs |
103104
| gpu_scass_type | String | None | GPU node type on Bohrium to run LAMMPS jobs |
104105

105-
Please refer to the [User scenario examples](#4-Userscenarioexamples) section for various instances of `global.json` usage in different situations.
106+
Please refer to the [Quick Start](#4-quick-start) section for various instances of `global.json` usage in different situations.
106107

107108
#### 3.1.2. Calculation Parameters
108109
The method for indicating parameters in alloy property calculations is akin to the previous `dpgen.autotest` approach. There are **three** categories of JSON files that determine the parameters to be passed to APEX, based on their contents. Users have the flexibility to assign any name to these files.
109110

110111
Categories calculation parameter files:
111-
| Type | File format | Dict contained | Usage |
112+
| Type | File format | Dictionary contained | Usage |
112113
| :------------ | ---- | ----- | ------------------- |
113114
| Relaxation | json | `structures`; `interaction`; `Relaxation` | For `relaxation` worflow |
114115
| Property | json | `structures`; `interaction`; `Properties` | For `property` worflow |
115-
| Joint | json | `structures`; `interaction`; `Relaxation`; `Properties` | For `relaxation`, `property` and `joint` worflow |
116+
| Joint | json | `structures`; `interaction`; `Relaxation`; `Properties` | For `relaxation`, `property` and `joint` worflows |
116117

117118
It should be noted that files such as POSCAR, located within the `structure` directory, or any other files specified within the JSON file, must be pre-prepared in the current working directory.
118119

@@ -161,18 +162,7 @@ Below are three examples (for detailed explanations of each parameter, please re
161162
"shear_deform": 1e-2,
162163
"cal_setting": {"etol": 0,
163164
"ftol": 1e-10}
164-
},
165-
{
166-
"type": "gamma",
167-
"skip": true,
168-
"lattice_type": "bcc",
169-
"miller_index": [1,1,2],
170-
"supercell_size": [1,1,5],
171-
"displace_direction": [1,1,1],
172-
"min_vacuum_size": 0,
173-
"add_fix": ["true","true","false"],
174-
"n_steps": 10
175-
}
165+
}
176166
]
177167
}
178168
```
@@ -208,21 +198,91 @@ Below are three examples (for detailed explanations of each parameter, please re
208198
"shear_deform": 1e-2,
209199
"cal_setting": {"etol": 0,
210200
"ftol": 1e-10}
211-
},
212-
{
213-
"type": "gamma",
214-
"skip": true,
215-
"lattice_type": "bcc",
216-
"miller_index": [1,1,2],
217-
"supercell_size": [1,1,5],
218-
"displace_direction": [1,1,1],
219-
"min_vacuum_size": 0,
220-
"add_fix": ["true","true","false"],
221-
"n_steps": 10
222201
}
223202
]
224203
}
225204
```
205+
##### 3.1.2.1. Gamma Line Settings
206+
<div>
207+
<img src="./docs/images/gamma_demo.png" alt="Fig2" style="zoom: 35%;">
208+
<p style='font-size:1.0rem; font-weight:none'>Figure 2. Schematic diagram of Gamma line calculation</p>
209+
</div>
210+
211+
The Gamma line (generalized stacking fault energy) function of APEX calculates energy of a series slab structures of specific crystal plane, which displaced in the middle along a slip vector as illustrated in **Figure 2**. In APEX, the slab structrures are defined by a plane miller index and two orthogonal directions (primary and secondary) on the plane. The **slip vector is always along the primary directions** with slip length defined by user or default settings. Thus, by indicating `plane_miller` and the `slip_direction` (AKA, primary direction), a slip system can be defined.
212+
213+
For most common slip systems in respect to FCC, BCC and HCP crystal structures, slip direction, secondary direction and default fractional slip lengths are already documented and listed below (Users are **strongly advised** to follow those pre-defined slip system, or may need to double-check the generated slab structure, as unexpected results may occur especially for system like HCP):
214+
* FCC
215+
| Plane miller index | Slip direction | Secondary direction | Default slip length |
216+
| :-------- | ----- | ----- | ---- |
217+
| $(001)$ | $[100]$ | $[010]$ | $a$ |
218+
| $(110)$ | $[\bar{1}10]$ | $[001]$ | $\sqrt{2}a$ |
219+
| $(111)$ | $[11\bar{2}]$ | $[\bar{1}10]$ | $\sqrt{6}a$ |
220+
| $(111)$ | $[\bar{1}\bar{1}2]$ | $[1\bar{1}0]$ | $\sqrt{6}a$ |
221+
| $(111)$ | $[\bar{1}10]$ | $[\bar{1}\bar{1}2]$ | $\sqrt{2}a$ |
222+
| $(111)$ | $[1\bar{1}0]$ | $[11\bar{2}]$ | $\sqrt{2}a$ |
223+
224+
* BCC
225+
| Plane miller index | Slip direction | Secondary direction | Default slip length |
226+
| :-------- | ----- | ----- | ---- |
227+
| $(001)$ | $[100]$ | $[010]$ | $a$ |
228+
| $(111)$ | $[\bar{1}10]$ | $[\bar{1}\bar{1}2]$ | $\frac{\sqrt{2}}{2}a$ |
229+
| $(110)$ | $[\bar{1}11]$ | $[00\bar{1}]$ | $\frac{\sqrt{3}}{2}a$ |
230+
| $(110)$ | $[1\bar{1}\bar{1}]$ | $[001]$ | $\frac{\sqrt{3}}{2}a$ |
231+
| $(112)$ | $[11\bar{1}]$ | $[\bar{1}10]$ | $\frac{\sqrt{3}}{2}a$ |
232+
| $(112)$ | $[\bar{1}\bar{1}1]$ | $[1\bar{1}0]$ | $\frac{\sqrt{3}}{2}a$ |
233+
| $(123)$ | $[11\bar{1}]$ | $[\bar{2}10]$ | $\frac{\sqrt{3}}{2}a$ |
234+
| $(123)$ | $[\bar{1}\bar{1}1]$ | $[2\bar{1}0]$ | $\frac{\sqrt{3}}{2}a$ |
235+
236+
* HCP (Bravais lattice)
237+
| Plane miller index | Slip direction | Secondary direction | Default slip length |
238+
| :-------- | ----- | ----- | ---- |
239+
| $(0001)$ | $[2\bar{1}\bar{1}0]$ | $[01\bar{1}0]$ | $a$ |
240+
| $(0001)$ | $[1\bar{1}00]$ | $[01\bar{1}0]$ | $\sqrt{3}a$ |
241+
| $(0001)$ | $[10\bar{1}0]$ | $[01\bar{1}0]$ | $\sqrt{3}a$ |
242+
| $(01\bar{1}0)$ | $[\bar{2}110]$ | $[000\bar{1}]$ | $a$ |
243+
| $(01\bar{1}0)$ | $[0001]$ | $[\bar{2}110]$ | $c$ |
244+
| $(01\bar{1}0)$ | $[\bar{2}113]$ | $[000\bar{1}]$ | $\sqrt{a^2+c^2}$ |
245+
| $(\bar{1}2\bar{1}0)$ | $[\bar{1}010]$ | $[000\bar{1}]$ | $\sqrt{3}a$ |
246+
| $(\bar{1}2\bar{1}0)$ | $[0001]$ | $[\bar{1}010]$ | $c$ |
247+
| $(01\bar{1}1)$ | $[\bar{2}110]$ | $[\bar{1}2\bar{1}\bar{3}]$ | $a$ |
248+
| $(01\bar{1}1)$ | $[\bar{1}2\bar{1}\bar{3}]$ | $[2\bar{1}\bar{1}0]$ | $\sqrt{a^2+c^2}$ |
249+
| $(01\bar{1}1)$ | $[0\bar{1}12]$ | $[\bar{1}2\bar{1}\bar{3}]$ | $\sqrt{3a^2+4c^2}$ |
250+
| $(\bar{1}2\bar{1}2)$ | $[10\bar{1}0]$ | $[1\bar{2}13]$ | $\sqrt{3}a$ |
251+
| $(\bar{1}2\bar{1}2)$ | $[1\bar{2}13]$ | $[\bar{1}010]$ | $\sqrt{a^2+c^2}$ |
252+
253+
The parameters related to Gamma line calculation are listed below:
254+
| Key words | Data structure | Default | Description |
255+
| :------------ | ----- | ----- | ------------------- |
256+
| plane_miller | Sequence[Int] | None | Miller index of the target slab |
257+
| slip_direction | Sequence[Int] | None | Miller index of slip (primary) direction of the slab |
258+
| slip_length | Int\|Float; Sequence[Int\|Float, Int\|Float, Int\|Float] | Refer to specific slip system as the table shows above, or 1 if not indicated | Slip length along the primary direction with default unit set by user or default setting. As for format of `[x, y, z]`, the length equals to $\sqrt{(xa)^2+(yb)^2+(zc)^2}$ |
259+
| plane_shift | Int\|Float | 0 | Shift of displacement plane with unit of lattice parameter **$c$** (positive for upwards). This allows creating slip plane within narrowly-spaced planes (see [ref](https://doi.org/10.1016/j.actamat.2016.10.042)). |
260+
| n_steps | Int | 10 | Number of steps to displace slab along the slip vector |
261+
| vacuum_size | Int\|Float | 0 | Thickness of vacuum layer added around the slab with unit of Angstrom |
262+
| supercell_size | Sequence[Int, Int, Int] | [1, 1, 5] | Size of generated supper cell based on slab structure |
263+
| add fix | Sequence[Str, Str, Str] | ["true","true","false"] | Whether to add fix position constraint along x, y and z direction during calculation |
264+
265+
Here is an example:
266+
```json
267+
{
268+
"type": "gamma",
269+
"skip": true,
270+
"plane_miller": [0,0,1],
271+
"slip_direction": [1,0,0],
272+
"hcp": {
273+
"plane_miller": [0,1,-1,1],
274+
"slip_direction": [-2,1,1,0],
275+
"slip_length": [1,0,1],
276+
"plane_shift": 0.25
277+
},
278+
"supercell_size": [1,1,6],
279+
"vacuum_size": 10,
280+
"add_fix": ["true","true","false"],
281+
"n_steps": 10
282+
}
283+
```
284+
#### It should be noted that for various crystal structures, users can further define slip parameters within the respective nested dictionaries, which will be prioritized for adoption. In the previously mentioned example, the slip system configuration within the "hcp" dictionary will be utilized.
285+
226286

227287
### 3.2. Submittion Command
228288
APEX will execute a specific workflow upon each invocation of the command in the format: `apex [file_names] [--optional_argument]`. The type of workflow and calculation method will be automatically determined by APEX based on the parameter file provided by the user. Additionally, users can specify the workflow type through an optional argument. The following are command examples for submitting three types of workflows:
@@ -293,7 +353,7 @@ The most efficient method for submitting an APEX workflow is through the preconf
293353
"email": "YOUR_EMAIL",
294354
"password": "YOUR_PASSWD",
295355
"program_id": 1234,
296-
"apex_image_name":"registry.dp.tech/dptech/prod-11045/apex-demo:v0.0.2",
356+
"apex_image_name":"registry.dp.tech/dptech/prod-11045/apex-dependencies:0.0.3",
297357
"dpmd_image_name": "registry.dp.tech/dptech/prod-11045/deepmd-kit:deepmd-kit2.1.1_cuda11.6_gpu",
298358
"lammps_run_command":"lmp -in in.lammps",
299359
"batch_type": "Bohrium",
@@ -305,14 +365,16 @@ The most efficient method for submitting an APEX workflow is through the preconf
305365
Just replace the values of `email`, `password` and `program_id` of your own before submit. As for image used, you can either built your own or use public images from Bohrium or pulling from the Docker Hub. Once the workflow is submitted, one can monitor it on https://workflows.deepmodeling.com.
306366

307367
### 4.2. In a Local Argo Service
308-
Additionally, a dflow environment can be constructed on a local computer by executing [installation scripts](https://github.com/deepmodeling/dflow/tree/master/scripts) located in the dflow repository. For instance, to install on a Linux system without root access:
368+
Additionally, a dflow environment can be installed on a local computer by executing [installation scripts](https://github.com/deepmodeling/dflow/tree/master/scripts) located in the dflow repository (User can also refer to the [dflow service setup manual](https://github.com/deepmodeling/dflow/tree/master/tutorials) for more details). For instance, to install on a Linux system without root access:
309369
```shell
310370
bash install-linux-cn.sh
311371
```
312372
This process will automatically configure the required local tools, including Docker, Minikube, and Argo service, with the default port set to `127.0.0.1:2746`. Consequently, one can modify the `global.json` file to submit a workflow to this container without needing a Bohrium account.
313373

314374
```json
315375
{
376+
"dflow_host": "https://127.0.0.1:2746",
377+
"k8s_api_server": "https://127.0.0.1:2746",
316378
"apex_image_name": "zhuoyli/apex:amd64",
317379
"dpmd_image_name": "deepmodeling/deepmd-kit:2.2.1_cuda10.1_gpu",
318380
"lammps_run_command": "lmp -in in.lammps",

apex/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '0.1.0'

0 commit comments

Comments
 (0)