Welcome to exatomic

This notebook demonstrates some basics of working with exatomic.


In [1]:
import exatomic
exatomic.__version__


Out[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

In [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)

In [3]:
uni = exatomic.Universe()
uni


Out[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

In [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


Out[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

In [5]:
uni.frame    # This was computed on-the-fly as we didn't instantiate it above


Out[5]:
atom_count
frame
0 2
  • Visualization of this simple universe can be accomplished directly in the notebook

In [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

In [7]:
uni.atom_two


Out[7]:
atom0 atom1 dr bond
two
0 0 1 0.68 True
  • Note again that distances are in atomic units

In [8]:
uni.molecule


Out[8]:
H mass
molecule
0 2 2.015882
  • Center of masses can also be computed

In [9]:
uni.compute_molecule_com()

In [10]:
uni.molecule


Out[10]:
H mass cx cy cz
molecule
0 2 2.015882 0.0 0.0 0.0

In [ ]:


In [ ]: