Skip to main content

Basic SCF Calculations

Your First Calculation: Water Molecule

Let's start with a simple water molecule. You can either do this in the browser here, or on the command line after installing occ.

Input File Format

By default, occ would use something like a .xyz file, so let's create a file called input.xyz:

Loading editor...
Loading viewer...

Understanding the XYZ format:

  • Line 1: Number of atoms (3 for water)
  • Line 2: Comment line (commonly includes charge, multiplicity, or energy)
  • Lines 3+: Element symbol followed by Cartesian x, y, z coordinates in Angstroms

Try editing the coordinates and clicking "Save to VFS" to see the structure update in the viewer!

Running the Calculation

Now run a basic SCF (Self-Consistent Field) calculation:

Loading...

Command breakdown:

  • occ scf - Run an SCF calculation
  • input.xyz - Input geometry file
  • b3lyp - DFT functional (hybrid functional, good general-purpose choice)
  • def2-svp - Basis set (double-zeta with polarization functions)

Understanding the Output

The calculation will show SCF iterations converging to the final energy:

Loading...
Loading...

Output Files

Loading...

Experimenting with Different Methods

Click the command above to edit it and try different functionals, basis sets, and options:

For molecular systems like this one, something like hybrid DFT functionals would be almost the default. This can change, depending on the property of interest etc. Play around with some example methods here to see what differences it makes in total energy and in timing:

Common Functionals

  • hf - Hartree-Fock (or the uhf and ghf variants)
  • pbe - Pure GGA functional
  • b3lyp - Popular hybrid DFT
  • wb97x - Range-separated hybrid GGA

Basis Sets

Generally we'd use the largest basis set we can afford (with some caveats). Most SCF calculations scale faster than linear (O(N2)O(N^2), O(N4)O(N^4) for example) with number of basis functions, so naturally there's a limit to what is computationally tractable. Play around with some examples:

  • 3-21g - Small, split valence basis (very fast, almost certainly not big enough for most properties of interest)
  • def2-svp - Double-zeta with polarization (good default)
  • cc-pvtz - Triple-zeta with polarization (production quality)

Common Options

Charged/open-shell systems:

--charge 1 --multiplicity 2          # Cation with one unpaired electron
--charge '-1' --multiplicity 2 # Anion, one unpaired electron
--unrestricted # Unrestricted calculation (open-shell)

Next Steps

Now that you can run basic calculations, learn how to:

  • Visualize the electronic structure (wavefunctions, densities, orbitals)
  • Optimize molecular geometries
  • Calculate molecular properties

Continue to the next tutorial: Wavefunction Analysis & Visualization