Visualization of the molecule

Visualization of the molecule#

Once the Penguin method has been initialized with the correct reference state, the geometry of the system can be visualized using the show_molecule function. Note that the py3dmol package must be installed for the visualization to function.

import penguin
import veloxchem as vlx

molecule = penguin.get_molecule("""
C          0.95599        0.06333        0.04681
C          2.29354        0.05656        0.06769
C          3.05556       -0.32788        1.22931
C          4.39328       -0.33355        1.25130
H          0.42046        0.36019       -0.84979
H          0.36291       -0.22212        0.90971
H          2.83844        0.35260       -0.82619
H          2.50976       -0.62488        2.12252
H          4.98609       -0.04656        0.38874
H          4.92835       -0.63028        2.14783"""
)

basis = penguin.get_molecular_basis(molecule, "cc-pVDZ")

scf_drv = vlx.ScfRestrictedDriver()
scf_drv.ostream.mute()

scf_results = scf_drv.compute(molecule, basis)

ref_state = penguin.create_reference_state(molecule, basis, scf_drv)

mp2_drv = penguin.MP2()
mp2_drv.update_settings({
    'reference_state': ref_state,
})

mp2_drv.show_molecule()

3Dmol.js failed to load for some reason. Please check your browser console for error messages.