Notebook 2 Functions

Below are the functions used for the geometry optimization, visualization, and electronic structure calculation of PAH molecules featured in Notebook 2.

NB2_functions.FF_optimization(molecule_num)

Performs a MMFF94 optimization of a PAH and displays 3D rendering of result.

NB2_functions.run_calculation(xyz_struc[, basis])

Performs a HF/STO-3G single-point calculation on a PAH structure.

NB2_functions.get_HL_gap(mf)

Finds HOMO-LUMO gap of molecule from HF/STO-3G calculation result.

NB2_functions.elec_properties(b)

Prints dipole moment, HL gap, and Mulliken charges from HF calculation result.

NB2_functions.mo_diagram(mf, show_diagram, ...)

Displays MO energy level diagram and dataframe.

NB2_functions.draw_orbital(label[, ...])

Renders isosurface of selected orbital from HF/STO-3G calculation.

NB2_functions.FF_optimization(molecule_num: int)

Performs a MMFF94 optimization of a PAH and displays 3D rendering of result.

Parameters:

molecule_num (int) – Number corresponding to a PAH from the menu.

PAH Options:

Table Index

PAH

Rings

Dimensions (Bohr)

pi electrons

Fuse-type

1

benzene

1

8 x 8 x 3

6

linear

2

naphthalene

2

12 x 8 x 3

10

linear

3

anthracene

3

16 x 8 x 3

14

linear

4

tetracene

4

20 x 8 x 3

18

linear

5

pentacene

5

24 x 8 x 3

22

linear

6

hexacene

6

28 x 8 x 3

26

linear

7

heptacene

7

32 x 8 x 3

30

linear

8

pyrene

4

16 x 12 x 3

16

non-linear

9

perylene

5

20 x 12 x 3

20

non-linear

10

coronene

7

20 x 16 x 3

24

non-linear

Example:

>>> # Perform a geometry optimization of heptacene
>>> FF_optimization(7)
_images/heptacene.png
NB2_functions.run_calculation(xyz_struc, basis='STO-3G')

Performs a HF/STO-3G single-point calculation on a PAH structure. Energy results are displayed in a Markdown table.

Parameters:

Heptacene Example:

_images/heptacene_scf.png
NB2_functions.get_HL_gap(mf)

Finds HOMO-LUMO gap of molecule from HF/STO-3G calculation result.

Parameters:

mf (pyscf.scf.RHF) – pyscf HF calculation object

Returns:

Float representing HL gap in electron-volts.

NB2_functions.elec_properties(b)

Prints dipole moment, HL gap, and Mulliken charges from HF calculation result.

Parameters:

b – Button click

NB2_functions.mo_diagram(mf, show_diagram, show_table, savefig, filename)

Displays MO energy level diagram and dataframe.

Parameters:
  • mf (pyscf.scf.RHF) – pyscf HF calculation object.

  • show_diagram (bool) – Display matplotlib energy diagram.

  • show_table (bool) – Display same data as Pandas dataframe.

  • savefig (bool) – Save figure as .png file.

  • filename (str) – filename to save .png file to (w/o file extension).

Example:

_images/heptacene_diagram.png
NB2_functions.get_orbital(i, label)

Saves a .cube file of orbital and prob. density from the above calculation.

Parameters:
  • i (int) – index to iterate over in for loop

  • label (str) – MO label, i.e. HOMO, HOMO-1, etc

NB2_functions.draw_orbital(label, psi_square=False, show_noninteractive_png=False)

Renders isosurface of selected orbital from HF/STO-3G calculation.

Parameters:
  • label (str) – orbital designation, e.g. HOMO, HOMO-1, etc

  • psi_square (bool) – show orbital (False) or probability density (True)

  • show_noninteractive_png (bool) – render a static image (True) or interactive 3D display (False)

Example:

>>> # Display probability density of HOMO-3 orbital of heptacene (calculated in a previous cell)
>>> draw_orbital('HOMO-3', psi_square=True, show_noninteractive_png=False)
_images/heptacene_HOMO3.png