API Reference
This page is generated directly from the docstrings in the source, so it always matches the installed version. For task-oriented walkthroughs with runnable examples, see the User Guide; this page is the exhaustive signature-level reference.
Scope
Only the public, supported API is documented here. The 3-D visualizer's
internal modules (which require the optional vis extras) are intentionally
omitted — use the visualize helpers below instead.
Core
Structure
Structure(path: str | None = None)
Holds atom coordinates and atomic numbers for a single molecule.
Load a structure from an XYZ file and centre it at its centre of mass.
If path is None an empty structure is created (useful for testing).
Source code in pyrrhotite/structure.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
description_filename
property
description_filename: str
Return a human-readable label combining description and filename.
find_closest_index
find_closest_index(
coords: ndarray, atomic_number: int
) -> int
Return the index of the atom of the given element closest to coords.
Only atoms whose atomic number matches are considered, mirroring the original C++ structure.cpp find_closest_index.
This is used during the symmetry search to map a transformed atom position back onto a real atom: after applying a candidate symmetry operation, each atom should land on top of an atom of the same element. If the closest match of the right element is too far away, the operation is rejected.
np.einsum("ij,ij->i", ...) computes the row-wise dot product of a matrix with itself, giving squared distances for all candidate atoms simultaneously without an explicit Python loop.
Source code in pyrrhotite/structure.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
calculate_bond_pairs
calculate_bond_pairs() -> list[tuple[int, int]]
Return (i, j) index pairs for atoms likely bonded to each other.
Bond criterion: dist² < 20 · rᵢ · rⱼ (covalent radii in Ångströms)
Why this heuristic?
A typical covalent bond length is approximately rᵢ + rⱼ, so the squared bond length is roughly (rᵢ + rⱼ)² ≈ 4 · rᵢ · rⱼ (by the AM-GM inequality when rᵢ ≈ rⱼ). Multiplying by 20 gives a generous cutoff — about 2.2 × the expected bond length — that catches stretched or unusual bonds without false-positives from non-bonded neighbours.
Bond pairs are used by the symmetry search to generate candidate C2 axes (the midpoint bisector of a bond is often a symmetry axis), and to build candidate σ planes.
Source code in pyrrhotite/structure.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
print_atom_list
print_atom_list() -> None
Print a numbered atom index table: index, element symbol, and coordinates.
Use this alongside get_atoms_on_axis() / get_atoms_in_plane() results to identify which atoms correspond to returned indices.
Source code in pyrrhotite/structure.py
166 167 168 169 170 171 172 173 174 175 176 177 | |
Symmetry
Symmetry(structure: Structure)
Runs the full Schoenflies point-group determination pipeline for a Structure.
Store structure, build OperationManager, and run all pipeline steps.
Source code in pyrrhotite/symmetry.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
structure
property
structure: Structure
Return the structure used for this symmetry determination.
principal_moments
property
principal_moments: ndarray
Return the three principal moments of inertia, sorted ascending.
principal_axes
property
principal_axes: ndarray
Return the 3x3 matrix whose columns are the principal axes (eigenvectors).
x_axis
property
x_axis: ndarray
Return the Cartesian x axis (set after find_cartesian_axes).
y_axis
property
y_axis: ndarray
Return the Cartesian y axis (set after find_cartesian_axes).
z_axis
property
z_axis: ndarray
Return the Cartesian z axis (set after find_cartesian_axes).
cartesian_axes
property
cartesian_axes: ndarray
Return the 3x3 Cartesian-axis matrix with columns [x, y, z].
rotor_class
property
rotor_class: RotorClass
Return the rotor classification of the structure.
point_group
property
point_group: PointGroup
Return the determined point group.
operation_manager
property
operation_manager: OperationManager
Return the operation manager holding all found symmetry operations.
RotorClass
Bases: Enum
Rigid-rotor type determined from the degeneracy of the principal moments of inertia.
The classification determines which symmetry axes are worth searching for (see Symmetry._axis_inertially_allowed).
Members
AsymmetricTop Ia < Ib < Ic — all three moments are distinct. No rotational symmetry axis is required. Examples: water (C2v), hydrogen peroxide (C2). OblateSymmetricTop Ia ≈ Ib < Ic — the two smaller moments are equal; the unique axis is the short (oblate / "disc-like") axis. Examples: benzene (D6h), ammonia (C3v). ProlateSymmetricTop Ia < Ib ≈ Ic — the two larger moments are equal; the unique axis is the long (prolate / "cigar-like") axis. Examples: chloromethane (C3v), allene (D2d). Linear Ia ≈ 0, Ib ≈ Ic — the molecule lies along a single axis; rotation about that axis produces zero moment. Examples: CO2 (D∞h), HCN (C∞v). SphericalTop Ia ≈ Ib ≈ Ic — all three moments equal; the molecule has no preferred orientation. Examples: methane (Td), sulfur hexafluoride (Oh).
Structure generation
generate_idealized_structure
generate_idealized_structure(
point_group: str | PointGroupLabel,
radius: float = 1.0,
height: float = 0.6,
element: str = "F",
) -> Structure
Build an idealized Structure with the requested axial point group symmetry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point_group
|
str | PointGroupLabel
|
Either a |
required |
radius
|
float
|
Scale factor (default 1.0) applied to the ring radii used for the
primary ring(s) of atoms. The default geometry is tuned so that, at
|
1.0
|
height
|
float
|
Scale factor (default 0.6, matching the historical default) applied to the z-offsets used for apex atoms / second rings / hub-to-ring separation, where applicable. |
0.6
|
element
|
str
|
Placeholder element symbol used for the primary ring(s) of atoms. At
the default value ("F"), the primary ring element is instead chosen
per family to look like a plausible molecule for that atom's bonding
degree (see |
'F'
|
Returns:
| Type | Description |
|---|---|
Structure
|
A structure centred at its centre of mass, ready to be passed to
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in pyrrhotite/structure_generator.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | |
write_xyz
write_xyz(structure: Structure, path: str | Path) -> None
Write structure to path in standard XYZ format (see format_xyz).
Source code in pyrrhotite/structure_generator.py
471 472 473 474 | |
format_xyz
format_xyz(structure: Structure) -> str
Return structure formatted as standard XYZ text.
The output mirrors the format read by Structure._load_from_xyz: an
atom-count line, a comment line (structure.description), then one
<symbol> x y z line per atom.
Source code in pyrrhotite/structure_generator.py
456 457 458 459 460 461 462 463 464 465 466 467 468 | |
Character tables
get_or_generate_point_group
module-attribute
get_or_generate_point_group = find_point_group
generate_point_group
generate_point_group(
label: PointGroupLabel | str,
) -> PointGroup
Generate a PointGroup with full character table for any axial point group.
This is the public entry point called by symmetry.py when no hardcoded character table matches the detected operations (e.g. a molecule with a C15 axis). It dispatches to the appropriate build* function based on the group class (Cn, Cnh, Cnv, Sn, Dn, Dnh, Dnd).
label may be a PointGroupLabel or a Schoenflies symbol string (e.g. "C12v"), in which case it is parsed via parse_point_group_name.
Polyhedral groups (T, O, I) and linear groups (C∞v, D∞h) are NOT supported here — they use hardcoded tables in point_groups.py because their structure does not fit the uniform axial formulas.
Supported families: Cn, Cnh, Cnv, Sn (n even ≥ 4), Dn, Dnh, Dnd. Raises ValueError for unsupported families (polyhedral, linear, n < 2).
Source code in pyrrhotite/character_tables/generator.py
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 | |
find_point_group
find_point_group(
label: PointGroupLabel | str,
) -> PointGroup | None
Return a PointGroup by label: hardcoded table first, generator fallback.
label may be a PointGroupLabel or a Schoenflies symbol string (e.g. "D6h"), in which case it is parsed via parse_point_group_name.
Returns None if the label is not in POINT_GROUPS and cannot be generated (e.g. polyhedral or linear groups not in the hardcoded list).
Source code in pyrrhotite/character_tables/generator.py
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 | |
parse_point_group_name
parse_point_group_name(name: str) -> PointGroupLabel
Parse a Schoenflies point group name string into a PointGroupLabel.
Accepted formats
Fixed-order groups (no integer in the name): "C1", "Ci", "Cs" "T", "Td", "Th", "O", "Oh", "I", "Ih" "C∞v" or "Cinfv" (linear, no inversion) "D∞h" or "Dinfh" (linear, with inversion)
Axial groups with integer order n: Cyclic: "Cn" e.g. "C3", "C11" Horizontal: "Cnh" e.g. "C3h", "C10h" Pyramidal: "Cnv" e.g. "C3v", "C6v" Improper: "Sn" e.g. "S4", "S12" (n must be even and ≥ 4) Dihedral: "Dn" e.g. "D3", "D6" Prismatic: "Dnh" e.g. "D3h", "D6h" Antiprismatic:"Dnd" e.g. "D3d", "D4d"
The name is case-sensitive for the leading letter (C, D, S, T, O, I) and case-insensitive for the suffix (h, v, d).
Examples:
>>> parse_point_group_name("C3v")
PointGroupLabel(Cv, 3)
>>> parse_point_group_name("D6h")
PointGroupLabel(Dh, 6)
>>> parse_point_group_name("Oh")
PointGroupLabel(Oh)
Raises:
| Type | Description |
|---|---|
ValueError
|
If the string cannot be parsed or the combination is invalid. |
Source code in pyrrhotite/character_tables/generator.py
1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 | |
print_character_table_for
print_character_table_for(name: str) -> None
Look up or generate the character table for a point group and print it.
The name must be a Schoenflies symbol in the format described by
:func:parse_point_group_name. Short summary of accepted formats:
- Fixed groups —
"C1","Ci","Cs","T","Td","Th","O","Oh","I","Ih","C∞v"/"Cinfv","D∞h"/"Dinfh" - Axial groups —
"Cn","Cnh","Cnv","Sn","Dn","Dnh","Dnd"where n is any valid integer (e.g."C3v","D6h","S12","D11","C20v")
Groups already in the hardcoded POINT_GROUPS list are used directly; all others are generated on-the-fly via the analytical formulas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Schoenflies symbol (case-sensitive leading letter, case-insensitive suffix). Whitespace is stripped automatically. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If name cannot be parsed or the requested group is unavailable (e.g. polyhedral groups with n > hardcoded limit have no generator). |
Examples:
>>> print_character_table_for("C3v")
C3v | E | 2C3 | 3σv
----------------------------
A1 | 1 | 1 | 1
A2 | 1 | 1 | -1
E | 2 | -1 | 0
>>> print_character_table_for("D6h")
...full 16-row D6h table...
>>> print_character_table_for("C12v")
...generated C12v table for n=12...
Source code in pyrrhotite/character_tables/generator.py
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 | |
format_html
format_html(names: list[str]) -> str
Return HTML code for one or more named point group character tables.
The returned string is a <style> block followed by one <table>
per group — suitable for embedding in an existing HTML page. For a
complete standalone document use :func:save_html.
Source code in pyrrhotite/character_tables/html_formatter.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
save_html
save_html(
names: list[str], path: str | None = None
) -> Path
Save a standalone HTML document with the requested character tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
list[str]
|
One or more Schoenflies group names, e.g. |
required |
path
|
str | None
|
Destination file path. If None, an automatic name is generated
from the group names, e.g. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The path of the written file. |
Source code in pyrrhotite/character_tables/html_formatter.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
format_latex
format_latex(names: list[str]) -> str
Return LaTeX code for one or more named point group character tables.
The returned string contains bare table environments suitable for pasting
into a LaTeX document that loads the booktabs and amsmath packages.
For a standalone compilable document use :func:save_latex.
Source code in pyrrhotite/character_tables/latex_formatter.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | |
save_latex
save_latex(
names: list[str], path: str | None = None
) -> Path
Save a standalone LaTeX document with the requested character tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
list[str]
|
One or more Schoenflies group names, e.g. |
required |
path
|
str | None
|
Destination file path. If None, an automatic name is generated
from the group names, e.g. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The path of the written file. |
Source code in pyrrhotite/character_tables/latex_formatter.py
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | |
Point groups & basis functions
PointGroup
PointGroup(
label: PointGroupLabel,
order: int,
num_inversions: int,
num_proper_rotations: dict[int, int],
num_improper_rotations: dict[int, int],
num_reflections: int,
unique_operations: list[OperationLabelCount],
irreps: list[IrrepLabel],
characters: list[list[float]],
)
A crystallographic point group with its symmetry operations, irreps, and character table.
Construct a PointGroup with full symmetry data.
For rotation counts, degenerate rotations around the same axis (e.g. C3 and C3^2) are counted once — degree is the key in num_proper/improper_rotations.
Source code in pyrrhotite/point_groups/point_group.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
label
property
label: PointGroupLabel
Return the point-group label.
order
property
order: int
Return the total number of unique symmetry operations.
num_proper_rotations
property
num_proper_rotations: dict[int, int]
Return the per-degree count of proper-rotation axes this group requires.
The key is the rotation degree (e.g. 3 for a C3 axis); degree 0 denotes the infinite-order axis C∞ of the linear groups. Used by the matcher to check whether a candidate group can account for the highest-order axis actually detected on a molecule.
num_improper_rotations
property
num_improper_rotations: dict[int, int]
Return the per-degree count of improper-rotation (Sâ‚™) axes this group requires.
The key is the improper-rotation degree (e.g. 16 for an S16 axis); degree 0 denotes the infinite-order S∞ of the linear groups. Used by the matcher to check whether a candidate group can host the highest-order improper axis actually detected on a molecule.
unique_operations
property
unique_operations: list[OperationLabelCount]
Return the list of unique operation labels with counts.
irreps
property
irreps: list[IrrepLabel]
Return the irreducible representations of this point group.
characters
property
characters: list[list[float]]
Return the character table indexed as [irrep][operation class].
compare_to_symmetry_operations
compare_to_symmetry_operations(
operations: list[Operation],
) -> int
Compare this point group against a list of found symmetry operations.
Returns -1 if any required operation type is absent, or a non-negative integer counting how many found operations are not required by this group (the surplus). The caller selects the group with the smallest surplus.
Source code in pyrrhotite/point_groups/point_group.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
print_character_table
print_character_table(
*, complex: bool = False, plain: bool = False
) -> None
Print the character table to stdout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
complex
|
bool
|
When True, split each real 2D E-type irrep into two complex 1D rows showing ε^(jk) and ε^*(jk) characters (only for pure cyclic / Sn groups where this is meaningful; other groups fall back to real rows). |
False
|
plain
|
bool
|
When True, use the plain-text formatter regardless of whether |
False
|
Source code in pyrrhotite/point_groups/point_group.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
compute_basis_functions
compute_basis_functions(
pg: PointGroup,
) -> dict[str, dict[str, list[str]]]
Return basis function assignments for all irreps of pg.
Returns:
| Type | Description |
|---|---|
dict irrep_name → {"linear": [...], "quadratic": [...]}
|
|
Source code in pyrrhotite/point_groups/basis_functions.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | |
Element data
get_element
module-attribute
get_element = element
get_atomic_number
module-attribute
get_atomic_number = atomic_number
Element
dataclass
Element(
symbol: str,
name: str,
radius: float,
mass: float,
colour: tuple[float, float, float],
)
Represents a chemical element with display and physical properties.
Fields
symbol : str Standard chemical symbol, e.g. "C" for carbon. name : str Full element name, e.g. "carbon". radius : float Covalent radius in Ångströms (1 Å = 1e-10 m). Used to decide whether two atoms are close enough to be considered bonded — see Structure.calculate_bond_pairs(). Hydrogen is unusually small (0.25 Å); most main-group elements sit near 0.4–0.8 Å; metals are ~1.2 Å. mass : float Atomic mass in unified atomic mass units (u ≈ 1.66054e-27 kg). Used to compute the centre of mass when centring the molecule. colour : tuple[float, float, float] RGB display colour in the range [0, 1]. Follows the CPK colouring convention (white for H, grey for C, red for O, blue for N, etc.).
Display helpers
Convenience pretty-printers for exploring results in a shell or notebook. They
take objects already produced by Structure, Symmetry, or PointGroup and
print them in a readable form — everything they show is also reachable directly
from those objects' attributes. They live under the pyrrhotite.display
namespace.
print_bond_pairs
print_bond_pairs(s: Structure) -> None
Print every bonded atom pair with element symbols and atom indices.
Source code in pyrrhotite/display.py
35 36 37 38 39 40 | |
print_ops_with_atoms
print_ops_with_atoms(
ops: list[Operation], s: Structure
) -> None
Print each symmetry operation and the atoms that lie on its axis or plane.
Source code in pyrrhotite/display.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
print_basis_functions
print_basis_functions(pg: PointGroup) -> None
Print the irrep → linear/rotational and quadratic basis function table.
Source code in pyrrhotite/display.py
59 60 61 62 63 64 65 66 67 | |
print_char_table_programmatic
print_char_table_programmatic(pg: PointGroup) -> None
Print the character table by directly accessing pg.irreps, pg.characters, and pg.unique_operations.
Source code in pyrrhotite/display.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
Sample molecules
list_sample_molecules
list_sample_molecules() -> list[str]
Return a sorted list of names of the built-in sample molecules.
Each name corresponds to the stem of an XYZ file in the bundled
pyrrhotite/sample_molecules/ directory and can
be passed directly to :func:load_sample, :func:analyse_sample,
:func:visualize_sample, or :func:show_character_table_sample.
Source code in pyrrhotite/display.py
114 115 116 117 118 119 120 121 122 | |
load_sample
load_sample(name: str | None = None) -> Structure
Load a sample molecule as a :class:~src.Structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Stem of the XYZ file (e.g. |
None
|
Source code in pyrrhotite/display.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
analyse_sample
analyse_sample(name: str | None = None) -> 'Symmetry'
Run the full symmetry-determination pipeline on a sample molecule and print the result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Stem of the XYZ file (e.g. |
None
|
Returns:
| Type | Description |
|---|---|
Symmetry
|
The completed :class: |
Source code in pyrrhotite/display.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
show_character_table_sample
show_character_table_sample(
name: str | None = None,
) -> None
Print the character table for the point group of a sample molecule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Stem of the XYZ file (e.g. |
None
|
Source code in pyrrhotite/display.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
Visualization
Requires the vis extras
These open an interactive window and need pip install 'pyrrhotite[vis]'.
See Getting Started → Optional extras.
visualize
visualize(
structure: Structure, show_labels: bool = False
) -> None
Open an interactive 3-D viewer for structure (requires pip install 'pyrrhotite[vis]').
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
show_labels
|
bool
|
Overlay element symbols on each atom. Default is |
False
|
Source code in pyrrhotite/__init__.py
19 20 21 22 23 24 25 26 27 28 | |
visualize_idealized_structure
visualize_idealized_structure(
point_group,
radius: float = 1.0,
height: float = 0.6,
element: str = "F",
show_labels: bool = False,
) -> None
Generate an idealized structure for point_group and open the 3-D viewer.
Equivalent to visualize(generate_idealized_structure(point_group, ...)),
without writing the structure to an .xyz file first. Requires
pip install 'pyrrhotite[vis]'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point_group
|
Either a |
required | |
radius
|
float
|
Forwarded to |
1.0
|
height
|
float
|
Forwarded to |
1.0
|
element
|
float
|
Forwarded to |
1.0
|
show_labels
|
bool
|
Overlay element symbols on each atom. Default is |
False
|
Source code in pyrrhotite/__init__.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
visualize_sample
visualize_sample(name: str | None = None) -> None
Open the interactive 3-D viewer for a sample molecule.
Requires the visualizer optional dependency (pip install 'pyrrhotite[vis]').
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Stem of the XYZ file (e.g. |
None
|
Source code in pyrrhotite/display.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
Next steps
-
User Guide
These functions shown in context, with worked explanations and options.
-
Glossary
Definitions for the symmetry and point-group terms used in these signatures.
-
Algorithm & Supported Groups
How detection works under the hood, and the full list of supported groups.