Skip to content

Commit

Permalink
update jupyter notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
curtischong committed Apr 18, 2024
1 parent ba0789f commit 85fa933
Show file tree
Hide file tree
Showing 2 changed files with 256 additions and 77 deletions.
313 changes: 246 additions & 67 deletions exploration/view_generated_results.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -54,74 +54,253 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2bb4c31d0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2bab8c750>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2bc5aca50>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[[-12.43242656 -4.31100055 1.09444839]\n",
" [ 10.80482135 -7.97667024 4.44763025]\n",
" [ 7.06126406 3.05692248 6.53137197]]\n",
"[[ -5.08694638 8.82677214 -3.46121738]\n",
" [ -4.71786844 -1.09531127 -7.63957805]\n",
" [-14.63669024 -3.40746059 -2.37948377]]\n",
"[[15.71311333 -2.02542082 3.59050382]\n",
" [ 1.34668618 11.02346565 -2.99007526]\n",
" [ 6.16415976 -0.20893886 6.1703389 ]]\n",
"[[ 6.66375365 -4.33683933 7.26270778]\n",
" [ 2.29144872 -10.39164951 3.23321741]\n",
" [ 15.54195403 2.05130529 1.63324053]]\n",
"[[-8.74856616 2.80196106 2.85011984]\n",
" [ 9.70354109 -5.89079301 7.11206427]\n",
" [12.05115048 7.88247869 2.34356772]]\n",
"[[-0.70048436 -5.90240462 4.80785975]\n",
" [11.43298481 -5.25268733 -1.39520226]\n",
" [11.58224802 4.46177105 6.24709786]]\n",
"[[ 0.72656779 -1.00570488 5.18610287]\n",
" [12.71856772 -5.91601415 4.45329181]\n",
" [ 5.69659504 8.32516638 -1.76139469]]\n",
"[[-8.42111769 8.11226736 -3.57192532]\n",
" [ 4.36404739 0.94966994 5.79775668]\n",
" [13.147116 7.32341454 0.04466999]]\n",
"[[ 14.44390832 -0.67882492 5.21890844]\n",
" [ 2.76911606 -9.88494802 0.22650338]\n",
" [-11.37088345 -3.94207657 5.27648545]]\n",
"[[ -3.42515662 7.99305659 -0.48561623]\n",
" [ 9.86819831 -3.31443432 7.31713184]\n",
" [-11.55328895 -3.00582376 1.57499704]]\n",
"[[ 9.93063086 -3.46650915 4.75951821]\n",
" [ 1.81530751 7.97383813 1.78929904]\n",
" [11.9105631 8.11228627 -3.07690452]]\n",
"[[ 0.21313634 5.04486429 5.24692208]\n",
" [14.45437566 5.64012744 1.42810121]\n",
" [-2.83638844 8.83247217 -5.43126753]]\n",
"[[11.662066 5.63600557 2.62265284]\n",
" [-7.07863212 5.83525052 1.58972048]\n",
" [-2.05020778 9.96233929 -6.95421438]]\n",
"[[-10.02289186 3.25594237 0.58124203]\n",
" [ 12.04523172 9.06268918 1.65990614]\n",
" [ -2.55985931 8.13834641 -7.38695458]]\n",
"[[-11.4964536 -6.02408019 -3.11592459]\n",
" [ 2.23530942 -9.71567856 4.88664201]\n",
" [ 8.92132787 -4.69079076 -2.20348432]]\n",
"[[ -4.54857762 -1.32717716 3.91146565]\n",
" [-11.47667133 4.76893693 -4.43625366]\n",
" [ 6.63435907 10.90492625 -2.46027654]]\n",
"[[ 7.43731015e+00 1.19000458e+01 1.37734858e-04]\n",
" [-1.70726610e+00 -1.46931491e-01 5.10634541e+00]\n",
" [ 1.27163932e+01 -5.47680055e+00 4.37376875e+00]]\n",
"[[ 9.11371575 4.86129288 4.1341157 ]\n",
" [-10.58501844 8.34360108 0.12973755]\n",
" [ -4.6401733 -7.11157074 5.86070232]]\n",
"[[ 3.54655024 7.1895251 -5.75026675]\n",
" [-1.92123555 8.39923773 3.91482907]\n",
" [14.34705214 -1.63957866 2.17576964]]\n",
"[[ 4.83787914 11.40463802 -2.22454439]\n",
" [-12.64178042 2.46386998 -1.82609413]\n",
" [ 3.00893341 -0.50587975 7.48328297]]\n"
"/Users/curtischong/Documents/dev/arreau/venv/lib/python3.11/site-packages/pymatgen/analysis/local_env.py:4148: UserWarning:\n",
"\n",
"No oxidation states specified on sites! For better results, set the site oxidation states in the structure.\n",
"\n",
"/Users/curtischong/Documents/dev/arreau/venv/lib/python3.11/site-packages/pymatgen/analysis/local_env.py:3941: UserWarning:\n",
"\n",
"CrystalNN: cannot locate an appropriate radius, covalent or atomic radii will be used, this can lead to non-optimal results.\n",
"\n"
]
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2c90587d0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2c9074690>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2bc5a33d0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2bc59bc90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2c8036e10>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2bada0a90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2b9392850>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"650\"\n",
" src=\"http://127.0.0.1:8884/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2be738450>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
Expand All @@ -138,10 +317,10 @@
"\n",
"for i in range(20):\n",
" lattice, frac_x, atomic_numbers = get_one_crystal(sample_result, i)\n",
" print(lattice)\n",
" #frac_x -= np.min(frac_x, axis=0)\n",
" #tiled_lattice, tiled_species, tiled_coordinates = tile_structure(lattice, atomic_numbers, frac_x, 2)\n",
" #display(Structure(tiled_lattice, tiled_species, tiled_coordinates))\n",
" #print(lattice)\n",
" frac_x -= np.min(frac_x, axis=0)\n",
" tiled_lattice, tiled_species, tiled_coordinates = tile_structure(lattice, atomic_numbers, frac_x, 2)\n",
" display(Structure(tiled_lattice, tiled_species, tiled_coordinates))\n",
"\n",
"#fig = plot_crystal(atomic_numbers, lattice, frac_x, show_bonds=False)\n",
"#display(fig)"
Expand Down
20 changes: 10 additions & 10 deletions main_diffusion_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ def generate_n_crystals(
if __name__ == "__main__":
num_atoms = 4
# use_constant_atomic_symbols = ["Ac", "Ac", "Ir", "Ag"]
use_constant_atomic_symbols = ["C", "C", "C", "C", "C", "C", "C", "C"]
# use_constant_atomic_symbols = None
# use_constant_atomic_symbols = ["C", "C", "C", "C", "C", "C", "C", "C"]
use_constant_atomic_symbols = None

if use_constant_atomic_symbols is not None:
num_atoms = len(use_constant_atomic_symbols)

generate_single_crystal(
num_atoms=num_atoms,
visualization_setting=VisualizationSetting.ALL_DETAILED,
use_constant_atomic_symbols=use_constant_atomic_symbols,
)
# generate_n_crystals(
# num_crystals=20,
# num_atoms_per_sample=4,
# generate_single_crystal(
# num_atoms=num_atoms,
# visualization_setting=VisualizationSetting.ALL,
# use_constant_atomic_symbols=use_constant_atomic_symbols,
# )
generate_n_crystals(
num_crystals=20,
num_atoms_per_sample=8,
use_constant_atomic_symbols=use_constant_atomic_symbols,
)

0 comments on commit 85fa933

Please sign in to comment.