crystal_lattice
Crystallography of one unit cell, any of the seven crystal systems: cell volume and reciprocal cell, the spacing d of any plane (hkl), its Bragg angle at a wavelength, which reflections the centring (P, I, F, A, B, C, R) or the diamond and hcp structures extinguish, the theoretical density from the atoms in the cell, and for sc, bcc, fcc, hcp and diamond the nearest-neighbour distance, coordination number and hard-sphere packing fraction found from the atom positions. Writes the powder line positions and multiplicities as a csv. No intensities: no structure factors or scattering factors.
- Field
- Materials and crystals
- Version
- 0.1.0
- Runs as
- Compiled (Rust)
- Typical run
- 0.1 s
Compiled from source: run sh packs/install.sh once before admitting it.
Known answers it must pass
r0001silicon, diamond cubic a = 5.4310 A at Cu K-alpha1 1.5406 A: closed forms d = a/sqrt(h^2+k^2+l^2) (d111 = 3.1356 A), Bragg 2theta = 2 asin(lambda/2d) (28.44 deg), packing pi sqrt(3)/16 = 0.34009, neighbour a sqrt(3)/4; diamond rule: 200 and 222 absent, so the lines run 111 (x8), 220 (x12), 311 (x24) (rel 1e-9)passed
d_A3.13559 ± 3.1e-093.13559lockedunder 0.01 % of the tolerance usedtwo_theta_deg28.4421 ± 2.8e-0828.4421lockedunder 0.01 % of the tolerance usedvolume_A3160.191 ± 1.6e-07160.191lockedunder 0.01 % of the tolerance usedpacking_fraction0.340087 ± 3.4e-100.340087lockedunder 0.01 % of the tolerance usednearest_neighbour_A2.35169 ± 2.4e-092.35169lockedunder 0.01 % of the tolerance usedcoordination_number= 44lockedexact matchatoms_per_cell8 ± 8e-098lockedunder 0.01 % of the tolerance usedreflections.0.allowed= truemisseddiffersreflections.1.allowed= falsemisseddiffersreflections.2.allowed= falsemisseddiffersreflections.3.allowed= truemisseddiffersreflections.3.d_A{"value": 1.35775, "rel_tol": 1e-09}n_lines= 33lockedexact matchlines.0.name= 111misseddifferslines.0.multiplicity= 8misseddifferslines.1.name= 220misseddifferslines.1.multiplicity= 12misseddifferslines.1.two_theta_deg{"value": 47.30229418789582, "rel_tol": 1e-09}lines.2.name= 311misseddifferslines.2.multiplicity= 24misseddifferslines.2.two_theta_deg{"value": 56.121812464542835, "rel_tol": 1e-09}r0002copper, fcc a = 3.6149 A, M = 63.546 g/mol: density 4M/(N_A a^3) = 8.935 g/cm^3, packing pi/(3 sqrt 2) = 0.74048, neighbour a/sqrt(2), 12 neighbours; F rule (all odd or all even): 100 and 110 absent, 111 and 200 present (rel 1e-9)passed
density_g_per_cm38.93529 ± 8.9e-098.93529lockedunder 0.01 % of the tolerance usedpacking_fraction0.74048 ± 7.4e-100.74048lockedunder 0.01 % of the tolerance usednearest_neighbour_A2.55612 ± 2.6e-092.55612lockedunder 0.01 % of the tolerance usedcoordination_number= 1212lockedexact matchatoms_per_cell4 ± 4e-094lockedunder 0.01 % of the tolerance usedd_A2.08706 ± 2.1e-092.08706lockedunder 0.01 % of the tolerance usedreflections.0.allowed= truemisseddiffersreflections.1.allowed= falsemisseddiffersreflections.2.allowed= falsemisseddiffersreflections.3.allowed= truemisseddiffersreflections.3.two_theta_deg{"value": 50.45082010312029, "rel_tol": 1e-09}lines.0.name= 111misseddifferslines.0.multiplicity= 8misseddifferslines.1.name= 200misseddifferslines.1.multiplicity= 6misseddiffersr0003alpha iron, bcc a = 2.8665 A, M = 55.845 g/mol: density 2M/(N_A a^3) = 7.874 g/cm^3, packing pi sqrt(3)/8 = 0.68017, neighbour a sqrt(3)/2, 8 neighbours; I rule (h+k+l even): 100 and 111 absent, 110 and 200 present (rel 1e-9)passed
density_g_per_cm37.87422 ± 7.9e-097.87422lockedunder 0.01 % of the tolerance usedpacking_fraction0.680175 ± 6.8e-100.680175lockedunder 0.01 % of the tolerance usednearest_neighbour_A2.48246 ± 2.5e-092.48246lockedunder 0.01 % of the tolerance usedcoordination_number= 88lockedexact matchd_A2.02692 ± 2e-092.02692lockedunder 0.01 % of the tolerance usedtwo_theta_deg44.6716 ± 4.5e-0844.6716lockedunder 0.01 % of the tolerance usedreflections.0.allowed= truemisseddiffersreflections.1.allowed= falsemisseddiffersreflections.2.allowed= falsemisseddiffersreflections.3.allowed= truemisseddifferslines.0.name= 110misseddifferslines.0.multiplicity= 12misseddiffersr0004simple cubic a = 3 A: packing pi/6 = 0.52360, neighbour a, 6 neighbours, one atom per cell, every reflection present, first line 100 (x6) at 2 asin(lambda/2a) (rel 1e-9)passed
packing_fraction0.523599 ± 5.2e-100.523599lockedunder 0.01 % of the tolerance usednearest_neighbour_A3 ± 3e-093lockedunder 0.01 % of the tolerance usedcoordination_number= 66lockedexact matchatoms_per_cell1 ± 1e-091lockedunder 0.01 % of the tolerance usedvolume_A327 ± 2.7e-0827lockedunder 0.01 % of the tolerance usedallowed= truetruelockedexact matchtwo_theta_deg29.7566 ± 3e-0829.7566lockedunder 0.01 % of the tolerance usedlines.0.name= 100misseddifferslines.0.multiplicity= 6misseddiffersr0005ideal hcp a = 3.2094 A, c left out: c/a = sqrt(8/3), packing pi/(3 sqrt 2) = 0.74048 (same as fcc), 12 neighbours at a, volume (sqrt 3/2) a^2 c; 001 absent (l odd, h+2k = 3n), 002 at c/2, 100 at a sqrt(3)/2, 101 present from 1/d^2 = 4(h^2+hk+k^2)/(3a^2) + l^2/c^2 (rel 1e-9)passed
c_over_a1.63299 ± 1.6e-091.63299lockedunder 0.01 % of the tolerance usedpacking_fraction0.74048 ± 7.4e-100.74048lockedunder 0.01 % of the tolerance usednearest_neighbour_A3.2094 ± 3.2e-093.2094lockedunder 0.01 % of the tolerance usedcoordination_number= 1212lockedexact matchvolume_A346.7505 ± 4.7e-0846.7505lockedunder 0.01 % of the tolerance usedd_A2.62046 ± 2.6e-092.62046lockedunder 0.01 % of the tolerance usedreflections.0.allowed= truemisseddiffersreflections.1.allowed= falsemisseddiffersreflections.2.d_A{"value": 2.779421930905777, "rel_tol": 1e-09}reflections.3.d_A{"value": 2.4554864434865733, "rel_tol": 1e-09}reflections.3.allowed= truemisseddiffersr0006triclinic 4 x 5 x 6 A with all angles 90 deg: the triclinic volume formula reduces to abc = 120 A^3 and d123 to 1/sqrt(1/a^2 + 4/b^2 + 9/c^2) (rel 1e-9)passed
volume_A3120 ± 1.2e-07120lockedunder 0.01 % of the tolerance usedd_A1.45479 ± 1.5e-091.45479lockedunder 0.01 % of the tolerance usedreciprocal.a_star_per_A{"value": 0.25, "rel_tol": 1e-09}reciprocal.gamma_star_deg{"value": 90.0, "rel_tol": 1e-09}r0007rhombohedral cell a = 2.5 A, alpha = 60 deg (the primitive cell of fcc with cube edge a sqrt 2): volume a^3/sqrt(2), a quarter of the cube; its 111 and 100 planes are both cube {111} planes, d = a sqrt(2/3) (rel 1e-9)passed
volume_A311.0485 ± 1.1e-0811.0485lockedunder 0.01 % of the tolerance usedd_A2.04124 ± 2e-092.04124lockedunder 0.01 % of the tolerance usedreflections.1.d_A{"value": 2.041241452319315, "rel_tol": 1e-09}r0008monoclinic 5 x 6 x 7 A, beta = 110 deg: volume abc sin(beta), d100 = a sin(beta), d010 = b, d001 = c sin(beta), beta* = 180 - beta (rel 1e-9)passed
volume_A3197.335 ± 2e-07197.335lockedunder 0.01 % of the tolerance usedd_A4.69846 ± 4.7e-094.69846lockedunder 0.01 % of the tolerance usedreflections.1.d_A{"value": 6.0, "rel_tol": 1e-09}reflections.2.d_A{"value": 6.5778483455013586, "rel_tol": 1e-09}reciprocal.beta_star_deg{"value": 70.0, "rel_tol": 1e-09}reciprocal.a_star_per_A{"value": 0.2128355544951824, "rel_tol": 1e-09}r0009hexagonal a = 3 A, c = 5 A: volume (sqrt 3/2) a^2 c, d110 = a/2, d112 from 1/d^2 = 4(h^2+hk+k^2)/(3a^2) + l^2/c^2, a* = 2/(a sqrt 3), gamma* = 60 deg (rel 1e-9)passed
volume_A338.9711 ± 3.9e-0838.9711lockedunder 0.01 % of the tolerance usedd_A1.5 ± 1.5e-091.5lockedunder 0.01 % of the tolerance usedreflections.1.d_A{"value": 1.2862393885688164, "rel_tol": 1e-09}reciprocal.a_star_per_A{"value": 0.3849001794597505, "rel_tol": 1e-09}reciprocal.gamma_star_deg{"value": 60.0, "rel_tol": 1e-09}r0010copper as an R lattice on hexagonal axes (a = a_c/sqrt 2, c = a_c sqrt 3, Z = 3, a_c = 3.6149 A): the same crystal as the fcc case, so density 4M/(N_A a_c^3) = 8.935 g/cm^3, volume 3 a_c^3/4, lines a_c/sqrt 3 (x8) then a_c/2 (x6); R rule -h+k+l = 3n: 001, 002, 100 absent, 003 and 101 present (rel 1e-9)passed
density_g_per_cm38.93529 ± 8.9e-098.93529lockedunder 0.01 % of the tolerance usedvolume_A335.4283 ± 3.5e-0835.4283lockedunder 0.01 % of the tolerance usedd_A2.08706 ± 2.1e-092.08706lockedunder 0.01 % of the tolerance usedreflections.0.allowed= truemisseddiffersreflections.1.allowed= falsemisseddiffersreflections.2.allowed= falsemisseddiffersreflections.3.allowed= falsemisseddiffersreflections.4.allowed= truemisseddiffersreflections.4.d_A{"value": 2.087063488093578, "rel_tol": 1e-09}lines.0.d_A{"value": 2.087063488093578, "rel_tol": 1e-09}lines.0.multiplicity= 8misseddifferslines.1.d_A{"value": 1.80745, "rel_tol": 1e-09}lines.1.multiplicity= 6misseddiffersr0011A-centred orthorhombic 4 x 5 x 6 A: the extra lattice point at (0, 1/2, 1/2) gives the structure factor 1 + exp(i pi (k+l)), zero when k+l is odd, so 010, 001, 110, 101, 1 -2 3 are absent; the lines run 100 (x2, d = 4 A), 011 (x4, d from 1/d^2 = h^2/a^2 + k^2/b^2 + l^2/c^2), 002 (x2, d = 3 A) (rel 1e-9)passed
d_A2.77054 ± 2.8e-092.77054lockedunder 0.01 % of the tolerance usedallowed= truetruelockedexact matchreflections.0.allowed= truemisseddiffersreflections.1.allowed= truemisseddiffersreflections.2.allowed= falsemisseddiffersreflections.3.allowed= falsemisseddiffersreflections.4.allowed= falsemisseddiffersreflections.5.allowed= falsemisseddiffersreflections.6.allowed= truemisseddiffersreflections.7.allowed= falsemisseddifferslines.0.name= 100misseddifferslines.0.multiplicity= 2misseddifferslines.0.d_A{"value": 4.0, "rel_tol": 1e-09}lines.0.two_theta_deg{"value": 22.20619307666478, "rel_tol": 1e-09}lines.1.name= 011misseddifferslines.1.multiplicity= 4misseddifferslines.1.d_A{"value": 3.8411063979868794, "rel_tol": 1e-09}lines.2.name= 002misseddifferslines.2.d_A{"value": 3.0, "rel_tol": 1e-09}lines.2.multiplicity= 2misseddiffersr0012B-centred orthorhombic 4 x 5 x 6 A: the extra lattice point at (1/2, 0, 1/2) gives the structure factor 1 + exp(i pi (h+l)), zero when h+l is odd, so 100, 001, 110, 011 are absent; the lines run 010 (x2, d = 5 A), 101 (x4, d from 1/d^2 = h^2/a^2 + k^2/b^2 + l^2/c^2), 002 (x2, d = 3 A) (rel 1e-9)passed
d_A2.77054 ± 2.8e-092.77054lockedunder 0.01 % of the tolerance usedallowed= truetruelockedexact matchreflections.0.allowed= truemisseddiffersreflections.1.allowed= falsemisseddiffersreflections.2.allowed= truemisseddiffersreflections.3.allowed= falsemisseddiffersreflections.4.allowed= falsemisseddiffersreflections.5.allowed= truemisseddiffersreflections.6.allowed= falsemisseddiffersreflections.7.allowed= truemisseddifferslines.0.name= 010misseddifferslines.0.multiplicity= 2misseddifferslines.0.d_A{"value": 5.0, "rel_tol": 1e-09}lines.0.two_theta_deg{"value": 17.72456683025567, "rel_tol": 1e-09}lines.1.name= 101misseddifferslines.1.multiplicity= 4misseddifferslines.1.d_A{"value": 3.328201177351375, "rel_tol": 1e-09}lines.2.name= 002misseddifferslines.2.d_A{"value": 3.0, "rel_tol": 1e-09}lines.2.multiplicity= 2misseddiffersr0013C-centred orthorhombic 4 x 5 x 6 A: the extra lattice point at (1/2, 1/2, 0) gives the structure factor 1 + exp(i pi (h+k)), zero when h+k is odd, so 100, 010, 101, 011, 1 -2 3 are absent; the lines run 001 (x2, d = 6 A), 110 (x4, d from 1/d^2 = h^2/a^2 + k^2/b^2 + l^2/c^2), 002 (x2, d = 3 A) (rel 1e-9)passed
d_A2.77054 ± 2.8e-092.77054lockedunder 0.01 % of the tolerance usedallowed= truetruelockedexact matchreflections.0.allowed= truemisseddiffersreflections.1.allowed= falsemisseddiffersreflections.2.allowed= falsemisseddiffersreflections.3.allowed= truemisseddiffersreflections.4.allowed= truemisseddiffersreflections.5.allowed= falsemisseddiffersreflections.6.allowed= falsemisseddiffersreflections.7.allowed= falsemisseddifferslines.0.name= 001misseddifferslines.0.multiplicity= 2misseddifferslines.0.d_A{"value": 6.0, "rel_tol": 1e-09}lines.0.two_theta_deg{"value": 14.7523626220737, "rel_tol": 1e-09}lines.1.name= 110misseddifferslines.1.multiplicity= 4misseddifferslines.1.d_A{"value": 3.123475237772121, "rel_tol": 1e-09}lines.2.name= 002misseddifferslines.2.d_A{"value": 3.0, "rel_tol": 1e-09}lines.2.multiplicity= 2misseddiffers
Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.
Inputs
| Name | Unit | Default | Meaning |
|---|---|---|---|
structure | custom | A one-element structure fixes system, centring and atom positions; custom takes them from system and centring. | |
system | cubic | Crystal system. trigonal means rhombohedral axes (a, alpha); monoclinic has unique axis b. | |
centring | P | Lattice centring; R is a rhombohedral lattice on hexagonal axes, obverse setting. | |
a_A | Å | Cell edge a. | |
b_A | Å | Cell edge b; leave out where the system fixes it. | |
c_A | Å | Cell edge c; leave out where the system fixes it. For hcp, left out means the ideal sqrt(8/3) a. | |
alpha_deg | deg | Cell angle alpha; leave out where the system fixes it. | |
beta_deg | deg | Cell angle beta; leave out where the system fixes it. | |
gamma_deg | deg | Cell angle gamma; leave out where the system fixes it. | |
hkl | [[1, 1, 1]] | Planes to report, as [h, k, l] triples. The first one feeds d_A and two_theta_deg. | |
wavelength_A | Å | 1.5406 | Radiation wavelength; the default is Cu K-alpha1. |
two_theta_max_deg | deg | 120 | Upper end of the powder pattern. |
molar_mass_g_per_mol | g/mol | Molar mass of one formula unit (one atom for the named structures); gives the density. | |
formula_units | 1 | Formula units per cell (Z), for a custom cell with molar_mass_g_per_mol. | |
atoms | The cell contents instead of molar_mass_g_per_mol: atoms per cell of each kind with their molar masses. |
Readings
| Name | Unit | Meaning |
|---|---|---|
a_A | Å | |
b_A | Å | |
c_A | Å | |
alpha_deg | deg | |
beta_deg | deg | |
gamma_deg | deg | |
c_over_a | 1 | |
volume_A3 | Å^3 | |
reciprocal | Reciprocal cell (crystallographers' convention, no 2 pi). | |
atoms_per_cell | 1 | |
formula_units | 1 | |
mass_per_cell_g_per_mol | g/mol | Mass of one mole of cells. |
density_g_per_cm3 | g/cm^3 | Theoretical (X-ray) density; null without masses. |
nearest_neighbour_A | Å | Named structures only. |
atomic_radius_A | Å | Half the nearest-neighbour distance. |
coordination_number | 1 | Atoms at exactly the nearest-neighbour distance. A real hcp metal (c/a not sqrt(8/3)) gives 6, not the 12 of the ideal cell. |
packing_fraction | 1 | Equal hard spheres touching at the nearest-neighbour distance. |
wavelength_A | Å | |
d_min_A | Å | Smallest spacing reachable below two_theta_max_deg. |
d_A | Å | Spacing of the first plane in hkl. |
two_theta_deg | deg | Bragg 2 theta of the first plane in hkl; null when lambda > 2d. |
allowed | Whether the first plane in hkl survives the reflection rule. | |
reflections | One row per plane in hkl; also out/reflections.csv. | |
n_lines | 1 | Powder lines below two_theta_max_deg. |
first_line_two_theta_deg | deg | |
lines | First 40 powder lines; all of them in out/powder_pattern.csv. Planes sharing one d (333 and 511) are one line, named after one of them, multiplicities added. | |
pattern_complete | False when the index limit of 40 cut the pattern short, or it has no line. |
Try the call
Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.