schrodinger.application.mopac.mopac_surfaces module

Python translation of mmshare/apps/mopac/surface.f90 functionality, which was removed from the suite when this was created.

This modules generates 3D data for plotting surfaces using raw wavefunction data contained in the MOPAC output .aux file.

The following quantities are supported:
  1. molecular orbitals

schrodinger.application.mopac.mopac_surfaces.write_vis_file(fname: str, prop: str, comment: str, ncontours: int, icolors: List[int], ivisible: int, nptsxyz: List[int], samples: numpy.ndarray[Any, numpy.dtype[numpy.float64]], contours: List[int], origin: numpy.ndarray[Any, numpy.dtype[numpy.float64]], extent: numpy.ndarray[Any, numpy.dtype[numpy.float64]])

Writes samples to disk as a .vis for Maestro visualization

Parameters
  • fname – filename of .vis file

  • prop – Property name to write to volume data

  • comment – Comment to write to volume data

  • ncontours – Number of contours

  • icolors – Colors of contours

  • ivisible – Visibility flag

  • nptsxyz – the number of points along each dimension (x,y,z)

  • samples – Amplitudes at each point

  • contours – Contour isovalues

  • origin – coordinates of origin

  • extent – distance along each dimension (x,y,z)

Raises

RuntimeError – If the call to mmvol_set_grid_data fails

schrodinger.application.mopac.mopac_surfaces.aos_on_grid(norbs: int, numat: int, nat: List[int], natorb: List[int], coord: numpy.ndarray[Any, numpy.dtype[numpy.float64]], lbf: numpy.ndarray[Any, numpy.dtype[numpy.float64]], pqn: numpy.ndarray[Any, numpy.dtype[numpy.float64]], mqn: numpy.ndarray[Any, numpy.dtype[numpy.float64]], zbf: numpy.ndarray[Any, numpy.dtype[numpy.int64]], bfnorm: numpy.ndarray[Any, numpy.dtype[numpy.float64]], ngblok: int, nblok: int, grid: numpy.ndarray[Any, numpy.dtype[numpy.float64]]) numpy.ndarray[Any, numpy.dtype[numpy.float64]]

This routine calculates the basis function amplitudes (bfampl) on the input grid block.

Parameters
  • norbs – number of atomic orbitals

  • numat – number of real atoms in the system

  • nat – atomic numbers of real atoms

  • natorb – number of aos on each atom

  • coord – Cartesian coordinates (Angstroms)

  • lbf – angular momentum, indexed on bfn and atom

  • pqn – principal quantum number, indexed on bfn and atom

  • mqn – 1 for S, [2-4] for P, [5-9] for D functions

  • zbf – basis fn exponent, indexed on bfn and atom

  • bfnorm – normalization constants for STO basis functions

  • ngblok – Maximum number of grid points in a block

  • nblok – Number of grid points in this block

  • grid – XYZ coordinates of each grid point in the block

Returns bfampl

Basis function amplitudes

schrodinger.application.mopac.mopac_surfaces.volume_range(samples: numpy.ndarray[Any, numpy.dtype[numpy.float64]], nsamples: int) Tuple[int, int, float, float, float, float]

Determine the minimum and maximum positive and negative values of the data (samples) on the grid (volume).

Parameters
  • samples – Amplitudes on each grid point

  • nsamples – Number of samples

Returns ipos

Flags positive surface

Returns ineg

Flags negative surface

Returns posmin

Minimum positive value

Returns posmax

Maximum positive value

Returns negmin

Minimum negative value

Returns negmax

Maximum negative value

schrodinger.application.mopac.mopac_surfaces.get_s_inv12(norbs: int, s: List[float]) numpy.ndarray[Any, numpy.dtype[numpy.float64]]

This routine calculates the inverse square root of the AO overlap matrix for use in renormalizing the MO vectors.

Parameters
  • norbs – number of atomic orbitals

  • s – AO overlap matrix in upper-triangular packed form

Returns sm12

Inverse sqrt of AO overlap matrix

Raises

RuntimeError – If conversion of overlap matrix to upper diagonal form fails, if diagonalization fails, or if a linear dependency in basis set is detected.

schrodinger.application.mopac.mopac_surfaces.plot_mos(jobname: str, num: int, grid_data: numpy.ndarray[Any, numpy.dtype[numpy.float64]], nelecs: int, numat: int, nat: List[int], natorb: List[int], coord: numpy.ndarray[Any, numpy.dtype[numpy.float64]], nclose: int, norbs: int, overlap: List[float], evecs: List[List[float]], eigs: List[float], lbf: numpy.ndarray[Any, numpy.dtype[numpy.int64]], pqn: numpy.ndarray[Any, numpy.dtype[numpy.int64]], mqn: numpy.ndarray[Any, numpy.dtype[numpy.int64]], zbf: numpy.ndarray[Any, numpy.dtype[numpy.float64]], bfnorm: numpy.ndarray[Any, numpy.dtype[numpy.float64]], ngblok: int, ngpts: int, nptsxyz: numpy.ndarray[Any, numpy.dtype[numpy.int64]], origin: numpy.ndarray[Any, numpy.dtype[numpy.float64]], extent: numpy.ndarray[Any, numpy.dtype[numpy.float64]])

Evaluate “num” occupied and unoccupied orbs around the homo/lumo gap for plotting on the input grid and write each one to a .vis file. This routine needs to be modified to handle UHF orbitals.

Parameters
  • jobname – Job name

  • num – number of MOs to plot around HOMO/LUMO gap.

  • grid_data – grid data

  • nelecs – number of electrons in the system

  • numat – number of real atoms in the system

  • nat – atomic numbers of real atoms

  • natorb – number of aos on each atom

  • coord – Cartesian coordinates (Angstroms)

  • nclose – number of doubly-occupied M.O.s

  • norbs – molecular orbitals

  • overlap – AO overlap matrix in upper-triangular packed form

  • evecs – MO coefficients in terms of AOs, [ [MO1], [MO2], [MO3], … ]

  • eigs – Energies of MOs

  • lbf – angular momentum, indexed on bfn and atom

  • pqn – principal quantum number, indexed on bfn and atom

  • mqn – 1 for S, [2-4] for P, [5-9] for D functions

  • zbf – basis fn exponent, indexed on bfn and atom

  • bfnorm – normalization constants for STO basis functions

  • ngblok – grid pts in this block

  • ngpts – total number of grid pts

  • nptsxyz – the number of points along each dimension (x,y,z)

  • origin – coordinates of origin

  • extent – distance along each dimension (x,y,z)

schrodinger.application.mopac.mopac_surfaces.make_3D_grid(gridres: float, gridext: float, natoms: int, nat: List[int], coord: numpy.ndarray[Any, numpy.dtype[numpy.float64]], ngblok: int) Tuple[numpy.ndarray[Any, numpy.dtype[numpy.float64]], int, int, numpy.ndarray[Any, numpy.dtype[numpy.int64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]]]

Generate a rectilinear grid which spans the molecular geometry, plus a bit extra since this grid will be used for the display of orbitals, etc. which extend well beyond the nuclear positions. All distances are in angstroms

Parameters
  • gridres – Grid resolution for plots

  • gridext – Grid size beyond the nuclei

  • natoms – number of atoms, real plus dummy, etc., in the system

  • nat – atom atomic numbers

  • coord – atom Cartesian coordinates (Angstroms)

  • ngblok – number of points in grid block

Returns grid_data

XYZ coordinates of grid points

Returns ngpts

total number of points in the grid

Returns ngblocks

number of grid blocks, each of which holds ngblok points or less

Returns nptsxyz

the number of points along each dimension (x,y,z)

Returns origin

coordinates of origin

Returns extent

distance along each dimension (x,y,z)

schrodinger.application.mopac.mopac_surfaces.get_bfnorm() numpy.ndarray[Any, numpy.dtype[numpy.float64]]

Calculate the normalization constants for STO basis functions according to:

N(n,m) = 1 / sqrt(pi*(2n)!) * 2**(n-0.5) * sqrt( (2*m + 1)!! )

where !! indicates a product over only odd numbers.

schrodinger.application.mopac.mopac_surfaces.get_basis(numat: int, norbs: int, nat: List[int], natorb: List[int], zs: List[float], zp: List[float], zd: List[float], pqn0: List[int]) Tuple[numpy.ndarray[Any, numpy.dtype[numpy.int64]], numpy.ndarray[Any, numpy.dtype[numpy.int64]], numpy.ndarray[Any, numpy.dtype[numpy.int64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]]]

Initialize various basis function arrays, all of which are indexed as (bfn, atom) for convenience.

Parameters
  • numat – number of real atoms in the system

  • norbs – number of atomic orbitals

  • nat – atomic numbers of real atoms

  • natorb – number of orbitals on each atom

  • zs – s-function exponents indexed by atom

  • zp – p-function exponents indexed by atom

  • zd – d-function exponents indexed by atom

  • pqn0 – Principal quantum numbers of atoms from MOPAC .aux. Used for error checking

Return lbf

angular momentum, indexed on bfn and atom

Return mqn

related to the magnetic quantum number, but has values of 1 for S, [2,3,4] for P, and [5,6,7,8,9] for D

Return pqn

principal quantum number, indexed on bfn and atom

Return zbf

basis function exponent, indexed on bfn and atom

Raises

RuntimeError – If a basis function greater than D angular momentum is detected or the assembled pqn values differ from those in pqn0

schrodinger.application.mopac.mopac_surfaces.plot_3d_data(jobname: str, num: int, gridres: float, gridext: float, nelecs: int, numat: int, natoms: int, coordT: List[List[float]], nat: List[int], norbs: int, nclose: int, natorb: List[int], overlap: List[float], eigs: List[float], evecs: List[List[float]], zs: List[float], zp: List[float], zd: List[float], pqn0: List[int])

Convert information from mopac .aux file to a .vis file for Maestro visualization

Parameters
  • jobname – Job name

  • num – number of MOs to plot around HOMO/LUMO gap.

  • gridres – Grid resolution for plots

  • gridext – Grid size beyond the nuclei

  • nelecs – number of electrons in the system

  • numat – number of real atoms

  • natoms – number of real plus dummy atoms

  • coordT – cartesian coordinates

  • nat – atomic numbers of real atoms

  • norbs – total number of orbitals

  • nclose – number of doubly-occupied M.O.s

  • natorb – number of aos on each atom

  • overlap – AO overlap matrix in upper-triangular packed form

  • eigs – Energies of MOs

  • evecs – MO coefficients in terms of AOs, [ [MO1], [MO2], [MO3], … ]

  • zs – S basis function exponent

  • zp – P basis function exponents

  • zd – D basis function exponents

  • pqn0 – Principal quantum numbers of atoms from MOPAC .aux