vibesketch.chem.nanostructures

Carbon nanotubes, graphene and fullerenes generated from their parameters (#137).

A nanostructure is made, not drawn: its atoms come from the honeycomb lattice in Cartesian coordinates (angstrom), so a tube of thousands of atoms never goes through 2D layout and the MAX_LAYOUT_ATOMS bound does not apply; vibesketch.limits.MAX_ATOMS does, checked before any atom is made.

Nanotubes follow the chiral-vector construction (Saito, Dresselhaus and Dresselhaus, Physical Properties of Carbon Nanotubes, Imperial College Press 1998, ch. 3; Hamada, Sawada and Oshiyama, Phys. Rev. Lett. 68, 1579, 1992). With graphene’s lattice vectors a1, a2 (|a1| = |a2| = a = sqrt(3) a_CC) the chiral vector is Ch = n a1 + m a2, and

  • the diameter is d = a sqrt(n^2 + nm + m^2) / pi;

  • the chiral angle theta, between Ch and a1, has cos(theta) = (2n + m) / (2 sqrt(n^2 + nm + m^2)), 0 <= theta <= 30 degrees;

  • the translation vector is T = t1 a1 + t2 a2 with t1 = (2m + n)/d_R, t2 = -(2n + m)/d_R, d_R = gcd(2m + n, 2n + m), and |T| = sqrt(3) |Ch| / d_R;

  • one translation period holds N = 2(n^2 + nm + m^2)/d_R hexagons, 2N carbons.

The lattice points inside the rectangle Ch x (periods T) are rolled onto a cylinder of radius |Ch| / (2 pi). Walls of a multi-walled tube are concentric and should be 0.34 nm apart, the graphite interlayer spacing.

Fullerenes are the truncated icosahedron C60 (Kroto et al., Nature 318, 162, 1985), from the even permutations of (0, +-1, +-3 phi), (+-1, +-(2 + phi), +-2 phi) and (+-phi, +-2, +-phi^3). Seen along a five-fold axis C60 is two 30-atom hemispheres ending in rings of ten, which are the rings of a (5,5) tube; C70 inserts one ring at the equator (D5h), and a capped (5,5) tube inserts two rings per period. Stone-Wales defects turn one C-C bond by 90 degrees (Stone and Wales, Chem. Phys. Lett. 128, 501, 1986).

Coordinates are a starting geometry: bond lengths are the lattice’s a_CC = 1.42 angstrom, groups take standard bond lengths, and sp3 carbons stay where the lattice put them. Optimise before reading geometry from them.

Module Attributes

A_CC

The C-C distance in graphene, angstrom.

A_LATTICE

The lattice constant a = sqrt(3) a_CC, angstrom.

INTERLAYER_NM

Graphite's interlayer spacing, the wall spacing of a multi-walled tube, nm.

Functions

build(parameters)

The atom model of parameters; raises NanostructureRefused with the reason.

chiral_angle_deg(c)

theta from cos(theta) = (2n + m) / (2 sqrt(n^2 + nm + m^2)); 0 zigzag, 30 armchair.

concentric_walls(inner, count)

count walls about inner, each about 0.34 nm outside the last, of its type.

diameter_nm(c)

d = a sqrt(n^2 + nm + m^2) / pi, in nm.

hexagons_per_period(c)

N = 2 (n^2 + nm + m^2) / d_R; a period holds 2N carbons.

hill_formula(symbols)

The formula in Hill order: C, H, then the rest alphabetically; counts of 1 omitted.

identity_of(parameters)

The canonical identity of a nanostructure and its key, NANO- and 20 hex digits.

is_metallic(c)

Whether zone folding makes the tube metallic: n - m divisible by 3.

translation_angstrom(c)

|T| = sqrt(3) |Ch| / d_R, angstrom.

unrolled(c[, periods, margin])

The graphene sheet a wall is rolled from, Ch along +x and T along +y, in angstrom.

wall_properties(c)

Diameter, chiral angle, translation period and electronic character of one wall.

Classes

AtomModel(symbols, positions, bonds, description)

A generated structure: symbols, positions in angstrom, bonds (i, j, order).

Exceptions

NanostructureRefused

Parameters this generator cannot build; the message says why.

vibesketch.chem.nanostructures.A_CC = 1.42

The C-C distance in graphene, angstrom.

vibesketch.chem.nanostructures.INTERLAYER_NM = 0.34

Graphite’s interlayer spacing, the wall spacing of a multi-walled tube, nm.

class vibesketch.chem.nanostructures.AtomModel(symbols, positions, bonds, description, periodic=None, walls=<factory>)[source]

Bases: object

A generated structure: symbols, positions in angstrom, bonds (i, j, order).

Parameters:
symbols: list[str]
positions: list[list[float]]
bonds: list[tuple[int, int, float]]
description: str
periodic: PeriodicCell | None = None
walls: list[dict[str, Any]]

Diameter and chiral angle of each wall, for a nanotube.

property formula: str[source]
record(parameters)[source]
Parameters:

parameters (Annotated[Nanotube | Graphene | Nanoribbon | Fullerene, FieldInfo(annotation=NoneType, required=True, discriminator='kind')])

Return type:

Nanostructure

exception vibesketch.chem.nanostructures.NanostructureRefused[source]

Bases: ValueError

Parameters this generator cannot build; the message says why.

vibesketch.chem.nanostructures.build(parameters)[source]

The atom model of parameters; raises NanostructureRefused with the reason.

A dict is validated first (a pydantic.ValidationError names the field).

Parameters:

parameters (Annotated[Nanotube | Graphene | Nanoribbon | Fullerene, FieldInfo(annotation=NoneType, required=True, discriminator='kind')] | dict[str, Any])

Return type:

tuple[Annotated[Nanotube | Graphene | Nanoribbon | Fullerene, FieldInfo(annotation=NoneType, required=True, discriminator=’kind’)], AtomModel]

vibesketch.chem.nanostructures.chiral_angle_deg(c)[source]

theta from cos(theta) = (2n + m) / (2 sqrt(n^2 + nm + m^2)); 0 zigzag, 30 armchair.

Parameters:

c (Chirality)

Return type:

float

vibesketch.chem.nanostructures.concentric_walls(inner, count)[source]

count walls about inner, each about 0.34 nm outside the last, of its type.

Armchair walls step (n + 5, n + 5) and zigzag walls (n + 9, 0), the nearest whole steps to 0.34 nm; a chiral wall is scaled to the radius and rounded, so its chiral angle stays close to the inner wall’s.

Parameters:
Return type:

list[Chirality]

vibesketch.chem.nanostructures.diameter_nm(c)[source]

d = a sqrt(n^2 + nm + m^2) / pi, in nm.

Parameters:

c (Chirality)

Return type:

float

vibesketch.chem.nanostructures.hexagons_per_period(c)[source]

N = 2 (n^2 + nm + m^2) / d_R; a period holds 2N carbons.

Parameters:

c (Chirality)

Return type:

int

vibesketch.chem.nanostructures.hill_formula(symbols)[source]

The formula in Hill order: C, H, then the rest alphabetically; counts of 1 omitted.

Parameters:

symbols (Iterable[str])

Return type:

str

vibesketch.chem.nanostructures.identity_of(parameters)[source]

The canonical identity of a nanostructure and its key, NANO- and 20 hex digits.

It depends on the parameters alone, a tube’s length as whole periods of each wall, so the same structure asked for in nm or in periods has one identity. It replaces the InChI, which has no notation for these.

Parameters:

parameters (Annotated[Nanotube | Graphene | Nanoribbon | Fullerene, FieldInfo(annotation=NoneType, required=True, discriminator='kind')])

Return type:

tuple[str, str]

vibesketch.chem.nanostructures.is_metallic(c)[source]

Whether zone folding makes the tube metallic: n - m divisible by 3.

The rule ignores curvature, which opens a small gap in non-armchair tubes of small diameter (Saito, Dresselhaus and Dresselhaus 1998, ch. 4).

Parameters:

c (Chirality)

Return type:

bool

vibesketch.chem.nanostructures.translation_angstrom(c)[source]

|T| = sqrt(3) |Ch| / d_R, angstrom.

Parameters:

c (Chirality)

Return type:

float

vibesketch.chem.nanostructures.unrolled(c, periods=1, margin=0.12)[source]

The graphene sheet a wall is rolled from, Ch along +x and T along +y, in angstrom.

The lattice covers the rectangle Ch x (periods T) and margin of it around; returns the points (z = 0) and the C-C bonds between them.

Parameters:
Return type:

tuple[NDArray[float64], list[tuple[int, int]]]

vibesketch.chem.nanostructures.wall_properties(c)[source]

Diameter, chiral angle, translation period and electronic character of one wall.

Parameters:

c (Chirality)

Return type:

dict[str, Any]