Skip to content
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
4139d34
changes
MM0hsin Jul 22, 2025
480cdef
Combine Geomopt and descriptors task into one workgraph
MM0hsin Jul 22, 2025
9439af6
Add sample_split.py and refactor to work with geometry.opti.ipynb
MM0hsin Jul 28, 2025
639b6b2
Rename descriptors_filter.ipynb
MM0hsin Jul 28, 2025
66d3f6e
Merge branch 'main' into add_geomopt_fine_tuning
MM0hsin Jul 28, 2025
500376e
changes
MM0hsin Jul 22, 2025
2f5ba0a
Combine Geomopt and descriptors task into one workgraph
MM0hsin Jul 22, 2025
e9f6489
Add sample_split.py and refactor to work with geometry.opti.ipynb
MM0hsin Jul 28, 2025
50ee7af
Rename descriptors_filter.ipynb
MM0hsin Jul 28, 2025
03a9fe1
Add descriptors_outputs to sample_split.py
MM0hsin Aug 4, 2025
0b9c336
Merge branch 'add_geomopt_fine_tuning' of https://github.com/MM0hsin/…
MM0hsin Aug 4, 2025
69d536e
Refactor descriptors_outputs in sample_spit.py
MM0hsin Aug 4, 2025
9ed07fb
Refactor process_and_split_data to accept singlefiledata outputs from…
MM0hsin Aug 5, 2025
0a45562
Refector descriptors_filter.ipynb workgraph
MM0hsin Aug 5, 2025
bb0b78e
Update sample_split.py to include WG function to run Geomopt and Desc…
MM0hsin Aug 12, 2025
278af75
Merge branch 'main' into add_geomopt_fine_tuning
MM0hsin Aug 12, 2025
408c111
Add descriptors_filter_qe.ipynb for QE calculations
MM0hsin Aug 20, 2025
5e893f8
Update descriptors_filter_qe.ipynb to QE task remotely
MM0hsin Sep 4, 2025
4a113c1
Minor tweak for QE task
MM0hsin Sep 4, 2025
7e68ff9
Add training task to descriptors_filter_qe.ipynb
MM0hsin Sep 8, 2025
85a3eaf
Merge branch 'main' into add_geomopt_fine_tuning
MM0hsin Sep 11, 2025
d77a5b7
Add tutorial for setting up an external computer (#214)
MM0hsin Sep 15, 2025
05e24dc
Update aiida-workgraph (#232)
ElliottKasoar Sep 16, 2025
061082d
Apply suggestions from code review
MM0hsin Sep 17, 2025
a94cfd0
Replace opt_kwargs with minimize_kwargs (#180)
MM0hsin Sep 16, 2025
cc510f0
Merge branch 'main' into add_geomopt_fine_tuning
MM0hsin Sep 17, 2025
e27dc23
Address PR comments
MM0hsin Sep 18, 2025
dd437f1
Refactor sample_split.py
MM0hsin Sep 24, 2025
95a94a7
Merge main
MM0hsin Sep 24, 2025
27cbc0f
Update workgraphs to work with new script
MM0hsin Sep 25, 2025
8fb3c92
Address PR comments
MM0hsin Oct 1, 2025
1d64033
Fix UV aiida-pseudo install fail
MM0hsin Oct 2, 2025
5442716
Address PR comments
MM0hsin Oct 20, 2025
cf53576
Address PR comments
MM0hsin Oct 23, 2025
00b6b1d
Address PR comment
MM0hsin Oct 23, 2025
0f1ab70
Remove unnessary notebook outputs
MM0hsin Oct 23, 2025
30b1719
Add aiida_qe optional dependancy
MM0hsin Oct 23, 2025
6b2939a
Add aiida_qe optional dependancy
MM0hsin Oct 23, 2025
c02f4d0
Address PR comments
MM0hsin Oct 23, 2025
355f8b3
Merge branch 'main' into add_geomopt_fine_tuning
MM0hsin Oct 23, 2025
ddfd655
Update examples/tutorials/workgraphs/descriptors_filter.ipynb
alinelena Oct 23, 2025
5919f92
Pushing QE workgraph changes for testing
MM0hsin Oct 24, 2025
374d449
Merge remote-tracking branch 'refs/remotes/upstream/add_geomopt_fine_…
MM0hsin Oct 24, 2025
13e0221
refactor qe workgraph with working inputs
MM0hsin Oct 24, 2025
3752dda
Address PR comments
MM0hsin Oct 27, 2025
887d647
Address wg bug
MM0hsin Oct 31, 2025
10a197d
Fix QE task inputs and address PR comments
MM0hsin Nov 3, 2025
adaea1f
Address PR comments
MM0hsin Nov 5, 2025
843a6fe
Address PR comments
MM0hsin Nov 6, 2025
912b27d
Fix markdown explanation
MM0hsin Nov 7, 2025
0bdcc98
Add link to notebook
MM0hsin Nov 7, 2025
4aea09d
Rename task [skip actions]
MM0hsin Nov 7, 2025
b01659a
Update examples/tutorials/workgraphs/descriptors_filter_qe.ipynb
alinelena Nov 11, 2025
a071a6b
Address PR comments
MM0hsin Nov 11, 2025
042842d
Merge remote-tracking branch 'refs/remotes/upstream/add_geomopt_fine_…
MM0hsin Nov 11, 2025
392850d
Merge branch 'main' into add_geomopt_fine_tuning
MM0hsin Nov 11, 2025
64d3147
Address PR comments
MM0hsin Nov 12, 2025
5f307e9
Address PR comments
MM0hsin Nov 12, 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
48 changes: 48 additions & 0 deletions examples/tutorials/structures/NaCl-traj.xyz

Large diffs are not rendered by default.

1,122 changes: 0 additions & 1,122 deletions examples/tutorials/structures/lj-traj.xyz

This file was deleted.

40 changes: 40 additions & 0 deletions examples/tutorials/workgraphs/JanusConfigfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "test"
E0s: 'average'
max_num_epochs: 1
model: 'MACE'
energy_key: 'qe_energy'
forces_key: 'qe_forces'
stress_key: 'qe_stress'
loss: 'universal'
energy_weight: 1
forces_weight: 10
stress_weight: 100
compute_stress: True
eval_interval: 2
error_table: 'PerAtomRMSE'
interaction_first: 'RealAgnosticResidualInteractionBlock'
interaction: 'RealAgnosticResidualInteractionBlock'
num_interactions: 2
correlation: 3
max_ell: 3
r_max: 4.0
max_L: 0
num_channels: 16
num_radial_basis: 6
MLP_irreps: '16x0e'
scaling: 'rms_forces_scaling'
lr: 0.005
weight_decay: 1e-8
ema: True
ema_decay: 0.995
scheduler_patience: 5
batch_size: 2
valid_batch_size: 2
patience: 50
amsgrad: True
device: 'cpu'
distributed: False
clip_grad: 100
keep_checkpoints: False
keep_isolated_atoms: True
save_cpu: True
71 changes: 43 additions & 28 deletions examples/tutorials/workgraphs/descriptors_filter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,32 @@
" The descriptors job reads the structure and computes numerical features\n",
" (fingerprints) for each structure.\n",
"3. Collect the descriptor outputs, as StructureData, for all structures\n",
" and pass them to `process_and_split_data` (a calcfunction).\n",
"4. `process_and_split_data` writes the structures to `train.xyz`, `test.xyz`,\n",
" and `valid.xyz` files, and returns a Dict node with the file paths."
" and pass them to `create_aiida_files` (a calcfunction task).\n",
"4. This calls `process_and_split_data` (a Python function) which writes the structures to `train.xyz`, `test.xyz`,\n",
" and `valid.xyz` files. The task returns `SinglefileData` AiiDA data types, hence why we have to create a `calcfunction` task as oppose to just a `task`, we do this so the files are available on the workchain."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "eec0b5ca",
"metadata": {},
"outputs": [],
"source": [
"from aiida_workgraph import task\n",
"from sample_split import process_and_split_data\n",
"from aiida.orm import SinglefileData\n",
"\n",
"@task.calcfunction(outputs = [\"test_file\", \"train_file\", \"valid_file\"])\n",
"def create_qe_files(**inputs):\n",
" \n",
" files = process_and_split_data(**inputs)\n",
"\n",
" return {\n",
" \"train_file\": SinglefileData(files[\"train_file\"]),\n",
" \"test_file\": SinglefileData(files[\"test_file\"]),\n",
" \"valid_file\": SinglefileData(files[\"valid_file\"])\n",
" }"
]
},
{
Expand All @@ -158,19 +181,18 @@
"outputs": [],
"source": [
"from aiida.orm import Str, Float, Bool, Int\n",
"from ase.io import read\n",
"from ase.io import iread\n",
"from aiida_workgraph import WorkGraph\n",
"from aiida.orm import StructureData\n",
"from sample_split import process_and_split_data\n",
"\n",
"initail_structure = \"../structures/lj-traj.xyz\"\n",
"num_structs = len(read(initail_structure, index=\":\"))\n",
"initial_structure = \"../structures/NaCl-traj.xyz\"\n",
"\n",
"with WorkGraph(\"Calculation Workgraph\") as wg:\n",
" final_structures = {}\n",
"\n",
" for i in range(num_structs):\n",
" structure = StructureData(ase=read(initail_structure, index=i))\n",
" for i, struct in enumerate(iread(initial_structure)):\n",
" structure = StructureData(ase=struct)\n",
"\n",
" geomopt_calc = wg.add_task(\n",
" geomoptCalc,\n",
Expand Down Expand Up @@ -199,9 +221,9 @@
" final_structures[f\"structs{i}\"] = descriptors_calc.outputs.xyz_output\n",
"\n",
" split_task = wg.add_task(\n",
" process_and_split_data,\n",
" create_qe_files,\n",
" config_types= Str(\"\"),\n",
" n_samples=Int(num_structs),\n",
" n_samples=Int(len(final_structures)),\n",
" prefix= Str(\"\"),\n",
" scale= Float(1.0e5),\n",
" append_mode= Bool(False),\n",
Expand Down Expand Up @@ -256,33 +278,23 @@
{
"cell_type": "code",
"execution_count": null,
"id": "fe7291b7",
"id": "d2f463f6",
"metadata": {},
"outputs": [],
"source": [
"wg.tasks.process_and_split_data.outputs.result.value.get_dict()"
"test_file = wg.tasks.create_qe_files.outputs.test_file.value\n",
"train_file = wg.tasks.create_qe_files.outputs.train_file.value\n",
"valid_file = wg.tasks.create_qe_files.outputs.valid_file.value"
]
},
{
"cell_type": "markdown",
"id": "514aeb77",
"id": "8dedf8c5",
"metadata": {},
"source": [
"We can use the outputs to visualise the data. For example, below we will plot a histogram of `mace_mp_descriptor`"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d2f463f6",
"metadata": {},
"outputs": [],
"source": [
"test_file = wg.tasks.process_and_split_data.outputs.result.value.get_dict()[\"test_file\"]\n",
"train_file = wg.tasks.process_and_split_data.outputs.result.value.get_dict()[\"train_file\"]\n",
"valid_file = wg.tasks.process_and_split_data.outputs.result.value.get_dict()[\"valid_file\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -294,9 +306,12 @@
"from ase.io import iread\n",
"import matplotlib.pyplot as plt\n",
"\n",
"test_mace_desc = np.array([i.info['mace_mp_descriptor'] for i in iread(test_file, index=':')])\n",
"train_mace_desc = np.array([i.info['mace_mp_descriptor'] for i in iread(train_file, index=':')])\n",
"valid_mace_desc = np.array([i.info['mace_mp_descriptor'] for i in iread(valid_file, index=':')])\n",
"with test_file.as_path() as path:\n",
" test_mace_desc = np.array([struct.info['mace_mp_descriptor'] for struct in iread(path, index=':')])\n",
"with train_file.as_path() as path:\n",
" train_mace_desc = np.array([struct.info['mace_mp_descriptor'] for struct in iread(path, index=':')])\n",
"with valid_file.as_path() as path:\n",
" valid_mace_desc = np.array([struct.info['mace_mp_descriptor'] for struct in iread(path, index=':')])\n",
"\n",
"all_values = np.concatenate([train_mace_desc, valid_mace_desc, test_mace_desc])\n",
"bins = np.linspace(all_values.min(), all_values.max(), len(all_values))\n",
Expand Down
Loading
Loading