-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move oss.yml and papers.yaml to $lib for cleaner imports pnpm add --dev elementari
- Loading branch information
Showing
16 changed files
with
1,237 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
File renamed without changes.
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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<script lang="ts"> | ||
import GdmSLides from '$lib/2024-01-12-deepmind-interview.pdf' | ||
import oss from '$lib/oss.yml' | ||
import { references } from '$lib/papers.yaml' | ||
import Icon from '@iconify/svelte' | ||
import { references } from './cv/papers.yaml' | ||
import OpenSource from './open-source/+page.svelte' | ||
import oss from './open-source/oss.yml' | ||
import Physics from './physics/[email protected]' | ||
import Posts from './posts/[email protected]' | ||
|
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
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
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,67 @@ | ||
--- | ||
title: New Dielectric Materials | ||
date: 2024-01-29 | ||
cover: | ||
img: dielectric-banner.svg | ||
origin: Vecteezy | ||
url: https://vecteezy.com/vector-art/192230-robot-character-design | ||
tags: | ||
- Tutorial | ||
- Python | ||
--- | ||
|
||
<script> | ||
import { references } from '$lib/papers.yaml' | ||
import { projects } from '$lib/oss.yml' | ||
import { Structure, StructureCard } from 'elementari' | ||
|
||
const diel_paper = references.find((ref) => ref.id === `riebesell_pushing_2024`) | ||
const elementari = projects.find((proj) => proj.name === `Elementari`) | ||
|
||
const structs = import.meta.glob(`./*.json`, { as: `raw`, eager: true }) | ||
</script> | ||
|
||
[We just published data on two materials]({diel_paper.URL}), Zr<sub>2</sub>Bi<sub>2</sub>O<sub>7</sub> and CsTaTeO<sub>6</sub>, which were the result of a workflow to discover new dielectric materials. Dielectrics are in used CPUs and SSDs among many other electronic devices. We managed to experimentally synthesize both these materials and measure their dielectric properties (thanks Wes!), so I wanted to take the opportunity of having two crystal structures that are special to me to write a short tutorial on how to render 3D crystal structures in a browser using one of my side-projects called [`elementari`]({elementari.repo}). | ||
|
||
`elementari` currently only understands `pymatgen`'s JSON-like structure representation. Converting the CIF files you get from (of the structures we verified with [XRD](https://wikipedia.org/wiki/X-ray_crystallography) to have made in the lab) to this format is easy: | ||
|
||
```py | ||
from glob import glob | ||
|
||
from pymatgen.core import Structure | ||
|
||
for cif in glob("*.cif"): | ||
structure = Structure.from_file(cif) | ||
structure.to(cif.replace(".cif", ".json")) | ||
``` | ||
|
||
The resulting JSON files can then be visualized with `elementari` using the `Structure` component which again takes only half a dozen lines of code: | ||
|
||
```svelte | ||
<script> | ||
import { Structure, StructureCard } from 'elementari' | ||
const structs = import.meta.glob(`./*.json`, { as: `raw`, eager: true }) | ||
</script> | ||
{#each Object.entries(structs) as [name, json_struct]} | ||
{@const structure = JSON.parse(json_struct)} | ||
<StructureCard {structure} /> | ||
<Structure {structure} /> | ||
{/each} | ||
``` | ||
|
||
Here's what this code renders: | ||
|
||
<div style="display: grid; gap: 1em;"> | ||
{#each Object.entries(structs) as [name, json_struct]} | ||
{@const structure = JSON.parse(json_struct)} | ||
{@const [formula, spacegroup] = name.match(/\.\/(.+)-(.+)\.json/).slice(1)} | ||
<section> | ||
<StructureCard {structure} title="{formula} (<small>{spacegroup}</small>)" /> | ||
<Structure {structure} show_bonds={false} show_site_labels /> | ||
</section> | ||
{/each} | ||
</div> | ||
|
||
Note that the converted CIFs give us `pymatgen` `Structures`, not `StructureGraphs` which contain adjacency matrices to convey bond information. `elementari` can render bonds but `StructureGraph` support is still WIP and the JS code I wrote for on-the-fly bond detection is terrible (don't use it). Hopefully, something I'll fix in the coming months. |
226 changes: 226 additions & 0 deletions
226
src/routes/posts/new-dielectric-materials/Bi2Zr2O7-Fm3m.cif
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,226 @@ | ||
|
||
data_ | ||
_chemical_name_mineral ?Flourite? | ||
_cell_length_a 5.3485(10) | ||
_cell_length_b 5.3485(10) | ||
_cell_length_c 5.3485(10) | ||
_cell_angle_alpha 90 | ||
_cell_angle_beta 90 | ||
_cell_angle_gamma 90 | ||
_cell_volume 153.00(9) | ||
_space_group Fm-3m | ||
loop_ | ||
_symmetry_equiv_pos_as_xyz | ||
'x, y, z ' | ||
'-x, -y, z ' | ||
'-x, -z, -y ' | ||
'-x, -z, y ' | ||
'-x, z, -y ' | ||
'-x, z, y ' | ||
'-x, y, -z ' | ||
'-x, y, z ' | ||
'-y, -x, -z ' | ||
'-y, -x, z ' | ||
'-y, -z, -x ' | ||
'-y, -z, x ' | ||
'-y, z, -x ' | ||
'-y, z, x ' | ||
'-y, x, -z ' | ||
'-y, x, z ' | ||
'-z, -x, -y ' | ||
'-z, -x, y ' | ||
'-z, -y, -x ' | ||
'-z, -y, x ' | ||
'-z, y, -x ' | ||
'-z, y, x ' | ||
'-z, x, -y ' | ||
'-z, x, y ' | ||
'z, -x, -y ' | ||
'z, -x, y ' | ||
'z, -y, -x ' | ||
'z, -y, x ' | ||
'z, y, -x ' | ||
'z, y, x ' | ||
'z, x, -y ' | ||
'z, x, y ' | ||
'y, -x, -z ' | ||
'y, -x, z ' | ||
'y, -z, -x ' | ||
'y, -z, x ' | ||
'y, z, -x ' | ||
'y, z, x ' | ||
'y, x, -z ' | ||
'y, x, z ' | ||
'x, -y, -z ' | ||
'x, -y, z ' | ||
'x, -z, -y ' | ||
'x, -z, y ' | ||
'x, z, -y ' | ||
'x, z, y ' | ||
'x, y, -z ' | ||
'-x, -y, -z ' | ||
'x+1/2, y+1/2, z ' | ||
'-x+1/2, -y+1/2, z ' | ||
'-x+1/2, -z+1/2, -y ' | ||
'-x+1/2, -z+1/2, y ' | ||
'-x+1/2, z+1/2, -y ' | ||
'-x+1/2, z+1/2, y ' | ||
'-x+1/2, y+1/2, -z ' | ||
'-x+1/2, y+1/2, z ' | ||
'-y+1/2, -x+1/2, -z ' | ||
'-y+1/2, -x+1/2, z ' | ||
'-y+1/2, -z+1/2, -x ' | ||
'-y+1/2, -z+1/2, x ' | ||
'-y+1/2, z+1/2, -x ' | ||
'-y+1/2, z+1/2, x ' | ||
'-y+1/2, x+1/2, -z ' | ||
'-y+1/2, x+1/2, z ' | ||
'-z+1/2, -x+1/2, -y ' | ||
'-z+1/2, -x+1/2, y ' | ||
'-z+1/2, -y+1/2, -x ' | ||
'-z+1/2, -y+1/2, x ' | ||
'-z+1/2, y+1/2, -x ' | ||
'-z+1/2, y+1/2, x ' | ||
'-z+1/2, x+1/2, -y ' | ||
'-z+1/2, x+1/2, y ' | ||
'z+1/2, -x+1/2, -y ' | ||
'z+1/2, -x+1/2, y ' | ||
'z+1/2, -y+1/2, -x ' | ||
'z+1/2, -y+1/2, x ' | ||
'z+1/2, y+1/2, -x ' | ||
'z+1/2, y+1/2, x ' | ||
'z+1/2, x+1/2, -y ' | ||
'z+1/2, x+1/2, y ' | ||
'y+1/2, -x+1/2, -z ' | ||
'y+1/2, -x+1/2, z ' | ||
'y+1/2, -z+1/2, -x ' | ||
'y+1/2, -z+1/2, x ' | ||
'y+1/2, z+1/2, -x ' | ||
'y+1/2, z+1/2, x ' | ||
'y+1/2, x+1/2, -z ' | ||
'y+1/2, x+1/2, z ' | ||
'x+1/2, -y+1/2, -z ' | ||
'x+1/2, -y+1/2, z ' | ||
'x+1/2, -z+1/2, -y ' | ||
'x+1/2, -z+1/2, y ' | ||
'x+1/2, z+1/2, -y ' | ||
'x+1/2, z+1/2, y ' | ||
'x+1/2, y+1/2, -z ' | ||
'-x+1/2, -y+1/2, -z ' | ||
'x+1/2, y, z+1/2 ' | ||
'-x+1/2, -y, z+1/2 ' | ||
'-x+1/2, -z, -y+1/2 ' | ||
'-x+1/2, -z, y+1/2 ' | ||
'-x+1/2, z, -y+1/2 ' | ||
'-x+1/2, z, y+1/2 ' | ||
'-x+1/2, y, -z+1/2 ' | ||
'-x+1/2, y, z+1/2 ' | ||
'-y+1/2, -x, -z+1/2 ' | ||
'-y+1/2, -x, z+1/2 ' | ||
'-y+1/2, -z, -x+1/2 ' | ||
'-y+1/2, -z, x+1/2 ' | ||
'-y+1/2, z, -x+1/2 ' | ||
'-y+1/2, z, x+1/2 ' | ||
'-y+1/2, x, -z+1/2 ' | ||
'-y+1/2, x, z+1/2 ' | ||
'-z+1/2, -x, -y+1/2 ' | ||
'-z+1/2, -x, y+1/2 ' | ||
'-z+1/2, -y, -x+1/2 ' | ||
'-z+1/2, -y, x+1/2 ' | ||
'-z+1/2, y, -x+1/2 ' | ||
'-z+1/2, y, x+1/2 ' | ||
'-z+1/2, x, -y+1/2 ' | ||
'-z+1/2, x, y+1/2 ' | ||
'z+1/2, -x, -y+1/2 ' | ||
'z+1/2, -x, y+1/2 ' | ||
'z+1/2, -y, -x+1/2 ' | ||
'z+1/2, -y, x+1/2 ' | ||
'z+1/2, y, -x+1/2 ' | ||
'z+1/2, y, x+1/2 ' | ||
'z+1/2, x, -y+1/2 ' | ||
'z+1/2, x, y+1/2 ' | ||
'y+1/2, -x, -z+1/2 ' | ||
'y+1/2, -x, z+1/2 ' | ||
'y+1/2, -z, -x+1/2 ' | ||
'y+1/2, -z, x+1/2 ' | ||
'y+1/2, z, -x+1/2 ' | ||
'y+1/2, z, x+1/2 ' | ||
'y+1/2, x, -z+1/2 ' | ||
'y+1/2, x, z+1/2 ' | ||
'x+1/2, -y, -z+1/2 ' | ||
'x+1/2, -y, z+1/2 ' | ||
'x+1/2, -z, -y+1/2 ' | ||
'x+1/2, -z, y+1/2 ' | ||
'x+1/2, z, -y+1/2 ' | ||
'x+1/2, z, y+1/2 ' | ||
'x+1/2, y, -z+1/2 ' | ||
'-x+1/2, -y, -z+1/2 ' | ||
'x, y+1/2, z+1/2 ' | ||
'-x, -y+1/2, z+1/2 ' | ||
'-x, -z+1/2, -y+1/2 ' | ||
'-x, -z+1/2, y+1/2 ' | ||
'-x, z+1/2, -y+1/2 ' | ||
'-x, z+1/2, y+1/2 ' | ||
'-x, y+1/2, -z+1/2 ' | ||
'-x, y+1/2, z+1/2 ' | ||
'-y, -x+1/2, -z+1/2 ' | ||
'-y, -x+1/2, z+1/2 ' | ||
'-y, -z+1/2, -x+1/2 ' | ||
'-y, -z+1/2, x+1/2 ' | ||
'-y, z+1/2, -x+1/2 ' | ||
'-y, z+1/2, x+1/2 ' | ||
'-y, x+1/2, -z+1/2 ' | ||
'-y, x+1/2, z+1/2 ' | ||
'-z, -x+1/2, -y+1/2 ' | ||
'-z, -x+1/2, y+1/2 ' | ||
'-z, -y+1/2, -x+1/2 ' | ||
'-z, -y+1/2, x+1/2 ' | ||
'-z, y+1/2, -x+1/2 ' | ||
'-z, y+1/2, x+1/2 ' | ||
'-z, x+1/2, -y+1/2 ' | ||
'-z, x+1/2, y+1/2 ' | ||
'z, -x+1/2, -y+1/2 ' | ||
'z, -x+1/2, y+1/2 ' | ||
'z, -y+1/2, -x+1/2 ' | ||
'z, -y+1/2, x+1/2 ' | ||
'z, y+1/2, -x+1/2 ' | ||
'z, y+1/2, x+1/2 ' | ||
'z, x+1/2, -y+1/2 ' | ||
'z, x+1/2, y+1/2 ' | ||
'y, -x+1/2, -z+1/2 ' | ||
'y, -x+1/2, z+1/2 ' | ||
'y, -z+1/2, -x+1/2 ' | ||
'y, -z+1/2, x+1/2 ' | ||
'y, z+1/2, -x+1/2 ' | ||
'y, z+1/2, x+1/2 ' | ||
'y, x+1/2, -z+1/2 ' | ||
'y, x+1/2, z+1/2 ' | ||
'x, -y+1/2, -z+1/2 ' | ||
'x, -y+1/2, z+1/2 ' | ||
'x, -z+1/2, -y+1/2 ' | ||
'x, -z+1/2, y+1/2 ' | ||
'x, z+1/2, -y+1/2 ' | ||
'x, z+1/2, y+1/2 ' | ||
'x, y+1/2, -z+1/2 ' | ||
'-x, -y+1/2, -z+1/2 ' | ||
loop_ | ||
_atom_site_label | ||
_atom_site_fract_x | ||
_atom_site_fract_y | ||
_atom_site_fract_z | ||
_atom_site_occupancy | ||
_atom_site_B_iso_or_equiv | ||
Bi 0 0 0 0.5 3.30(17) | ||
Zr 0 0 0 0.5 3.30(17) | ||
O 0.25 0.25 0.25 0.875 8.1(4) | ||
loop_ | ||
_atom_site_aniso_label | ||
_atom_site_aniso_U_11 | ||
_atom_site_aniso_U_22 | ||
_atom_site_aniso_U_33 | ||
_atom_site_aniso_U_12 | ||
_atom_site_aniso_U_13 | ||
_atom_site_aniso_U_23 | ||
Bi 0 0 0 0 0 0 | ||
Zr 0 0 0 0 0 0 | ||
O 0 0 0 0 0 0 |
Oops, something went wrong.