Skip to content

Commit b2f56f4

Browse files
committed
docs: add optional atst-tools examples
1 parent b389b8f commit b2f56f4

15 files changed

Lines changed: 486 additions & 1 deletion

File tree

interfaces/ASE_interface/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Please refer to the example scripts in the `examples` folder. Recommended learni
3232
7. **constraintmd.py** - Constrained molecular dynamics simulation
3333
8. **metadynamics.py** - Metadynamics simulation
3434
9. **neb.py** - Nudged Elastic Band (NEB) calculation
35+
10. **examples/atst_tools/README.md** - optional ATST-Tools workflow examples that use abacuslite for relax, NEB, Sella, CCQN, MD, and ABACUS input helpers
3536

3637
More usage examples will be provided in future versions.
3738

@@ -54,4 +55,4 @@ Thanks to the ABACUS development team for their support and contributions.
5455

5556
If you have any questions or suggestions, please contact us through:
5657

57-
- GitHub: [deepmodeling/abacus-develop](https://github.com/deepmodeling/abacus-develop)
58+
- GitHub: [deepmodeling/abacus-develop](https://github.com/deepmodeling/abacus-develop)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Optional ATST-Tools Workflow Examples
2+
3+
These examples show how ATST-Tools can use abacuslite as the ABACUS ASE
4+
calculator backend. They are an optional workflow layer on top of abacuslite:
5+
abacuslite itself does not depend on ATST-Tools.
6+
7+
Install the optional workflow package in an environment where this checkout is
8+
available:
9+
10+
```bash
11+
pip install atst-tools
12+
```
13+
14+
Each case is intentionally small and uses pseudopotential and orbital files from
15+
`tests/PP_ORB`. Run commands from the case directory so relative structure and
16+
PP/ORB paths resolve as written.
17+
18+
| Case | Workflow | Purpose |
19+
| --- | --- | --- |
20+
| `relax_si` | `calculation.type: relax` | Basic geometry optimization through `atst run`. |
21+
| `neb_si` | `calculation.type: neb` | Generated Si path with a short two-stage NEB setup. |
22+
| `sella_h2` | `calculation.type: sella` | Standalone single-ended saddle search syntax. |
23+
| `ccqn_h2` | `calculation.type: ccqn` | CCQN with an explicit reactive bond. |
24+
| `md_si` | `calculation.type: md` | ASE-driven MD and ABACUS-native MD templates. |
25+
| `abacus_helper` | `atst abacus prepare/collect` | INPUT/KPT/STRU preparation and conservative output collection. |
26+
27+
General workflow:
28+
29+
```bash
30+
cd interfaces/ASE_interface/examples/atst_tools/relax_si
31+
python make_inputs.py
32+
atst config validate config.yaml --print-normalized
33+
atst run --dry-run config.yaml
34+
atst run config.yaml
35+
```
36+
37+
For SAI GPU runs, keep the same YAML structure but change
38+
`calculator.abacus.parameters.ks_solver` from `genelpa` to `cusolver` if the
39+
loaded ABACUS build requires the GPU solver.
40+
41+
The helper case does not launch ABACUS:
42+
43+
```bash
44+
cd interfaces/ASE_interface/examples/atst_tools/abacus_helper
45+
python make_inputs.py
46+
atst abacus prepare config.yaml --structure inputs/init.extxyz --output-dir prepared_abacus --force
47+
atst abacus collect prepared_abacus --output abacus_results.json
48+
```
49+
50+
`collect` is normally useful after ABACUS has populated a run directory; using it
51+
on `prepared_abacus` only exercises the conservative file-summary path.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
calculation:
2+
type: relax
3+
init_structure: inputs/init.extxyz
4+
fmax: 0.10
5+
max_steps: 1
6+
optimizer: BFGS
7+
trajectory: helper_relax.traj
8+
logfile: helper_relax.log
9+
10+
calculator:
11+
name: abacus
12+
abacus:
13+
command: abacus
14+
mpi: 1
15+
omp: 1
16+
directory: helper_abacus_run
17+
kpts: [1, 1, 1]
18+
parameters:
19+
calculation: scf
20+
basis_type: lcao
21+
ks_solver: genelpa
22+
ecutwfc: 100
23+
dft_functional: pbe
24+
symmetry: 0
25+
scf_thr: 1e-6
26+
scf_nmax: 100
27+
cal_force: 1
28+
cal_stress: 0
29+
pseudo_dir: ../../../../../tests/PP_ORB
30+
orbital_dir: ../../../../../tests/PP_ORB
31+
pseudopotentials:
32+
Si: Si_ONCV_PBE-1.0.upf
33+
basissets:
34+
Si: Si_gga_8au_100Ry_2s2p1d.orb
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from pathlib import Path
2+
3+
from ase.build import bulk
4+
from ase.io import write
5+
6+
7+
HERE = Path(__file__).resolve().parent
8+
INPUTS = HERE / "inputs"
9+
10+
11+
def main():
12+
INPUTS.mkdir(exist_ok=True)
13+
atoms = bulk("Si", "diamond", a=5.43)
14+
write(INPUTS / "init.extxyz", atoms)
15+
print(f"Wrote {INPUTS / 'init.extxyz'}")
16+
17+
18+
if __name__ == "__main__":
19+
main()
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
calculation:
2+
type: ccqn
3+
init_structure: inputs/ts_guess.extxyz
4+
fmax: 0.05
5+
max_steps: 5
6+
trajectory: ccqn_h2.traj
7+
logfile: ccqn_h2.log
8+
final_structure: ccqn_h2_final.extxyz
9+
artifact_manifest: atst_artifacts_ccqn_h2.json
10+
e_vector_method: ic
11+
reactive_bonds: "1-2"
12+
ic_mode: democratic
13+
cos_phi: 0.5
14+
trust_radius_uphill: 0.05
15+
trust_radius_saddle_initial: 0.03
16+
accept_initial_converged: false
17+
mode_manifest: ccqn_h2_mode_manifest.json
18+
diagnostics_file: ccqn_h2_diagnostics.json
19+
directory: run_ccqn_h2
20+
21+
calculator:
22+
name: abacus
23+
abacus:
24+
command: abacus
25+
mpi: 1
26+
omp: 1
27+
directory: run_ccqn_h2
28+
kpts: [1, 1, 1]
29+
parameters:
30+
calculation: scf
31+
basis_type: lcao
32+
ks_solver: genelpa
33+
ecutwfc: 100
34+
dft_functional: pbe
35+
symmetry: 0
36+
scf_thr: 1e-6
37+
scf_nmax: 100
38+
cal_force: 1
39+
cal_stress: 0
40+
pseudo_dir: ../../../../../tests/PP_ORB
41+
orbital_dir: ../../../../../tests/PP_ORB
42+
pseudopotentials:
43+
H: H_ONCV_PBE-1.0.upf
44+
basissets:
45+
H: H_gga_8au_100Ry_2s1p.orb
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from pathlib import Path
2+
3+
from ase import Atoms
4+
from ase.io import write
5+
6+
7+
HERE = Path(__file__).resolve().parent
8+
INPUTS = HERE / "inputs"
9+
10+
11+
def main():
12+
INPUTS.mkdir(exist_ok=True)
13+
atoms = Atoms(
14+
"H2",
15+
positions=[(4.0, 4.0, 3.50), (4.0, 4.0, 4.50)],
16+
cell=[8.0, 8.0, 8.0],
17+
pbc=True,
18+
)
19+
write(INPUTS / "ts_guess.extxyz", atoms)
20+
print(f"Wrote {INPUTS / 'ts_guess.extxyz'}")
21+
22+
23+
if __name__ == "__main__":
24+
main()
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
calculation:
2+
type: md
3+
driver: abacus_native
4+
init_structure: inputs/init.traj
5+
steps: 5
6+
directory: run_md_si_abacus_native
7+
trajectory: md_si_abacus_native.traj
8+
summary_file: md_si_abacus_native_summary.json
9+
final_structure: md_si_abacus_native_final.traj
10+
artifact_manifest: atst_artifacts_md_si_abacus_native.json
11+
poll_interval_seconds: 5.0
12+
postprocess:
13+
summary:
14+
enabled: true
15+
output: md_si_abacus_native_post_summary.json
16+
convert:
17+
enabled: false
18+
format: extxyz
19+
output_prefix: md_si_abacus_native_post
20+
21+
calculator:
22+
name: abacus
23+
abacus:
24+
command: abacus
25+
mpi: 1
26+
omp: 1
27+
directory: run_md_si_abacus_native
28+
kpts: [1, 1, 1]
29+
parameters:
30+
calculation: md
31+
basis_type: lcao
32+
ks_solver: genelpa
33+
ecutwfc: 100
34+
dft_functional: pbe
35+
symmetry: 0
36+
scf_thr: 1e-6
37+
scf_nmax: 100
38+
smearing_method: gaussian
39+
smearing_sigma: 0.001
40+
mixing_type: broyden
41+
cal_force: 1
42+
cal_stress: 1
43+
init_wfc: atomic
44+
init_chg: atomic
45+
md_type: nvt
46+
md_nstep: 5
47+
md_dt: 0.5
48+
md_tfirst: 300
49+
pseudo_dir: ../../../../../tests/PP_ORB
50+
orbital_dir: ../../../../../tests/PP_ORB
51+
pseudopotentials:
52+
Si: Si_ONCV_PBE-1.0.upf
53+
basissets:
54+
Si: Si_gga_8au_100Ry_2s2p1d.orb
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
calculation:
2+
type: md
3+
driver: ase
4+
init_structure: inputs/init.traj
5+
ensemble: nvt
6+
algorithm: langevin
7+
steps: 5
8+
timestep_fs: 0.5
9+
temperature_K: 300.0
10+
friction_fs_inv: 0.01
11+
seed: 7
12+
trajectory: md_si_ase_abacus.traj
13+
logfile: md_si_ase_abacus.log
14+
summary_file: md_si_ase_abacus_summary.json
15+
final_structure: md_si_ase_abacus_final.traj
16+
artifact_manifest: atst_artifacts_md_si_ase_abacus.json
17+
postprocess:
18+
summary:
19+
enabled: true
20+
output: md_si_ase_abacus_post_summary.json
21+
convert:
22+
enabled: false
23+
format: extxyz
24+
output_prefix: md_si_ase_abacus_post
25+
26+
calculator:
27+
name: abacus
28+
abacus:
29+
command: abacus
30+
mpi: 1
31+
omp: 1
32+
directory: run_md_si_ase_abacus
33+
kpts: [1, 1, 1]
34+
parameters:
35+
calculation: scf
36+
basis_type: lcao
37+
ks_solver: genelpa
38+
ecutwfc: 100
39+
dft_functional: pbe
40+
symmetry: 0
41+
scf_thr: 1e-6
42+
scf_nmax: 100
43+
smearing_method: gaussian
44+
smearing_sigma: 0.001
45+
mixing_type: broyden
46+
cal_force: 1
47+
cal_stress: 1
48+
pseudo_dir: ../../../../../tests/PP_ORB
49+
orbital_dir: ../../../../../tests/PP_ORB
50+
pseudopotentials:
51+
Si: Si_ONCV_PBE-1.0.upf
52+
basissets:
53+
Si: Si_gga_8au_100Ry_2s2p1d.orb
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from pathlib import Path
2+
3+
from ase.build import bulk
4+
from ase.io import write
5+
6+
7+
HERE = Path(__file__).resolve().parent
8+
INPUTS = HERE / "inputs"
9+
10+
11+
def main():
12+
INPUTS.mkdir(exist_ok=True)
13+
atoms = bulk("Si", "diamond", a=5.43, cubic=True)
14+
write(INPUTS / "init.traj", atoms)
15+
print(f"Wrote {INPUTS / 'init.traj'}")
16+
17+
18+
if __name__ == "__main__":
19+
main()
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
calculation:
2+
type: neb
3+
init_chain: inputs/init_neb_chain.traj
4+
climb: true
5+
two_stage: true
6+
stage1_steps: 2
7+
stage1_fmax: 0.20
8+
fmax: 0.10
9+
k: 0.1
10+
algorism: improvedtangent
11+
parallel: false
12+
optimizer: FIRE
13+
max_steps: 5
14+
trajectory: neb_si.traj
15+
artifact_manifest: atst_artifacts_neb_si.json
16+
endpoint_singlepoint: auto
17+
18+
calculator:
19+
name: abacus
20+
abacus:
21+
command: abacus
22+
mpi: 1
23+
omp: 1
24+
directory: run_neb_si
25+
kpts: [1, 1, 1]
26+
parameters:
27+
calculation: scf
28+
basis_type: lcao
29+
ks_solver: genelpa
30+
ecutwfc: 100
31+
dft_functional: pbe
32+
symmetry: 0
33+
scf_thr: 1e-6
34+
scf_nmax: 100
35+
cal_force: 1
36+
cal_stress: 0
37+
pseudo_dir: ../../../../../tests/PP_ORB
38+
orbital_dir: ../../../../../tests/PP_ORB
39+
pseudopotentials:
40+
Si: Si_ONCV_PBE-1.0.upf
41+
basissets:
42+
Si: Si_gga_8au_100Ry_2s2p1d.orb

0 commit comments

Comments
 (0)