Skip to content
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
69aa46b
Add ase_interface with support for optimization and md
JunnHuo Jul 10, 2025
deea169
Keep the from_structures func in base_calculator
JunnHuo Jul 10, 2025
37ed942
Add predict and tasks modules; update ASE interface and property pred…
JunnHuo Jul 15, 2025
1c75f1d
Add example usage
JunnHuo Jul 15, 2025
06c3c3e
WIP: save local changes
JunnHuo Aug 29, 2025
ee55f16
modify err
JunnHuo Aug 29, 2025
0226096
Remove tests from tracking
JunnHuo Aug 29, 2025
c32fabd
Save local changes before rebase
JunnHuo Sep 1, 2025
6023fe5
Sync missing files from upstream/develop
JunnHuo Sep 1, 2025
0d3354f
modify train config
JunnHuo Sep 4, 2025
9a2dc78
revise train config (2nd version)
JunnHuo Sep 5, 2025
f8b5710
revise train config (3rd version)
JunnHuo Sep 7, 2025
24d6b70
Update training config (4th version)
JunnHuo Sep 8, 2025
a34fef1
Update training config (5th version)
JunnHuo Sep 8, 2025
59614f5
Update training config
JunnHuo Sep 8, 2025
6eeafb6
small fix
JunnHuo Sep 18, 2025
ab05190
small fix: correct structure generation
JunnHuo Sep 18, 2025
52f050a
save local changes before merge upstream
JunnHuo Sep 28, 2025
d841f0d
merge upstream develop
JunnHuo Sep 28, 2025
77d164f
change configs and README
JunnHuo Oct 15, 2025
e8ce0be
resolve config bug in predict.py
JunnHuo Oct 16, 2025
3ddeb0c
keep previous content
JunnHuo Oct 17, 2025
a83c8c4
keep previous content
JunnHuo Oct 17, 2025
e2ea426
keep previous content
JunnHuo Oct 17, 2025
578522a
keep previous content
JunnHuo Oct 17, 2025
b556ff1
fix: correct commit message for ppmatSim README
JunnHuo Oct 20, 2025
623ffc0
revert
JunnHuo Oct 24, 2025
70bca7f
remove experiments directory for PR review
JunnHuo Oct 24, 2025
d713a86
correct
JunnHuo Oct 24, 2025
743d006
correct
JunnHuo Oct 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_target_: ppmat.calculator.ase.ASECalculator
type: ase
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
log_file: out.log # Resolved to ${hydra:run.dir}/out.log
log_level: INFO # Logging level
# use_visualdl: False # Use VisualDL
# use_wandb: False # Use Weights & Biases (wandb)
# use_tensorboard: False # Use TensorBoard
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# @package _global_

# To run the script, use the following command:
# Option A:
# python applications/main.py --config-name md_ase \
# model.model_name=chgnet_mptrj \
#
# Option B:
# python applications/main.py --config-name md_ase \
# model.config_path=output/chgnet_mptrj/chgnet_mptrj.yaml \
# model.checkpoint_path=output/chgnet_mptrj/checkpoints/best.pdparams


device: cuda
seed: null

defaults:
- _self_
- run: default
- logger: default
- model: load_model
- system: load_system # load_system, ase_create
- task: md # opt, md
- calculator: ase
- override hydra/job_logging: disabled

hydra:
job:
name: md_ase
chdir: True # change working directory to run.dir
run:
dir: ./out_${hydra:job.name}/${now:%Y%m%d_%H%M%S} # output directory

# To convert the trajectory (.traj) file to XYZ format, run:
# ase convert <trajectory_file>.traj <output_file>.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
model_name: null
config_path: null
weights_name: null
checkpoint_path: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# @package _global_

# To run the script, use the following command:
# Option A:
# python applications/main.py --config-name optimizer_ase \
# model.model_name=chgnet_mptrj \
#
# Option B:
# python applications/main.py --config-name optimizer_ase \
# model.config_path=output/chgnet_mptrj/chgnet_mptrj.yaml \
# model.checkpoint_path=output/chgnet_mptrj/checkpoints/best.pdparams

device: cuda
seed: null

defaults:
- _self_
- run: default
- logger: default
- model: load_model
- system: ase_create # load_system, ase_create
- task: opt # opt, md
- calculator: ase
- override hydra/job_logging: disabled

hydra:
job:
name: optimizer_ase
chdir: True # change working directory to run.dir
run:
dir: ./out_${hydra:job.name}/${now:%Y%m%d_%H%M%S} # output directory

# To convert the trajectory (.traj) file to XYZ format, run:
# ase convert <trajectory_file>.traj <output_file>.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# @package _global_

# To run the script, use the following command:

# Option A:
# python applications/main.py --config-name potential \
# model.model_name=chgnet_mptrj \
#
# Option B:
# python applications/main.py --config-name potential \
# model.model_name=chgnet_mptrj \
# system.file_path=./interatomic_potentials/example_data/cifs/
#
# Option C:
# python applications/main.py --config-name potential \
# model.config_path=output/chgnet_mptrj/chgnet_mptrj.yaml \
# model.checkpoint_path=output/chgnet_mptrj/checkpoints/best.pdparams
# system.file_path=./interatomic_potentials/example_data/cifs/

device: cuda
seed: null

defaults:
- _self_
- run: default
- logger: default
- model: load_model
- system: load_system # load_system, ase_create
- override hydra/job_logging: disabled

hydra:
job:
name: potential
chdir: True # change working directory to run.dir
run:
dir: ./out_${hydra:job.name}/${now:%Y%m%d_%H%M%S} # output directory

# To convert the trajectory (.traj) file to XYZ format, run:
# ase convert <trajectory_file>.traj <output_file>.xyz
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方的property是用在哪个地方的?

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# @package _global_

# To run the script, use the following command:
# Option A:
# python applications/main.py --config-name property \
# model.model_name=megnet_mp2018_train_60k_e_form \
# system.file_path=./property_prediction/example_data/cifs/
#
# Option B:
# python applications/main.py --config-name property \
# model.config_path=output/megnet_mp2018_train_60k_e_form/megnet_mp2018_train_60k_e_form.yaml \
# model.checkpoint_path=output/megnet_mp2018_train_60k_e_form/checkpoints/best.pdparams

device: cuda
seed: null

defaults:
- _self_
- run: default
- logger: default
- model: load_model
- system: ase_create # load_system, ase_create
- override hydra/job_logging: disabled

hydra:
job:
name: property
chdir: True # change working directory to run.dir
run:
dir: ./out_${hydra:job.name}/${now:%Y%m%d_%H%M%S} # output directory

# To convert the trajectory (.traj) file to XYZ format, run:
# ase convert <trajectory_file>.traj <output_file>.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
experiment: null
work_dir: ${hydra:runtime.cwd}

# data_dir: ${run.work_dir}/data
# path: ${run.work_dir}/runs
# id: ${uuid:1}
# ckpt_path: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# @package _global_

# To run the script, use the following command:
# Option A:
# python applications/main.py --config-name property \
# model.model_name=megnet_mp2018_train_60k_e_form \
# system.file_path=./property_prediction/example_data/cifs/
#
# Option B:
# python applications/main.py --config-name property \
# model.config_path=output/megnet_mp2018_train_60k_e_form/megnet_mp2018_train_60k_e_form.yaml \
# model.checkpoint_path=output/megnet_mp2018_train_60k_e_form/checkpoints/best.pdparams

device: cuda
seed: null

defaults:
- _self_
- run: default
- logger: default
- model: load_model
- sample: ??? # Option: compute_metric, by_chemical_formula, by_num_atoms, by_dataloader
- override hydra/job_logging: disabled

hydra:
job:
name: sample
chdir: True # change working directory to run.dir
run:
dir: ./out_${hydra:job.name}/${now:%Y%m%d_%H%M%S} # output directory

# To convert the trajectory (.traj) file to XYZ format, run:
# ase convert <trajectory_file>.traj <output_file>.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: by_chemical_formula
chemical_formula: ???
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: by_dataloader
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: by_num_atoms
num_atoms: ???
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: compute_metric
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
interface: ase
structures:
- element: Fe
- element: Cu
- element: Mg
type: fcc
repeat: [4, 4, 4]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface: load_file
file_path: applications/example_data/cifs
# position_unit_input: Angstrom
# mass_unit_input: 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_target_: ppmat.calculator.ase.MDSimulationTask

temperature: 300 # Temperature in Kelvin
timestep: 0.1 # Timestep for MD simulation in fs
steps: 1000 # Number of MD steps
interval: 1 # Interval to save trajectory
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_target_: ppmat.calculator.ase.OptimizationTask

optimizer: LBFGS # Optimizer name
filter: FrechetCellFilter # Filter name
fmax: 0.05 # Maximum force tolerance
steps: 100 # Number of steps
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# generated using pymatgen
data_Al
_symmetry_space_group_name_H-M 'P 1'
_cell_length_a 4.03892969
_cell_length_b 4.03892969
_cell_length_c 4.03892969
_cell_angle_alpha 90.00000000
_cell_angle_beta 90.00000000
_cell_angle_gamma 90.00000000
_symmetry_Int_Tables_number 1
_chemical_formula_structural Al
_chemical_formula_sum Al4
_cell_volume 65.88687052
_cell_formula_units_Z 4
loop_
_symmetry_equiv_pos_site_id
_symmetry_equiv_pos_as_xyz
1 'x, y, z'
loop_
_atom_type_symbol
_atom_type_oxidation_number
Al0+ 0.0
loop_
_atom_site_type_symbol
_atom_site_label
_atom_site_symmetry_multiplicity
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
Al0+ Al0 1 0.00000000 0.00000000 0.00000000 1
Al0+ Al1 1 0.00000000 0.50000000 0.50000000 1
Al0+ Al2 1 0.50000000 0.00000000 0.50000000 1
Al0+ Al3 1 0.50000000 0.50000000 0.00000000 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# generated using pymatgen
data_AlCu
_symmetry_space_group_name_H-M 'P 1'
_cell_length_a 4.05572184
_cell_length_b 6.31517560
_cell_length_c 6.32456864
_cell_angle_alpha 65.48687748
_cell_angle_beta 71.36152755
_cell_angle_gamma 71.43809003
_symmetry_Int_Tables_number 1
_chemical_formula_structural AlCu
_chemical_formula_sum 'Al5 Cu5'
_cell_volume 136.37894604
_cell_formula_units_Z 5
loop_
_symmetry_equiv_pos_site_id
_symmetry_equiv_pos_as_xyz
1 'x, y, z'
loop_
_atom_site_type_symbol
_atom_site_label
_atom_site_symmetry_multiplicity
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
Al Al0 1 0.50000000 0.50000000 0.50000000 1
Al Al1 1 0.84514971 0.46048356 0.84957741 1
Al Al2 1 0.15485029 0.53951644 0.15042259 1
Al Al3 1 0.62316791 0.99377092 0.76059171 1
Al Al4 1 0.37683209 0.00622908 0.23940829 1
Cu Cu5 1 0.00000000 0.00000000 0.00000000 1
Cu Cu6 1 0.73969721 0.24150696 0.27583163 1
Cu Cu7 1 0.26030279 0.75849304 0.72416837 1
Cu Cu8 1 0.89095358 0.77254544 0.44562536 1
Cu Cu9 1 0.10904642 0.22745456 0.55437464 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# generated using pymatgen
data_LiMnO2
_symmetry_space_group_name_H-M 'P 1'
_cell_length_a 2.86877900
_cell_length_b 4.63447500
_cell_length_c 5.83250700
_cell_angle_alpha 90.00000000
_cell_angle_beta 90.00000000
_cell_angle_gamma 90.00000000
_symmetry_Int_Tables_number 1
_chemical_formula_structural LiMnO2
_chemical_formula_sum 'Li2 Mn2 O4'
_cell_volume 77.54484024
_cell_formula_units_Z 2
loop_
_symmetry_equiv_pos_site_id
_symmetry_equiv_pos_as_xyz
1 'x, y, z'
loop_
_atom_type_symbol
_atom_type_oxidation_number
Li+ 1.0
Mn3+ 3.0
O2- -2.0
loop_
_atom_site_type_symbol
_atom_site_label
_atom_site_symmetry_multiplicity
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
Li+ Li0 1 0.50000000 0.50000000 0.37975050 1
Li+ Li1 1 0.00000000 0.00000000 0.62024950 1
Mn3+ Mn2 1 0.50000000 0.50000000 0.86325250 1
Mn3+ Mn3 1 0.00000000 0.00000000 0.13674750 1
O2- O4 1 0.50000000 0.00000000 0.36082450 1
O2- O5 1 0.00000000 0.50000000 0.09851350 1
O2- O6 1 0.50000000 0.00000000 0.90148650 1
O2- O7 1 0.00000000 0.50000000 0.63917550 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件的作用是什么?如果是结果文件的话可以删除掉,或者在readme文件里注明参考结果文件,相关文件放到网上存储

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
file_name,energy_per_atom,force,stress,magmom
property_prediction/example_data/cifs/Al.cif,[[-3.6643398]],"[[-1.4901161e-08 1.3858080e-06 -4.3120235e-07]
[-9.3132257e-10 -8.6519867e-07 1.0430813e-07]
[ 6.9150701e-07 -1.6763806e-08 1.2293458e-06]
[-6.6123903e-07 -4.8521906e-07 -9.0338290e-07]]","[[-1.2588882e-01 4.2487745e-06 8.6164600e-06]
[ 4.4294275e-06 -1.2588955e-01 -6.6498583e-06]
[ 8.8680017e-06 -6.6590051e-06 -1.2589219e-01]]","[[0.02061005]
[0.02061002]
[0.02060978]
[0.02060993]]"
property_prediction/example_data/cifs/AlCu.cif,[[-4.118485]],"[[ 4.1117892e-07 -4.4133049e-07 2.0021107e-06]
[-5.2160695e-03 4.0400606e-03 1.6855899e-02]
[ 5.2174702e-03 -4.0380079e-03 -1.6858250e-02]
[-1.5204746e-02 -7.6037906e-03 5.5945456e-02]
[ 1.5203571e-02 7.6041333e-03 -5.5943772e-02]
[ 4.8428774e-08 -1.0426156e-06 -5.3364784e-07]
[ 3.8307473e-02 -9.5896043e-02 -6.1208583e-02]
[-3.8307074e-02 9.5897190e-02 6.1209716e-02]
[ 2.5706176e-02 -1.8066719e-02 -3.9052561e-02]
[-2.5707349e-02 1.8064771e-02 3.9050829e-02]]","[[-3.7951264 0.01920414 0.23555437]
[ 0.01920349 -2.4701474 -0.23675922]
[ 0.23555323 -0.23675986 -4.492184 ]]","[[0.00778838]
[0.01051749]
[0.01051739]
[0.01494901]
[0.01494877]
[0.01929218]
[0.01869392]
[0.01869386]
[0.01622796]
[0.01622802]]"
property_prediction/example_data/cifs/mp-18767-LiMnO2.cif,[[-7.367691]],"[[-1.4901161e-08 -4.2142347e-08 2.3821428e-02]
[-2.9802322e-08 2.9685907e-08 -2.3822412e-02]
[ 2.6822090e-07 -1.3038516e-07 9.2583150e-02]
[ 1.1920929e-07 1.1175871e-08 -9.2581131e-02]
[-5.9604645e-08 2.3283064e-08 -2.4323463e-03]
[ 1.0132790e-06 -2.0703301e-06 -1.3078392e-02]
[-1.3113022e-06 2.0330772e-06 1.3077289e-02]
[-5.9604645e-08 5.3085387e-08 2.4323836e-03]]","[[-3.0404767e-01 -3.9735078e-06 1.2365246e-06]
[-3.2817538e-06 2.2306754e-01 6.0997813e-06]
[ 3.0538124e-06 6.8471963e-06 -1.0721654e-01]]","[[3.0493736e-03]
[3.0493736e-03]
[3.8694177e+00]
[3.8694177e+00]
[4.4135526e-02]
[3.8622051e-02]
[3.8622051e-02]
[4.4135392e-02]]"
Loading