Skip to content

Commit

Permalink
Si demo (#114)
Browse files Browse the repository at this point in the history
* update si example

* update silicon.ipynb

* update nrl

* rename nrl notebook

* update Sn soc example

* chore: update Si_nrl.json

* chore: rename Si_nrl.ipynb and Sn_soc.ipynb
  • Loading branch information
QG-phy authored Apr 9, 2024
1 parent c4e8b49 commit 55b4d81
Show file tree
Hide file tree
Showing 40 changed files with 1,570 additions and 715 deletions.
5 changes: 4 additions & 1 deletion dptb/tests/data/json_model/Si_nrl.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
"rc": 6.6147151362875,
"w": 0.2645886054515
},
"soc":{}
"soc": {},
"freeze": false,
"std": 0.01,
"push": false
}
},
"model_params": {
Expand Down
7 changes: 6 additions & 1 deletion dptb/utils/read_NRL_tojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def nrl2dptb(input, NRL_data):
"rc": Rcut * bohr2ang,
"w": Lscreen * bohr2ang
},
"soc":{},
"freeze": freeze,
"std": std,
"push": push}
Expand Down Expand Up @@ -259,7 +260,11 @@ def nrl2dptb(input, NRL_data):
"method": f'NRL{overlap_type}',
"rc": Rcut * bohr2ang,
"w": Lscreen * bohr2ang
}
},
"soc":{},
"freeze": freeze,
"std": std,
"push": push
}
}
model['model_params'] = nrl_tb
Expand Down
756 changes: 756 additions & 0 deletions examples/NRL-TB/silicon/Si_nrl.ipynb

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions examples/NRL-TB/silicon/input_n2j.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"common_options": {
"basis": {
"Si": [
"3s",
"3p",
"d*"
]
},
"device": "cpu",
"dtype": "float32",
"overlap": true,
"seed": 3982377700
}
}
3 changes: 2 additions & 1 deletion examples/NRL-TB/silicon/outv2spd/nrl_ckpt.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"method": "NRL1",
"rc": 6.6147151362875,
"w": 0.2645886054515
}
},
"soc":{}
}
},
"model_params": {
Expand Down
227 changes: 14 additions & 213 deletions examples/NRL-TB/silicon/plot_v2.ipynb

Large diffs are not rendered by default.

710 changes: 710 additions & 0 deletions examples/Sn_soc/Sn_soc.ipynb

Large diffs are not rendered by default.

211 changes: 0 additions & 211 deletions examples/Sn_soc/data/non_soc/BANDS_1.dat

This file was deleted.

Binary file removed examples/Sn_soc/data/non_soc/ref_eig_band.npy
Binary file not shown.
211 changes: 0 additions & 211 deletions examples/Sn_soc/data/soc/BANDS_1.dat

This file was deleted.

Binary file removed examples/Sn_soc/data/soc/ref_eig_band.npy
Binary file not shown.
36 changes: 8 additions & 28 deletions examples/Sn_soc/plot_v1json_nonsoc.ipynb

Large diffs are not rendered by default.

37 changes: 8 additions & 29 deletions examples/Sn_soc/plot_v1json_soc.ipynb

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions examples/Sn_soc/plot_v2_soc.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/silicon/inputs/2-3_1_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"overlap": false
},
"train_options": {
"num_epoch": 1500,
"num_epoch": 50,
"batch_size": 1,
"ref_batch_size": 1,
"optimizer": {
Expand All @@ -23,7 +23,7 @@
"train": {"method": "eigvals"},
"reference": {"method": "eigvals"}
},
"save_freq": 500,
"save_freq": 50,
"validation_freq": 10,
"display_freq": 1
},
Expand Down
4 changes: 2 additions & 2 deletions examples/silicon/inputs/2-3_2_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"overlap": false
},
"train_options": {
"num_epoch": 1500,
"num_epoch": 50,
"batch_size": 1,
"ref_batch_size": 1,
"optimizer": {
Expand All @@ -23,7 +23,7 @@
"train": {"method": "eigvals"},
"reference": {"method": "eigvals"}
},
"save_freq": 500,
"save_freq": 50,
"validation_freq": 10,
"display_freq": 1
},
Expand Down
4 changes: 2 additions & 2 deletions examples/silicon/inputs/2-4_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"overlap": false
},
"train_options": {
"num_epoch": 1500,
"num_epoch": 50,
"batch_size": 1,
"optimizer": {
"lr": 0.001,
Expand All @@ -22,7 +22,7 @@
"train": {"method": "eigvals"},
"reference": {"method": "eigvals"}
},
"save_freq": 500,
"save_freq": 50,
"validation_freq": 10,
"display_freq": 1
},
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/silicon/ref_ckpts/dptb/checkpoint/mix.iter500.pth
Binary file not shown.
25 changes: 21 additions & 4 deletions examples/silicon/ref_ckpts/dptb/train_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"seed": 3982377700
},
"train_options": {
"num_epoch": 1500,
"num_epoch": 50,
"batch_size": 1,
"optimizer": {
"lr": 0.001,
Expand All @@ -36,11 +36,17 @@
"diff_on": false,
"eout_weight": 0.01,
"diff_weight": 0.01
},
"reference": {
"method": "eigvals",
"diff_on": false,
"eout_weight": 0.01,
"diff_weight": 0.01
}
},
"save_freq": 500,
"save_freq": 50,
"validation_freq": 10,
"display_freq": 100,
"display_freq": 1,
"ref_batch_size": 1,
"val_batch_size": 1,
"max_ckpt": 4
Expand Down Expand Up @@ -83,12 +89,23 @@
"w": 0.1
},
"freeze": true,
"soc": {},
"std": 0.01,
"push": false
"push": null
}
},
"data_options": {
"train": {
"root": "./data/",
"prefix": "kpathmd100",
"get_eigenvalues": true,
"type": "DefaultDataset",
"separator": ".",
"get_Hamiltonian": false,
"get_overlap": false,
"get_DM": false
},
"reference": {
"root": "./data/",
"prefix": "kpath_spk",
"get_eigenvalues": true,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified examples/silicon/ref_ckpts/nnsk_2/checkpoint/nnsk.ep500.pth
Binary file not shown.
Binary file modified examples/silicon/ref_ckpts/nnsk_2/checkpoint/nnsk.iter500.pth
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 4 additions & 1 deletion examples/silicon/run/band.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
[0.5000000000, 0.0000000000, 0.5000000000, 1 ]
],
"klabels":["G","X","X/U","K","G","L","W","X"],
"E_fermi":-9.307,
"nel_atom":{"Si":4},
"E_fermi":-4.722,
"emin":-15,
"emax":10,
"ref_band": "./data/kpath.0/eigenvalues.npy"
},
"AtomicData_options": {
"r_max": 5.0,
"er_max":5.0,
"oer_max":2.5,
"pbc": true
}
}
7 changes: 7 additions & 0 deletions examples/silicon/run/band_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@
[0.5000000000, -0.500000000, 0.0000000000, 1]
],
"klabels":["G","X","Y","G","Z","R_2","G","T_2","U_2","G","V_2"],
"nel_atom":{"Si":4},
"E_fermi":-9.702,
"emin":-14,
"emax":12,
"ref_band": "./data/kpathmd100.0/eigenvalues_ref.npy"
},
"AtomicData_options": {
"r_max": 5.0,
"er_max":5.0,
"oer_max":2.5,
"pbc": true
}
}
2 changes: 1 addition & 1 deletion examples/silicon/silicon.ipynb

Large diffs are not rendered by default.

0 comments on commit 55b4d81

Please sign in to comment.