- 
                Notifications
    
You must be signed in to change notification settings  - Fork 130
 
Feat: Add DeepMD MLFF support #999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 9 commits
f36c6e6
              c40b419
              77d9a73
              f73e1dd
              5a0a769
              3e6c85a
              707458c
              5c60b88
              1026a7f
              4c9d459
              a7d0345
              5d4faa5
              b012a93
              dff1030
              487feb0
              3421558
              7c5ca31
              f659079
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -49,7 +49,7 @@ def test_maker_initialization(): | |
| 
     | 
||
| @pytest.mark.parametrize( | ||
| "ff_name", | ||
| ["CHGNet", "M3GNet", "MACE", "GAP", "NEP", "Nequip"], | ||
| ["CHGNet", "M3GNet", "MACE", "GAP", "NEP", "Nequip", "DeepMD"], | ||
| ) | ||
| def test_ml_ff_md_maker( | ||
| ff_name, si_structure, sr_ti_o3_structure, al2_au_structure, test_dir, clean_dir | ||
| 
        
          
        
         | 
    @@ -68,6 +68,7 @@ def test_ml_ff_md_maker( | |
| "GAP": -5.391255755606209, | ||
| "NEP": -3.966232215741286, | ||
| "Nequip": -8.84670181274414, | ||
| "DeepMD": -744.6197365326168, | ||
| } | ||
| 
     | 
||
| # ASE can slightly change tolerances on structure positions | ||
| 
          
            
          
           | 
    @@ -96,6 +97,9 @@ def test_ml_ff_md_maker( | |
| "model_path": test_dir / "forcefields" / "nequip" / "nequip_ff_sr_ti_o3.pth" | ||
| } | ||
| unit_cell_structure = sr_ti_o3_structure.copy() | ||
| elif ff_name == "DeepMD": | ||
| calculator_kwargs = {"model": test_dir / "forcefields" / "deepmd" / "graph.pb"} | ||
| unit_cell_structure = sr_ti_o3_structure.copy() | ||
| 
     | 
||
| structure = unit_cell_structure.to_conventional() * (2, 2, 2) | ||
| 
     | 
||
| 
          
            
          
           | 
    @@ -138,8 +142,10 @@ def test_ml_ff_md_maker( | |
| for step in task_doc.objects["trajectory"].frame_properties | ||
| ) | ||
| 
     | 
||
| with pytest.warns(FutureWarning): | ||
| name_to_maker[ff_name]() | ||
| # Skip the following test for DeepMD, since it doesn't have concrete implementations | ||
                
       | 
||
| if ff_name != "DeepMD": | ||
| with pytest.warns(FutureWarning): | ||
| name_to_maker[ff_name]() | ||
| 
     | 
||
| 
     | 
||
| @pytest.mark.parametrize("traj_file", ["trajectory.json.gz", "atoms.traj"]) | ||
| 
          
            
          
           | 
    ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # About this model | ||
| 
     | 
||
| The Deep Potential model used for this test is `UniPero`, a universal interatomic potential for perovskite oxides. | ||
| 
     | 
||
| It can be downloaded from: https://github.com/sliutheorygroup/UniPero, | ||
| 
     | 
||
| For more details, refer to the original article: https://doi.org/10.1103/PhysRevB.108.L180104 | 
                              
       | 
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed