Пример #1
0
def success_list(prog):
    """ Constructs a list of successes that be identified from the output file.

        :param prog: the electronic structure program to use as a backend
        :type prog: str
    """
    return pm.call_module_function(prog, pm.Job.SUCCESS_LST)
Пример #2
0
def vpt2(prog, output_str):
    """ Reads VPT2 information from the output string.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.VPT2,
        # *args
        output_str)
Пример #3
0
def program_version(prog, output_str):
    """ Reads the version of the electronic structure code from the output file.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.PROG_VERS,
        # *args
        output_str)
Пример #4
0
def irc_path(prog, output_str):
    """ read irc_path from the output string

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.IRC_PATH,
        # *args
        output_str)
Пример #5
0
def has_normal_exit_message(prog, output_str):
    """ Assess whether the output file string contains the
        normal program exit message.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.EXIT_MSG,
        # *args
        output_str)
Пример #6
0
def polarizability(prog, output_str):
    """ Reads the polarizability tensor from the output string.
        Returns the dipole moment in _.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.POLAR,
        # *args
        output_str)
Пример #7
0
def normal_coordinates(prog, output_str):
    """ Reads the displacement along the normal modes from the output string.
        Returns the coordinates in Bohr.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.NORM_COORDS,
        # *args
        output_str)
Пример #8
0
def opt_zmatrix(prog, output_str):
    """ Reads the optimized Z-Matrix from the output string.
        Returns the geometry in Bohr+Radians.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.OPT_ZMA,
        # *args
        output_str)
Пример #9
0
def _opt_geometry(prog, output_str):
    """ Reads the optimized geometry from the output string.
        Returns the geometry in Bohr.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.OPT_GEO,
        # *args
        output_str)
Пример #10
0
def irc_points(prog, output_str):
    """ Reads the geometries, gradients, and Hessians at each point along the
        Intrinsic Reaction Coordinate from the output string.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.IRC_PTS,
        # *args
        output_str)
Пример #11
0
def dipole_moment(prog, output_str):
    """ Reads the static dipole moment from the output string.
        Returns the dipole moment in Debye.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.DIP_MOM,
        # *args
        output_str)
Пример #12
0
def has_error_message(prog, error, output_str):
    """ Assess whether the output file string contains error messages
        for any of the procedures in the job.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param error: a key indicating the type of error message
        :type error: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.ERR_MSG,
        # *args
        error,
        output_str)
Пример #13
0
def harmonic_frequencies(prog, output_str):
    """ Reads the harmonic vibrational frequencies from the output string.
        Returns the frequencies in cm-1.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """

    harm_freqs = pm.call_module_function(
        prog,
        pm.Job.HARM_FREQS,
        # *args
        output_str)

    if harm_freqs is not None:
        assert all(isinstance(val, float) for val in harm_freqs)
        assert numpy.shape(harm_freqs)[1] == 3
Пример #14
0
def hessian(prog, output_str):
    """ Reads the Hessian from the output string.
        Returns the Hessian in atomic units.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """

    hess = pm.call_module_function(
        prog,
        pm.Job.HESSIAN,
        # *args
        output_str)

    if hess is not None:
        assert numpy.allclose(hess, numpy.transpose(hess))

    return hess
Пример #15
0
def check_convergence_messages(prog, error, success, output_str):
    """ Assess whether the output file string contains messages
        denoting all of the requested procedures in the job have converged.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param error: a key indicating the type of error message
        :type error: str
        :param success: a key indicating the type of success message
        :type success: str
        :param output_str: string of the program's output file
        :type output_str: str
    """
    return pm.call_module_function(
        prog,
        pm.Job.CONV_MSG,
        # *args
        error,
        success,
        output_str)
Пример #16
0
def gradient(prog, output_str):
    """ Reads the gradient from the output string.
        Returns the gradient in atomic units.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param output_str: string of the program's output file
        :type output_str: str
    """

    grad = pm.call_module_function(
        prog,
        pm.Job.GRADIENT,
        # *args
        output_str)

    # if grad is not None:
    #     assert all(isinstance(val, float) for val in grad)
    #     assert numpy.shape(grad)[1] == 3

    return grad
Пример #17
0
def energy(prog, method, output_str):
    """ Reads the electronic energy from the output string.
        Returns the energy in Hartrees.

        :param prog: electronic structure program to use as a backend
        :type prog: str
        :param method: electronic structure method
        :type method: str
        :param output_str: string of the program's output file
        :type output_str: str
    """

    ene = pm.call_module_function(
        prog,
        pm.Job.ENERGY,
        # *args
        method,
        output_str)
    if ene is not None:
        assert isinstance(ene, float)

    return ene