vibe-sketcherDocumentation

vibesketcher.document.bilbao

Bilbao Crystallographic Server structure format and setting transformations (#230).

The BCS structure format, as shown on the server’s input pages (TRANSTRU, VISUALIZE): the space-group ITA number, the lattice parameters (angstrom, degrees), the number of independent atoms, and one line per atom of the asymmetric unit:

# Space Group ITA number
221
# Lattice parameters (lengths in angstroems and angles in degrees)
5.0 5.0 5.0 90 90 90
# Number of independent atoms in the asymmetric unit
3
# [atom type] [number] [WP] [x] [y] [z]
Ba 1 1a 0.0 0.0 0
Ti 2 1b 0.5 0.5 0.5
O 3 3c 0.5 0.0 0.5

Lines starting with # are labels. The server takes the default setting of the space group, which is also what spacegroups.find() chooses for a bare number (origin choice 2, hexagonal axes). The second atom column is kept as a label only; a Wyckoff field such as 3c (or -) is checked against the multiplicity of the generated orbit. Nothing is retrieved from the server: users paste or open files they saved themselves.

Setting transformations (P, p) follow International Tables for Crystallography Vol. A, Section 1.5: the new basis is (a’, b’, c’) = (a, b, c) P, the origin shift p is given in the old coordinates, and x’ = P^-1 (x - p). Written as a-b,a+b,c;0,0,1/4.

References: M. I. Aroyo et al., Z. Kristallogr. 221, 15 (2006); M. I. Aroyo et al., Bulg. Chem. Commun. 43, 183 (2011).

Functions

add_to_document(document, structure)

crystal_parameters(structure)

origin_shift(source, target)

t (multiples of 1/8) with x -> x + t taking source's operations onto target's.

parse_transformation(text)

(P, p) from a-b,a+b,c;0,0,1/4 (ITA Vol.

read_bcs(text, *, identifier)

A crystal from BCS structure-format text, in the default setting.

transform_setting(structure, transformation, ...)

The same crystal in the basis (a,b,c)P with the origin moved to p.

write_bcs(structure, *[, symprec])

BCS structure-format text of a 3D crystal.

vibesketcher.document.bilbao.read_bcs(text, *, identifier)[source]

A crystal from BCS structure-format text, in the default setting.

Parameters:
Return type:

PeriodicStructure

vibesketcher.document.bilbao.write_bcs(structure, *, symprec=0.001)[source]

BCS structure-format text of a 3D crystal.

A structure built from a space group in its default setting (a template, the space-group builder or a BCS file) is written from its recorded asymmetric unit. Anything else is standardised and idealised with spglib (the symmetry extra) first.

Parameters:
Return type:

str

vibesketcher.document.bilbao.crystal_parameters(structure)[source]
Parameters:

structure (PeriodicStructure)

Return type:

tuple[float, …]

vibesketcher.document.bilbao.origin_shift(source, target)[source]

t (multiples of 1/8) with x -> x + t taking source’s operations onto target’s.

Parameters:
Return type:

ndarray | None

vibesketcher.document.bilbao.parse_transformation(text)[source]

(P, p) from a-b,a+b,c;0,0,1/4 (ITA Vol. A, Section 1.5).

Parameters:

text (str)

Return type:

tuple[ndarray, ndarray]

vibesketcher.document.bilbao.transform_setting(structure, transformation, *, identifier, tolerance=0.001)[source]

The same crystal in the basis (a,b,c)P with the origin moved to p.

Parameters:
Return type:

PeriodicStructure

vibesketcher.document.bilbao.add_to_document(document, structure)[source]
Parameters:
Return type:

Any