Welcome to exatomic
This notebook demonstrates some basics of working with exatomic.
[1]:
import exatomic
exatomic.__version__
[1]:
'0.3.11'
Getting help in the Jupyter notebook is easy, just put a “?” after a class or function.
Don’t forget to use tab to help with syntax completion
[2]:
exatomic.Universe?
The Universe object contains all of the information about a simulation, nuclear coordinates, orbitals, etc.
Data is stored in pandas DataFrames (see pandas for more information)
[3]:
uni = exatomic.Universe()
uni
[3]:
<exatomic.core.universe.Universe at 0x7f77da0bd630>
Empty universes can be useful…but it is more interesting with data
Note that exatomic uses Hartree atomic units
[4]:
atom = exatomic.Atom.from_dict({'x': [0.0, 0.0], 'y': [0.0, 0.0], 'z': [-0.34, 0.34],
'symbol': ["H", "H"], 'frame': [0, 0]})
uni = exatomic.Universe(atom=atom)
uni.atom
[4]:
frame | symbol | x | y | z | |
---|---|---|---|---|---|
atom | |||||
0 | 0 | H | 0.0 | 0.0 | -0.34 |
1 | 0 | H | 0.0 | 0.0 | 0.34 |
The frame column is how we track state (e.g. time, theory, etc.)
The simplest dataframe is the frame object which by default only contains the number of atoms
[5]:
uni.frame # This was computed on-the-fly as we didn't instantiate it above
[5]:
atom_count | |
---|---|
frame | |
0 | 2 |
Visualization of this simple universe can be accomplished directly in the notebook
[6]:
exatomic.UniverseWidget(uni)
In building the visualization, bonds were automatically computed
For small systems this is the default behavior, but for large systems it is not
[7]:
uni.atom_two
[7]:
atom0 | atom1 | dr | bond | |
---|---|---|---|---|
two | ||||
0 | 0 | 1 | 0.68 | True |
Note again that distances are in atomic units
[8]:
uni.molecule
[8]:
H | mass | |
---|---|---|
molecule | ||
0 | 2 | 2.015882 |
Center of masses can also be computed
[9]:
uni.compute_molecule_com()
[10]:
uni.molecule
[10]:
H | mass | cx | cy | cz | |
---|---|---|---|---|---|
molecule | |||||
0 | 2 | 2.015882 | 0.0 | 0.0 | 0.0 |
[ ]:
[ ]: