This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize
for the AI-speak, we are working on rewriting it!
The program’s map: every function and which calls which.
There’s no recorded run of this program yet.
Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.
[1]lines 1–15
# Read a molecule written as XYZ text into atoms: symbol, atomic number,# position (the parser is lib/xyz.viv).from xyz import parse_xyz
text ="3\nwater\nO 0.000000 0.000000 0.117300\nH 0.000000 0.757200 -0.469200\nH 0.000000 -0.757200 -0.469200\n"
m =parse_xyz(text)
for i, sym inenumerate(m.symbols) {
print(f"{sym:<2} Z = {m.z[i]:2d} {m.xyz[i, 0]:9.6f} {m.xyz[i, 1]:9.6f} {m.xyz[i, 2]:9.6f}")
}
# the O-H distance, in angstroms
d = m.xyz[1, 0:3] - m.xyz[0, 0:3]
print("r(OH) =", fmt(sqrt(sum(d * d)), ".4f"), "A")
# SPDX-License-Identifier: MIT OR Apache-2.0# SPDX-FileCopyrightText: 2026 The Viv authors