Skip to content

Commit

Permalink
fix relaxor spelling and add doc str
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Dec 11, 2023
1 parent 7ad8550 commit c1b724e
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions examples/LiFePO4-NEB.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@
"%%time\n",
"results = {}\n",
"for UP_label, UP_cal in UP_cals.items():\n",
" relaxor = RelaxCalc(UP_cal, optimizer=\"BFGS\", relax_cell=True, fmax=0.02)\n",
" s_LFPO_relaxed = relaxor.calc(s_LFPO)['final_structure']\n",
" relaxer = RelaxCalc(UP_cal, optimizer=\"BFGS\", relax_cell=True, fmax=0.02)\n",
" supercell_LFPO_relaxed = relaxer.calc(s_LFPO)['final_structure']\n",
" results[UP_label] = {\n",
" \"supercell_LFPO\": s_LFPO_relaxed\n",
" \"supercell_LFPO\": supercell_LFPO_relaxed\n",
" }"
]
},
Expand Down Expand Up @@ -185,19 +185,19 @@
"source": [
"%%time\n",
"for UP_label, UP_cal in UP_cals.items():\n",
" relaxor = RelaxCalc(UP_cal, optimizer=\"BFGS\", relax_cell=False, fmax=0.02)\n",
" s_LFPO_relaxed = results[UP_label][\"supercell_LFPO\"]\n",
" relaxer = RelaxCalc(UP_cal, optimizer=\"BFGS\", relax_cell=False, fmax=0.02)\n",
" supercell_LFPO_relaxed = results[UP_label][\"supercell_LFPO\"]\n",
"\n",
" # NEB path along b and c directions have the same starting image.\n",
" s_LFPO_end_b = s_LFPO_relaxed.copy()\n",
" s_LFPO_end_b = supercell_LFPO_relaxed.copy()\n",
" s_LFPO_end_b.remove_sites([11])\n",
" s_LFPO_end_b_relaxed = relaxor.calc(s_LFPO_end_b)['final_structure']\n",
" s_LFPO_end_c = s_LFPO_relaxed.copy()\n",
" s_LFPO_end_b_relaxed = relaxer.calc(s_LFPO_end_b)['final_structure']\n",
" s_LFPO_end_c = supercell_LFPO_relaxed.copy()\n",
" s_LFPO_end_c.remove_sites([4])\n",
" s_LFPO_end_c_relaxed = relaxor.calc(s_LFPO_end_c)['final_structure']\n",
" s_LFPO_start_bc = s_LFPO_relaxed.copy()\n",
" s_LFPO_end_c_relaxed = relaxer.calc(s_LFPO_end_c)['final_structure']\n",
" s_LFPO_start_bc = supercell_LFPO_relaxed.copy()\n",
" s_LFPO_start_bc.remove_sites([5])\n",
" s_LFPO_start_bc_relaxed = relaxor.calc(s_LFPO_start_bc)['final_structure']\n",
" s_LFPO_start_bc_relaxed = relaxer.calc(s_LFPO_start_bc)['final_structure']\n",
" results[UP_label].update(\n",
" {\n",
" \"supercell_LFPO_end_b\":s_LFPO_end_b_relaxed,\n",
Expand Down Expand Up @@ -627,13 +627,14 @@
"\n",
"\n",
"def generate_path_cif_from_images(images: list, filename: str):\n",
" images_struct = [AseAtomsAdaptor().get_structure(i) for i in images]\n",
" \"\"\"Generate a cif file from a list of image atoms.\"\"\"\n",
" image_structs = list(map(AseAtomsAdaptor().get_structure, images))\n",
" sites = set()\n",
" lat = images_struct[0].lattice\n",
" for site in chain(*(struct for struct in images_struct)):\n",
" lat = image_structs[0].lattice\n",
" for site in chain(*(struct for struct in image_structs)):\n",
" sites.add(PeriodicSite(site.species, site.frac_coords, lat))\n",
" nebpath = Structure.from_sites(sorted(sites))\n",
" nebpath.to(filename, \"cif\")"
" neb_path = Structure.from_sites(sorted(sites))\n",
" neb_path.to(filename, \"cif\")"
]
},
{
Expand Down

0 comments on commit c1b724e

Please sign in to comment.