5.4. Exercises#

5.4.1. Exercise 1#

We begin with single point calculations in SPARC. Compute gas-phase formation energies for water, carbon dioxide, and ammonia using the common Perdew–Burke-Ernzerhof generalized gradient approximation (GGA) functional. You can get the reference energy for carbon from graphite. Compare your results to those from experimentation. What do you notice?

import os
from ase import Atoms, io
from ase.io import read, write
from ase.build import bulk, molecule, surface, add_adsorbate
from ase.units import Bohr,Hartree,mol,kcal,kJ,eV
from sparc import SPARC

#Code here
import re, json

def readFile(path):
    """
    Code here
    """
    
    return content

def read_energy(path):
    """
    Code here
    """
    
    return energy

def get_E_form(name):
    """
    Code here
    """
    
    return E_form  

#Code here

Repeat the above calculations using the B3LYP hydrid functional. How do these energies compare to those from experimentation and from DFT with the PBE functional? Does the computation time with the B3LYP change? Explain why or why not.

import os
from ase import Atoms, io
from ase.io import read, write
from ase.build import bulk, molecule, surface, add_adsorbate
from ase.units import Bohr,Hartree,mol,kcal,kJ,eV
from sparc import SPARC
  
#Code here

5.4.2. Exercise 2#

Next, we revisit Ca-LTA from the prior ASE exercises. Use DFT with the PBE functional to perform a single point energy calculation for the empty Ca-LTA framework. Report the resulting energy in eV/atom.

import os
from ase import Atoms, io
from ase.io import read, write
from ase.build import bulk, molecule, surface, add_adsorbate
from ase.units import Bohr,Hartree,mol,kcal,kJ,eV
from sparc import SPARC

#Code here

Repeat the above calculation with both spin polarization and a D3 dispersion correction. How does the answer change and why?

#Code here

5.4.3. Exercise 3#

Follow the steps from the previous set of exercises to import Ca-LTA as an Atoms object with periodic boundary conditions. But this time, use LiH5C5N2O5 structure for faster calculation.

from ase import Atoms, io
from ase.io import read, write

atoms = read('LiH5C5N2O5.cif')
atoms.pbc = True

print(len(atoms))

Use an ASE calculator to compute the potential energy (Do single-point calculation, which means that you don’t need to do atomic relaxation) for LiH5C5N2O5 in eV/atom.

from sparc import SPARC
from ase.units import Bohr,Hartree,mol,kcal,kJ,eV

#Code here

Next, manipulate the original Atoms object by adjusting just one of the lattice parameters such that the lattice parameter fluctuates +/- 20%. Create 4 equidistant images (-20% to +20%) and perform single point calculations. Be sure to scale atomic positions when setting the cell parameters. Plot the energy as a function of the cell volume.

#Code here

Fit a cubic equation of state (E = f(V = poly of order 3)) and find the Volume (or lattice constant) that minimizes the energy. Recall that the volume can be calculated by \(\vec{v_1} \cdot (\vec{v_2} \times \vec{v_3})\) Verify that this volume correponds approximately to the original value for the unmanipulated lattice parameter.

#Code here