-
Notifications
You must be signed in to change notification settings - Fork 9
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
[WIP] Implementation of 2D crystal former #7
Open
Br0kenSmi1e
wants to merge
34
commits into
deepmodeling:main
Choose a base branch
from
Br0kenSmi1e:twodim
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
57b6816
giggle edit
2f39564
try.py
3265736
3d worked
4416137
wyckoff.py changed to layer group
d261ed3
lattice.py modified to layer group
12b6193
lattice.py modify
7b0c8d3
meeting
3eaf53e
run problem on mac os solved
e5ed851
gaussian sample added
e3f4893
loss.py z-axis changed to gaussian
7a3379f
save
d0f300d
need to define obj
d39c173
edit loss.py to obj orin
8dbd881
loss.py, sample.py, mcmc.py changed to class SpaceGroup
67950eb
merge to main
b5901d2
merge
7ae2553
changed to layer group
69e1c43
roll back
863a13d
update
e4816f3
update
d377a7f
update
9264a73
update
7184e1c
update
75974d4
up
78fa26b
remove data
f49c13f
remove data
e5ff593
remove data
73be251
add tables as attributes
c85df0d
up
b59e090
modify the tests
a1fe51b
tests modified
6f7ab11
up
1caf726
finished
bed0fda
layer group and tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
job* | ||
*.out | ||
__pycache__/ | ||
./mp_20/*.csv |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
default: test | ||
|
||
.PHONY: test test-% train sample | ||
|
||
TESTS = $(shell find ./tests -name "test_*.py") | ||
|
||
test-%: | ||
python ./tests/test_$*.py | ||
|
||
test: | ||
@for TEST in $(TESTS); do \ | ||
echo "run $$TEST"; \ | ||
python $$TEST; \ | ||
done | ||
|
||
train: | ||
python ./main.py --folder ./data/ --train_path ./mp_20/train_layer_test.csv --valid_path ./mp_20/val_layer_test.csv --epochs 200 | ||
|
||
sample: | ||
python ./main.py --optimizer none --test_path ./mp_20/test_layer_test.csv --restore_path ./data/adam_bs_100_lr_0.0001_decay_0_clip_1_A_119_W_28_N_21_a_1_w_1_l_1_Nf_5_Kx_16_Kl_4_h0_256_l_16_H_16_k_64_m_64_e_32_drop_0.5/epoch_000100.pkl --spacegroup 65 --num_samples 10 --batchsize 200 --temperature 1.0 --elements C |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this dataset is for testing, maybe move it to the test folder? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"folder": "/home/niflheim2/cmr/C2DB-ASR/tree/A/C/C2-a6735a4a3797", | ||
"uid": "2C-1", | ||
"olduid": "C2-a6735a4a3797", | ||
"international": "P6/mmm", | ||
"number": 191, | ||
"pointgroup": "6/mmm", | ||
"has_inversion_symmetry": true, | ||
"lgnum": 80, | ||
"layergroup": "p6/mmm", | ||
"bravais_type": "Hexagonal (hp)", | ||
"thickness": 3.224913225352566e-08, | ||
"label": "original03-18", | ||
"gap": 0.0003000685114302737, | ||
"gap_dir": 0.0003000685114309398, | ||
"gap_dir_nosoc": 0.000308946496943463, | ||
"evac": 2.3363375983102452, | ||
"efermi": -4.248481577688634, | ||
"vbm": -4.248631611944349, | ||
"cbm": -4.2483315434329185, | ||
"minhessianeig": -7.00605419619458e-12, | ||
"dyn_stab": "Yes", | ||
"gap_hse": 0.0002564957267392476, | ||
"gap_dir_hse": 0.0002564957267392476, | ||
"efermi_hse": -4.213085568171573, | ||
"vbm_hse": -4.213213816034942, | ||
"cbm_hse": -4.212957320308203, | ||
"alphax_el": 6.574592003348396, | ||
"alphay_el": 6.574592003348392, | ||
"alphaz_el": 0.1533681498711251, | ||
"plasmafrequency_x": 0.0, | ||
"plasmafrequency_y": 0.0, | ||
"energy": -18.453766945888727, | ||
"icsd_id": 96620, | ||
"cod_id": 9012705, | ||
"doi": "10.1126/science.1102896", | ||
"is_magnetic": false, | ||
"spin_axis": "z", | ||
"dE_zx": 0.0, | ||
"dE_zy": 0.0, | ||
"topology": "Z2=1,C_M=1", | ||
"ehull": 0.0, | ||
"hform": -0.007391614814171277 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"folder": "/home/niflheim2/cmr/C2DB-ASR/tree/A/C/C2-a6735a4a3797", | ||
"uid": "2C-1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import re | ||
|
||
def lattice_from_file(file_path): | ||
f = open(file_path, "r") | ||
lines = f.readlines() | ||
lattice_str = re.search(r'Lattice="([^"]+)"', lines[1]).group(1) | ||
lattice_list = [eval(v) for v in lattice_str] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
{ | ||
"object_id": "asr.stiffness::Result", | ||
"constructor": "asr.stiffness::Result", | ||
"args": [], | ||
"kwargs": { | ||
"data": { | ||
"speed_of_sound_x": 21373.063352135574, | ||
"speed_of_sound_y": 21370.856641622737, | ||
"c_11": 345.6538905582198, | ||
"c_12": 70.60779871921024, | ||
"c_13": 0.0005778599312093563, | ||
"c_14": null, | ||
"c_15": null, | ||
"c_16": null, | ||
"c_21": 70.56537570227611, | ||
"c_22": 345.58251859948973, | ||
"c_23": 5.3339141915441094e-05, | ||
"c_24": null, | ||
"c_25": null, | ||
"c_26": null, | ||
"c_31": -1.48020629620793e-13, | ||
"c_32": -3.171870634731279e-14, | ||
"c_33": 275.09324474892543, | ||
"c_34": null, | ||
"c_35": null, | ||
"c_36": null, | ||
"c_41": null, | ||
"c_42": null, | ||
"c_43": null, | ||
"c_44": null, | ||
"c_45": null, | ||
"c_46": null, | ||
"c_51": null, | ||
"c_52": null, | ||
"c_53": null, | ||
"c_54": null, | ||
"c_55": null, | ||
"c_56": null, | ||
"c_61": null, | ||
"c_62": null, | ||
"c_63": null, | ||
"c_64": null, | ||
"c_65": null, | ||
"c_66": null, | ||
"__links__": { | ||
"strains--1.0%-xx": "C2-b088c34acc1b", | ||
"strains-+1.0%-xx": "C2-df0c254be7f9", | ||
"strains--1.0%-yy": "C2-65c455263aaa", | ||
"strains-+1.0%-yy": "C2-2fc059f556fa", | ||
"strains--1.0%-xy": "C2-9ec52112fdfe", | ||
"strains-+1.0%-xy": "C2-92a5b8f033fd" | ||
}, | ||
"stiffness_tensor": { | ||
"__ndarray__": [ | ||
[ | ||
3, | ||
3 | ||
], | ||
"float64", | ||
[ | ||
345.6538905582198, | ||
70.60779871921024, | ||
0.0005778599312093563, | ||
70.56537570227611, | ||
345.58251859948973, | ||
5.3339141915441094e-05, | ||
-1.48020629620793e-13, | ||
-3.171870634731279e-14, | ||
275.09324474892543 | ||
] | ||
] | ||
}, | ||
"eigenvalues": { | ||
"__ndarray__": [ | ||
[ | ||
3 | ||
], | ||
"float64", | ||
[ | ||
416.20479762329126, | ||
275.03161153441835, | ||
275.09324474892543 | ||
] | ||
] | ||
}, | ||
"dynamic_stability_stiffness": "high" | ||
}, | ||
"metadata": { | ||
"asr_name": "asr.stiffness", | ||
"resources": { | ||
"time": 0.05871438980102539, | ||
"ncores": 1, | ||
"tstart": 1605182101.3158286, | ||
"tend": 1605182101.374543 | ||
}, | ||
"params": { | ||
"strain_percent": 1.0 | ||
}, | ||
"code_versions": { | ||
"asr": "0.4.1-fef8a0ce2ab711c3284f5dbfd158907b17f534e9", | ||
"ase": "3.21.0b1-8a83b7f6a6fd68b95b9f542d7c054fa7204d764a", | ||
"gpaw": "20.10.1b1-7ff8d570c9d25f2af1c40c00271000e3ab505f1c" | ||
}, | ||
"creates": {} | ||
}, | ||
"strict": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
2 | ||
Lattice="2.4672312604313453 -1.7550685731635223e-20 0.0 -1.233615630215672 2.1366849485446453 0.0 1.118374734265682e-17 0.0 15.0" Properties=species:S:1:pos:R:3 energy=-18.453766945888727 dipole="0.8699688255098961 -0.5022767355947244 3.473501422988429e-08" free_energy=-18.45387516640614 pbc="T T F" | ||
C 0.00000000 0.00000000 7.49999997 | ||
C 1.23361563 0.71222832 7.50000001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import matplotlib.pyplot as plt | ||
from ase.db import connect | ||
|
||
db = connect('c2db.db') | ||
rows = db.select('layergroup') | ||
|
||
rows.layergroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Metadata-Version: 2.1 | ||
Name: crystalformer | ||
Version: 0.3 | ||
Summary: CrystalFormer is a transformer-based autoregressive model specifically designed for space group-controlled generation of crystalline materials. | ||
Home-page: https://github.com/deepmodeling/CrystalFormer | ||
Author: iopcompphys | ||
Author-email: [email protected], [email protected] | ||
License: Apache License | ||
Keywords: Crystal Generation | ||
Platform: any | ||
License-File: LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
LICENSE | ||
README.md | ||
setup.py | ||
crystalformer/__init__.py | ||
crystalformer.egg-info/PKG-INFO | ||
crystalformer.egg-info/SOURCES.txt | ||
crystalformer.egg-info/dependency_links.txt | ||
crystalformer.egg-info/top_level.txt | ||
crystalformer/data/layer.csv | ||
crystalformer/data/wyckoff_list.csv | ||
crystalformer/data/wyckoff_symbols.csv | ||
crystalformer/extension/__init__.py | ||
crystalformer/extension/experimental.py | ||
crystalformer/extension/loss.py | ||
crystalformer/extension/mcmc.py | ||
crystalformer/extension/model.py | ||
crystalformer/extension/train.py | ||
crystalformer/extension/transformer.py | ||
crystalformer/src/__init__.py | ||
crystalformer/src/attention.py | ||
crystalformer/src/checkpoint.py | ||
crystalformer/src/elements.py | ||
crystalformer/src/lattice.py | ||
crystalformer/src/loss.py | ||
crystalformer/src/mcmc.py | ||
crystalformer/src/sample.py | ||
crystalformer/src/sym_group.py | ||
crystalformer/src/train.py | ||
crystalformer/src/transformer.py | ||
crystalformer/src/utils.py | ||
crystalformer/src/von_mises.py | ||
crystalformer/src/wyckoff.py | ||
tests/test_fc_mask.py | ||
tests/test_lattice.py | ||
tests/test_sampling.py | ||
tests/test_transformer.py | ||
tests/test_utils.py | ||
tests/test_wyckoff.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
crystalformer |
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please remove.