Invntr
Source

All instruments

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

Admission replaycrystal_lattice 0.1.0 · files 17483c387138…9a18
  1. 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 used
    two_theta_deg28.4421 ± 2.8e-0828.4421lockedunder 0.01 % of the tolerance used
    volume_A3160.191 ± 1.6e-07160.191lockedunder 0.01 % of the tolerance used
    packing_fraction0.340087 ± 3.4e-100.340087lockedunder 0.01 % of the tolerance used
    nearest_neighbour_A2.35169 ± 2.4e-092.35169lockedunder 0.01 % of the tolerance used
    coordination_number= 44lockedexact match
    atoms_per_cell8 ± 8e-098lockedunder 0.01 % of the tolerance used
    reflections.0.allowed= truemisseddiffers
    reflections.1.allowed= falsemisseddiffers
    reflections.2.allowed= falsemisseddiffers
    reflections.3.allowed= truemisseddiffers
    reflections.3.d_A{"value": 1.35775, "rel_tol": 1e-09}
    n_lines= 33lockedexact match
    lines.0.name= 111misseddiffers
    lines.0.multiplicity= 8misseddiffers
    lines.1.name= 220misseddiffers
    lines.1.multiplicity= 12misseddiffers
    lines.1.two_theta_deg{"value": 47.30229418789582, "rel_tol": 1e-09}
    lines.2.name= 311misseddiffers
    lines.2.multiplicity= 24misseddiffers
    lines.2.two_theta_deg{"value": 56.121812464542835, "rel_tol": 1e-09}
  2. 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 used
    packing_fraction0.74048 ± 7.4e-100.74048lockedunder 0.01 % of the tolerance used
    nearest_neighbour_A2.55612 ± 2.6e-092.55612lockedunder 0.01 % of the tolerance used
    coordination_number= 1212lockedexact match
    atoms_per_cell4 ± 4e-094lockedunder 0.01 % of the tolerance used
    d_A2.08706 ± 2.1e-092.08706lockedunder 0.01 % of the tolerance used
    reflections.0.allowed= truemisseddiffers
    reflections.1.allowed= falsemisseddiffers
    reflections.2.allowed= falsemisseddiffers
    reflections.3.allowed= truemisseddiffers
    reflections.3.two_theta_deg{"value": 50.45082010312029, "rel_tol": 1e-09}
    lines.0.name= 111misseddiffers
    lines.0.multiplicity= 8misseddiffers
    lines.1.name= 200misseddiffers
    lines.1.multiplicity= 6misseddiffers
  3. r0003alpha 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 used
    packing_fraction0.680175 ± 6.8e-100.680175lockedunder 0.01 % of the tolerance used
    nearest_neighbour_A2.48246 ± 2.5e-092.48246lockedunder 0.01 % of the tolerance used
    coordination_number= 88lockedexact match
    d_A2.02692 ± 2e-092.02692lockedunder 0.01 % of the tolerance used
    two_theta_deg44.6716 ± 4.5e-0844.6716lockedunder 0.01 % of the tolerance used
    reflections.0.allowed= truemisseddiffers
    reflections.1.allowed= falsemisseddiffers
    reflections.2.allowed= falsemisseddiffers
    reflections.3.allowed= truemisseddiffers
    lines.0.name= 110misseddiffers
    lines.0.multiplicity= 12misseddiffers
  4. r0004simple 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 used
    nearest_neighbour_A3 ± 3e-093lockedunder 0.01 % of the tolerance used
    coordination_number= 66lockedexact match
    atoms_per_cell1 ± 1e-091lockedunder 0.01 % of the tolerance used
    volume_A327 ± 2.7e-0827lockedunder 0.01 % of the tolerance used
    allowed= truetruelockedexact match
    two_theta_deg29.7566 ± 3e-0829.7566lockedunder 0.01 % of the tolerance used
    lines.0.name= 100misseddiffers
    lines.0.multiplicity= 6misseddiffers
  5. r0005ideal 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 used
    packing_fraction0.74048 ± 7.4e-100.74048lockedunder 0.01 % of the tolerance used
    nearest_neighbour_A3.2094 ± 3.2e-093.2094lockedunder 0.01 % of the tolerance used
    coordination_number= 1212lockedexact match
    volume_A346.7505 ± 4.7e-0846.7505lockedunder 0.01 % of the tolerance used
    d_A2.62046 ± 2.6e-092.62046lockedunder 0.01 % of the tolerance used
    reflections.0.allowed= truemisseddiffers
    reflections.1.allowed= falsemisseddiffers
    reflections.2.d_A{"value": 2.779421930905777, "rel_tol": 1e-09}
    reflections.3.d_A{"value": 2.4554864434865733, "rel_tol": 1e-09}
    reflections.3.allowed= truemisseddiffers
  6. r0006triclinic 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 used
    d_A1.45479 ± 1.5e-091.45479lockedunder 0.01 % of the tolerance used
    reciprocal.a_star_per_A{"value": 0.25, "rel_tol": 1e-09}
    reciprocal.gamma_star_deg{"value": 90.0, "rel_tol": 1e-09}
  7. 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 used
    d_A2.04124 ± 2e-092.04124lockedunder 0.01 % of the tolerance used
    reflections.1.d_A{"value": 2.041241452319315, "rel_tol": 1e-09}
  8. 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 used
    d_A4.69846 ± 4.7e-094.69846lockedunder 0.01 % of the tolerance used
    reflections.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}
  9. 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 used
    d_A1.5 ± 1.5e-091.5lockedunder 0.01 % of the tolerance used
    reflections.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}
  10. 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 used
    volume_A335.4283 ± 3.5e-0835.4283lockedunder 0.01 % of the tolerance used
    d_A2.08706 ± 2.1e-092.08706lockedunder 0.01 % of the tolerance used
    reflections.0.allowed= truemisseddiffers
    reflections.1.allowed= falsemisseddiffers
    reflections.2.allowed= falsemisseddiffers
    reflections.3.allowed= falsemisseddiffers
    reflections.4.allowed= truemisseddiffers
    reflections.4.d_A{"value": 2.087063488093578, "rel_tol": 1e-09}
    lines.0.d_A{"value": 2.087063488093578, "rel_tol": 1e-09}
    lines.0.multiplicity= 8misseddiffers
    lines.1.d_A{"value": 1.80745, "rel_tol": 1e-09}
    lines.1.multiplicity= 6misseddiffers
  11. r0011A-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 used
    allowed= truetruelockedexact match
    reflections.0.allowed= truemisseddiffers
    reflections.1.allowed= truemisseddiffers
    reflections.2.allowed= falsemisseddiffers
    reflections.3.allowed= falsemisseddiffers
    reflections.4.allowed= falsemisseddiffers
    reflections.5.allowed= falsemisseddiffers
    reflections.6.allowed= truemisseddiffers
    reflections.7.allowed= falsemisseddiffers
    lines.0.name= 100misseddiffers
    lines.0.multiplicity= 2misseddiffers
    lines.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= 011misseddiffers
    lines.1.multiplicity= 4misseddiffers
    lines.1.d_A{"value": 3.8411063979868794, "rel_tol": 1e-09}
    lines.2.name= 002misseddiffers
    lines.2.d_A{"value": 3.0, "rel_tol": 1e-09}
    lines.2.multiplicity= 2misseddiffers
  12. r0012B-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 used
    allowed= truetruelockedexact match
    reflections.0.allowed= truemisseddiffers
    reflections.1.allowed= falsemisseddiffers
    reflections.2.allowed= truemisseddiffers
    reflections.3.allowed= falsemisseddiffers
    reflections.4.allowed= falsemisseddiffers
    reflections.5.allowed= truemisseddiffers
    reflections.6.allowed= falsemisseddiffers
    reflections.7.allowed= truemisseddiffers
    lines.0.name= 010misseddiffers
    lines.0.multiplicity= 2misseddiffers
    lines.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= 101misseddiffers
    lines.1.multiplicity= 4misseddiffers
    lines.1.d_A{"value": 3.328201177351375, "rel_tol": 1e-09}
    lines.2.name= 002misseddiffers
    lines.2.d_A{"value": 3.0, "rel_tol": 1e-09}
    lines.2.multiplicity= 2misseddiffers
  13. r0013C-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 used
    allowed= truetruelockedexact match
    reflections.0.allowed= truemisseddiffers
    reflections.1.allowed= falsemisseddiffers
    reflections.2.allowed= falsemisseddiffers
    reflections.3.allowed= truemisseddiffers
    reflections.4.allowed= truemisseddiffers
    reflections.5.allowed= falsemisseddiffers
    reflections.6.allowed= falsemisseddiffers
    reflections.7.allowed= falsemisseddiffers
    lines.0.name= 001misseddiffers
    lines.0.multiplicity= 2misseddiffers
    lines.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= 110misseddiffers
    lines.1.multiplicity= 4misseddiffers
    lines.1.d_A{"value": 3.123475237772121, "rel_tol": 1e-09}
    lines.2.name= 002misseddiffers
    lines.2.d_A{"value": 3.0, "rel_tol": 1e-09}
    lines.2.multiplicity= 2misseddiffers
13 of 13 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

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

NameUnitDefaultMeaning
structurecustomA one-element structure fixes system, centring and atom positions; custom takes them from system and centring.
systemcubicCrystal system. trigonal means rhombohedral axes (a, alpha); monoclinic has unique axis b.
centringPLattice 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_degdegCell angle alpha; leave out where the system fixes it.
beta_degdegCell angle beta; leave out where the system fixes it.
gamma_degdegCell 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.5406Radiation wavelength; the default is Cu K-alpha1.
two_theta_max_degdeg120Upper end of the powder pattern.
molar_mass_g_per_molg/molMolar mass of one formula unit (one atom for the named structures); gives the density.
formula_units1Formula units per cell (Z), for a custom cell with molar_mass_g_per_mol.
atomsThe cell contents instead of molar_mass_g_per_mol: atoms per cell of each kind with their molar masses.

Readings

NameUnitMeaning
a_AÅ
b_AÅ
c_AÅ
alpha_degdeg
beta_degdeg
gamma_degdeg
c_over_a1
volume_A3Å^3
reciprocalReciprocal cell (crystallographers' convention, no 2 pi).
atoms_per_cell1
formula_units1
mass_per_cell_g_per_molg/molMass of one mole of cells.
density_g_per_cm3g/cm^3Theoretical (X-ray) density; null without masses.
nearest_neighbour_AÅNamed structures only.
atomic_radius_AÅHalf the nearest-neighbour distance.
coordination_number1Atoms 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_fraction1Equal 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_degdegBragg 2 theta of the first plane in hkl; null when lambda > 2d.
allowedWhether the first plane in hkl survives the reflection rule.
reflectionsOne row per plane in hkl; also out/reflections.csv.
n_lines1Powder lines below two_theta_max_deg.
first_line_two_theta_degdeg
linesFirst 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_completeFalse 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.

Terminal
MCP call