Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
34,532 changes: 34,532 additions & 0 deletions hackathon/elastic_constants/MD_01-10-25.ipynb

Large diffs are not rendered by default.

1,701 changes: 1,701 additions & 0 deletions hackathon/elastic_constants/MD_03-09-25.ipynb

Large diffs are not rendered by default.

2,859 changes: 2,859 additions & 0 deletions hackathon/elastic_constants/MD_06-08-25.ipynb

Large diffs are not rendered by default.

33,412 changes: 33,412 additions & 0 deletions hackathon/elastic_constants/MD_08-10-25.ipynb

Large diffs are not rendered by default.

4,461 changes: 4,461 additions & 0 deletions hackathon/elastic_constants/MD_10-09-25.ipynb

Large diffs are not rendered by default.

4,550 changes: 4,550 additions & 0 deletions hackathon/elastic_constants/MD_10-09-25_2.ipynb

Large diffs are not rendered by default.

1,868 changes: 1,868 additions & 0 deletions hackathon/elastic_constants/MD_13-08-25.ipynb

Large diffs are not rendered by default.

1,862 changes: 1,862 additions & 0 deletions hackathon/elastic_constants/MD_15-10-25.ipynb

Large diffs are not rendered by default.

1,856 changes: 1,856 additions & 0 deletions hackathon/elastic_constants/MD_17-09-25.ipynb

Large diffs are not rendered by default.

1,878 changes: 1,878 additions & 0 deletions hackathon/elastic_constants/MD_17-09-25_langevin.ipynb

Large diffs are not rendered by default.

1,846 changes: 1,846 additions & 0 deletions hackathon/elastic_constants/MD_22-10-25.ipynb

Large diffs are not rendered by default.

1,918 changes: 1,918 additions & 0 deletions hackathon/elastic_constants/MD_22-10-25_ohne_job.ipynb

Large diffs are not rendered by default.

398 changes: 398 additions & 0 deletions hackathon/elastic_constants/MD_23-07-25.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,398 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "4a26f12c-f1c4-4262-b978-8afec1537ae1",
"metadata": {},
"source": [
"# Temperature dependent elastic constants\n",
"\n",
"## Background\n",
"\n",
"$$C_{ijkl} = \\frac{1}{V} \\frac{\\partial^2 U}{\\partial \\varepsilon_{ij}\\partial \\varepsilon_{kl}}$$\n",
"\n",
"$$U(T) = \\frac{V}{2}C_{ijkl}(T)\\varepsilon_{ij}\\varepsilon_{kl}$$\n",
"\n",
"$$\\sigma_{ij} = C_{ijkl}{\\varepsilon_{kl}}$$\n",
"\n",
"### How to get $U$ or $\\sigma$\n",
"\n",
"- MD\n",
"- Quasi-Harmonic\n",
"\n",
"## Tasks\n",
"\n",
"- Get $a_0$ from potential\n",
"- Lattice parameter (as a function of T)\n",
" - MD\n",
" - NVT\n",
" - NPT\n",
" - QH\n",
"- Calculate $U$ or $\\sigma$ for various $\\varepsilon$\n",
" - MD: Equilibriate and average with LAMMPS\n",
" - QH: Get strains from Yuriy's tool and run phonopy\n",
"- Fit\n",
"\n",
"## Teams\n",
"\n",
"- MD: Erik, Han, (Raynol), Prabhath, Jan\n",
"- QH: Raynol, (Sam), Bharathi, Ahmed, Haitham\n",
"- Fit & Yuriy: Sam\n",
"- Literature"
]
},
{
"cell_type": "markdown",
"id": "37118728",
"metadata": {},
"source": [
"# Implementation"
]
},
{
"cell_type": "markdown",
"id": "e0b4e2eb",
"metadata": {},
"source": [
"* https://atomistics.readthedocs.io/en/latest/bulk_modulus_with_gpaw.html#elastic-matrix\n",
"* https://github.com/pyiron/atomistics/blob/main/tests/test_elastic_lammpslib_functional.py\n",
"* https://github.com/pyiron/pyiron_workflow_atomistics/blob/interstitials/pyiron_workflow_atomistics/dataclass_storage.py\n",
"* https://github.com/ligerzero-ai/pyiron_workflow_lammps/blob/main/pyiron_workflow_lammps/engine.py#L21"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "ab2a0224",
"metadata": {},
"outputs": [],
"source": [
"from ase.build import bulk\n",
"from ase.atoms import Atoms"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "314284cf",
"metadata": {},
"outputs": [],
"source": [
"from atomistics.calculators import evaluate_with_lammpslib, get_potential_by_name"
]
},
{
"cell_type": "markdown",
"id": "0640a5d2",
"metadata": {},
"source": [
"## Create bulk sample"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "4ce06b81",
"metadata": {},
"outputs": [],
"source": [
"structure = bulk('Al', 'fcc', a=4.05, cubic=True)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "b07fbd51",
"metadata": {},
"outputs": [],
"source": [
"potential_name = \"1999--Mishin-Y--Al--LAMMPS--ipr1\""
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "34e9442c",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/cmmc/ptmp/pyironhb/pyiron_latest_env/lib/python3.11/site-packages/atomistics/calculators/lammps/potential.py:324: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" df_pot[\"Config\"] = config_lst\n"
]
}
],
"source": [
"df_pot_selected = get_potential_by_name(\n",
" potential_name=potential_name\n",
")\n"
]
},
{
"cell_type": "markdown",
"id": "b02f41d3",
"metadata": {},
"source": [
"## 0K Relaxed Structure"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "92ee7631",
"metadata": {},
"outputs": [],
"source": [
"def get_relaxed_structure(structure: Atoms, potential: str) -> Atoms:\n",
" \n",
" df_pot_selected = get_potential_by_name(\n",
" potential_name=potential\n",
" )\n",
" \n",
" result_dict = evaluate_with_lammpslib(\n",
" task_dict={\"optimize_positions_and_volume\": structure},\n",
" potential_dataframe=df_pot_selected,\n",
" )\n",
" \n",
" structure_relaxed = result_dict['structure_with_optimized_positions_and_volume']\n",
"\n",
" return structure_relaxed"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "2c46da55",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/cmmc/ptmp/pyironhb/pyiron_latest_env/lib/python3.11/site-packages/atomistics/calculators/lammps/potential.py:324: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" df_pot[\"Config\"] = config_lst\n",
"--------------------------------------------------------------------------\n",
"WARNING: There was an error initializing an OpenFabrics device.\n",
"\n",
" Local host: cmti001\n",
" Local device: hfi1_0\n",
"--------------------------------------------------------------------------\n"
]
},
{
"data": {
"text/plain": [
"Atoms(symbols='Al4', pbc=True, cell=[4.050004662201837, 4.050004662201837, 4.050004662201837])"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"relaxed_structure = get_relaxed_structure(structure, potential_name)\n",
"relaxed_structure"
]
},
{
"cell_type": "markdown",
"id": "115a15d0",
"metadata": {},
"source": [
"## 0K Lattice Constant"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "6ce6b4ba-ed90-4d53-a502-549e2980a481",
"metadata": {},
"outputs": [],
"source": [
"def get_minimum_lattice_constant(structure: Atoms, potential: str) -> float:\n",
"\n",
" structure_relaxed = get_relaxed_structure(structure, potential)\n",
" a_0 = structure_relaxed.get_volume()**(1/3) #Angstrom\n",
"\n",
" return a_0"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "e49c9a2b",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/cmmc/ptmp/pyironhb/pyiron_latest_env/lib/python3.11/site-packages/atomistics/calculators/lammps/potential.py:324: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" df_pot[\"Config\"] = config_lst\n"
]
},
{
"data": {
"text/plain": [
"4.050004662201837"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a_0 = get_minimum_lattice_constant(structure, potential_name)\n",
"a_0"
]
},
{
"cell_type": "markdown",
"id": "91518721",
"metadata": {},
"source": [
"# Skeleton for the workflow"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "347e96fd",
"metadata": {},
"outputs": [],
"source": [
"def get_minimum_lattice_constant(structure: \"ase.atoms.Atoms\", engine) -> float:\n",
" ...\n",
" return a_0"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "567a21f6-e0ab-46b1-970e-e780fd506e18",
"metadata": {},
"outputs": [],
"source": [
"def get_lattice_constant_with_QH(\n",
" structure: \"ase.atoms.Atoms\",\n",
" temperature: list[float] | float,\n",
" engine,\n",
" **kwargs,\n",
") -> list[float] | float:\n",
" ...\n",
" return a_0"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "21d46f96-f98e-4162-851f-a394cad338cd",
"metadata": {},
"outputs": [],
"source": [
"def get_lattice_constant_with_MD_NPT(\n",
" structure: Atoms,\n",
" temperature: list[float] | float,\n",
" engine,\n",
" **kwargs,\n",
") -> list[float] | float:\n",
" ...\n",
" return a_0"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f4746ba6-a30d-4185-991a-bd44ba18f345",
"metadata": {},
"outputs": [],
"source": [
"def get_lattice_constant_with_MD_NVT(\n",
" structure: \"ase.atoms.Atoms\",\n",
" temperature: list[float] | float,\n",
" engine,\n",
" **kwargs,\n",
") -> list[float] | float:\n",
" ...\n",
" return a_0"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c827ae3e-dfb2-4f01-ad77-0ffc849f5478",
"metadata": {},
"outputs": [],
"source": [
"def get_deformations(structure) -> list[list[float, float, float, float, float, float]]:\n",
" ...\n",
" return epsilon"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ccbad139-2a35-48a3-a40b-1807a78e2c8a",
"metadata": {},
"outputs": [],
"source": [
"# distribute get_stress_with_MD\n",
"\n",
"def get_stress_with_MD(\n",
" structure, temperature, strains: list[float, float, float, float, float, float], engine\n",
"):\n",
" ...\n",
" return sigma\n",
"\n",
"def get_energy_with_MD(structure, temperature, strains, engine):\n",
" ...\n",
" return energy\n",
"\n",
"def get_stress_with_QH(structure, temperature, strains, engine):\n",
" ...\n",
" return sigma\n",
"\n",
"def get_energy_with_QH(structure, temperature, strains, engine):\n",
" ...\n",
" return energy"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "pyiron-latest",
"language": "python",
"name": "pyiron-latest"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading