Example #1
0
def run_gpu_dfcc(name, **kwargs):
    """Function encoding sequence of PSI module calls for
    a GPU-accelerated DF-CCSD(T) computation.

    >>> energy('df-ccsd(t)')

    """
    lowername = name.lower()
    kwargs = kwargs_lower(kwargs)

    # stash user options
    optstash = OptionsState(
        ['GPU_DFCC','COMPUTE_TRIPLES'],
        ['GPU_DFCC','DFCC'],
        ['GPU_DFCC','NAT_ORBS'],
        ['SCF','DF_INTS_IO'],
        ['SCF','SCF_TYPE'])

    psi4.set_local_option('SCF','DF_INTS_IO', 'SAVE')
    psi4.set_local_option('GPU_DFCC','DFCC', True)

    # throw an exception for open-shells
    if (psi4.get_option('SCF','REFERENCE') != 'RHF' ):
        raise ValidationError("Error: %s requires \"reference rhf\"." % lowername)

    # override symmetry:
    molecule = psi4.get_active_molecule()
    molecule.update_geometry()
    molecule.reset_point_group('c1')
    molecule.fix_orientation(1)
    molecule.update_geometry()

    # triples?
    if (lowername == 'gpu-df-ccsd'):
        psi4.set_local_option('GPU_DFCC','COMPUTE_TRIPLES', False)
    if (lowername == 'gpu-df-ccsd(t)'):
        psi4.set_local_option('GPU_DFCC','COMPUTE_TRIPLES', True)
    #if (lowername == 'fno-df-ccsd'):
    #    psi4.set_local_option('GPU_DFCC','COMPUTE_TRIPLES', False)
    #    psi4.set_local_option('GPU_DFCC','NAT_ORBS', True)
    #if (lowername == 'fno-df-ccsd(t)'):
    #    psi4.set_local_option('GPU_DFCC','COMPUTE_TRIPLES', True)
    #    psi4.set_local_option('GPU_DFCC','NAT_ORBS', True)

    # set scf-type to df unless the user wants something else
    if psi4.has_option_changed('SCF','SCF_TYPE') == False:
       psi4.set_local_option('SCF','SCF_TYPE', 'DF')

    if psi4.get_option('GPU_DFCC','DF_BASIS_CC') == '':
       basis   = psi4.get_global_option('BASIS')
       dfbasis = corresponding_rifit(basis)
       psi4.set_local_option('GPU_DFCC','DF_BASIS_CC',dfbasis)

    scf_helper(name,**kwargs)
    psi4.plugin('gpu_dfcc.so')

    # restore options
    optstash.restore()

    return psi4.get_variable("CURRENT ENERGY")
Example #2
0
def run_vibronic(state1,state2,method1='ccsd',method2='eom-ccsd'):
    """
    Performs the different steps needed to compute the spectrum
    """

    lowermethod1 = method1.lower()
    lowermethod2 = method2.lower()

    # Perform optimizations and save states 
    psi4.set_active_molecule(state1)
    print "Optimizing Ground State..."
    optimize(lowermethod1)
    E1=psi4.get_variable("CURRENT ENERGY")

    psi4.set_active_molecule(state2)
    print "Optimizing Excited State..."
    optimize(lowermethod2)
    E2=psi4.get_variable("CURRENT ENERGY")
    
    # Compute Hessian on first state (for AS model)
    psi4.set_active_molecule(state1)
    frequencies(lowermethod1)
    
    # Select states for vibronic:
    #  active molecule is initial state
    #  secondary molecule is final state
    psi4.set_active_molecule(state1)
    psi4.set_secondary_molecule(state2)
    
    # Compute adiavatic energy
    DE = (E2-E1)
    psi4.set_variable("CURRENT ENERGY",DE)

    # Call the plugin
    psi4.plugin('vibronic.so')
Example #3
0
def run_plugin_fragment(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    plugin_fragment can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('plugin_fragment')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    psi4.plugin('plugin_fragment.so')
Example #4
0
def run_plugin_fragment(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    plugin_fragment can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('plugin_fragment')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    psi4.plugin('plugin_fragment.so')
Example #5
0
def run_v2rdm_casscf(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    v2rdm_casscf can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('v2rdm_casscf')

    """

    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    optstash = p4util.OptionsState(
        ['SCF', 'DF_INTS_IO'])

    psi4.set_local_option('SCF', 'DF_INTS_IO', 'SAVE')

    # Your plugin's psi4 run sequence goes here
    scf_wfn = scf_helper(name, **kwargs)

    # if restarting from a checkpoint file, this file
    # needs to be in scratch with the correct name
    filename = psi4.get_option("V2RDM_CASSCF","RESTART_FROM_CHECKPOINT_FILE")

    # todo PSIF_V2RDM_CHECKPOINT should be definied in psifiles.h
    if ( filename != "" ):
        molname = psi4.wavefunction().molecule().name()
        p4util.copy_file_to_scratch(filename,'psi',molname,269,False)

    returnvalue = psi4.plugin('v2rdm_casscf.so',scf_wfn)

    #psi4.set_variable('CURRENT ENERGY', returnvalue)

    return psi4.get_variable('CURRENT ENERGY')
Example #6
0
def run_plugin_mp2(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    mollerplesset2 can be called via :py:func:`~driver.energy`.

    >>> energy('mollerplesset2')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    psi4.set_local_option('MOLLERPLESSET2', 'PRINT', 1)
    scf_wfn = scf_helper(lowername)

    # Need to semicanonicalize the ROHF orbitals
    if psi4.get_global_option('REFERENCE') == 'ROHF':
        scf_wfn.semicanonicalize()

    # Ensure IWL files have been written when not using DF/CD
    proc_util.check_iwl_file_from_scf_type(psi4.get_option('SCF', 'SCF_TYPE'), scf_wfn)

    #psi4.set_legacy_wavefunction(scf_wfn)
    returnvalue = psi4.plugin('mollerplesset2.so', scf_wfn)

    return returnvalue
Example #7
0
def run_plugin_mp2(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    mollerplesset2 can be called via :py:func:`~driver.energy`.

    >>> energy('mollerplesset2')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    psi4.set_local_option('MOLLERPLESSET2', 'PRINT', 1)
    scf_wfn = scf_helper(lowername)

    # Need to semicanonicalize the ROHF orbitals
    if psi4.get_global_option('REFERENCE') == 'ROHF':
        scf_wfn.semicanonicalize()

    # Ensure IWL files have been written when not using DF/CD
    proc_util.check_iwl_file_from_scf_type(psi4.get_option('SCF', 'SCF_TYPE'),
                                           scf_wfn)

    #psi4.set_legacy_wavefunction(scf_wfn)
    returnvalue = psi4.plugin('mollerplesset2.so', scf_wfn)

    return returnvalue
Example #8
0
def run_paralleldf(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    paralleldf can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('paralleldf')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    #psi4.set_global_option('BASIS', 'sto-3g')
    psi4.set_local_option('MYPLUGIN', 'PRINT', 1)

    # Compute a SCF reference, a wavefunction is return which holds the molecule used, orbitals
    # Fock matrices, and more
    ref_wfn = kwargs.get('ref_wfn', None)
    if ref_wfn is None:
        ref_wfn = driver.scf_helper(name, **kwargs)

    # Call the Psi4 plugin
    # Please note that setting the reference wavefunction in this way is ONLY for plugins
    paralleldf_wfn = psi4.plugin('paralleldf.so', ref_wfn)

    return paralleldf_wfn
Example #9
0
def run_v2rdm_casscf(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    v2rdm_casscf can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('v2rdm_casscf')

    """

    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    optstash = p4util.OptionsState(['SCF', 'DF_INTS_IO'])

    psi4.set_local_option('SCF', 'DF_INTS_IO', 'SAVE')

    # Your plugin's psi4 run sequence goes here
    scf_wfn = scf_helper(name, **kwargs)

    # if restarting from a checkpoint file, this file
    # needs to be in scratch with the correct name
    filename = psi4.get_option("V2RDM_CASSCF", "RESTART_FROM_CHECKPOINT_FILE")

    # todo PSIF_V2RDM_CHECKPOINT should be definied in psifiles.h
    if (filename != ""):
        molname = psi4.wavefunction().molecule().name()
        p4util.copy_file_to_scratch(filename, 'psi', molname, 269, False)

    returnvalue = psi4.plugin('v2rdm_casscf.so', scf_wfn)

    #psi4.set_variable('CURRENT ENERGY', returnvalue)

    return psi4.get_variable('CURRENT ENERGY')
Example #10
0
def run_prop(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    blah can be called via :py:func:`~driver.energy`.

    >>> energy('blah')

    """
    returnvalue = psi4.plugin('/Users/kevinhannon/Programs/PsiPlugins_psi4public/plugin_prop/plugin_prop.so')

    return returnvalue
Example #11
0
def run_cis(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    cis can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('cis')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    psi4.set_local_option('CIS', 'PRINT', 1)
    scf_helper(name, **kwargs)
    returnvalue = psi4.plugin('cis.so')
    psi4.set_variable('CURRENT ENERGY', returnvalue)
Example #12
0
def run_fasnocis(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    OCDFT can be called via :py:func:`~driver.energy`.

    >>> energy('fasnocis')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Run OCDFT
    psi4.set_local_option('CDFT','METHOD','FASNOCIS')
    returnvalue = psi4.plugin('cdft.so')

    return returnvalue
Example #13
0
def run_dpd_unit_test(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    dpd_unit_test can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('dpd_unit_test')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    psi4.set_global_option('BASIS', 'sto-3g')
    psi4.set_local_option('DPD_UNIT_TEST', 'PRINT', 1)
    scf_helper(name, **kwargs)
    returnvalue = psi4.plugin('dpd_unit_test.so')
    psi4.set_variable('CURRENT ENERGY', returnvalue)
Example #14
0
def run_main(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    main can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('main')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    #    psi4.set_global_option('BASIS', 'sto-3g')
    #    psi4.set_local_option('MAIN', 'PRINT', 1)
    scf_helper(name, **kwargs)
    returnvalue = psi4.plugin('main.so')
    psi4.set_variable('CURRENT ENERGY', returnvalue)
Example #15
0
def run_plugin_mp2(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    mollerplesset2 can be called via :py:func:`~driver.energy`.

    >>> energy('mollerplesset2')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    psi4.set_local_option('MOLLERPLESSET2', 'PRINT', 1)
    psi4.scf()
    returnvalue = psi4.plugin('mollerplesset2.so')

    return returnvalue
Example #16
0
def run_myplugin1(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    myplugin1 can be called via :py:func:`~driver.energy`.

    >>> energy('myplugin1')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    psi4.set_global_option('BASIS', 'sto-3g')
    psi4.set_local_option('MYPLUGIN1', 'PRINT', 1)
    energy('scf', **kwargs)
    returnvalue = psi4.plugin('myplugin1.so')

    return returnvalue
Example #17
0
def run_dfdcft(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    dfdcft can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('dfdcft')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

#    psi4.set_local_option('SCF', 'REFERENCE', 'UHF')
#    psi4.set_local_option('DFDCFT', 'REFERENCE', 'UHF')

    # Your plugin's psi4 run sequence goes here
    scf_helper(name, **kwargs)
    returnvalue = psi4.plugin('dfdcft.so')
    psi4.set_variable('CURRENT ENERGY', returnvalue)
Example #18
0
def run_fvno(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    fvno can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('fvno')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    if ('wfn' in kwargs):
        if (kwargs['wfn'] == 'ccsd'):
            psi4.set_global_option('WFN', 'CCSD')
        elif (kwargs['wfn'] == 'ccsd(t)'):
            psi4.set_global_option('WFN', 'CCSD_T')
    scf_helper(name, **kwargs)
    psi4.transqt2()
    returnvalue = psi4.plugin('fvno.so')
Example #19
0
def run_fvno(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    fvno can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('fvno')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    if ('wfn' in kwargs):
        if (kwargs['wfn'] == 'ccsd'):
            psi4.set_global_option('WFN', 'CCSD')
        elif (kwargs['wfn'] == 'ccsd(t)'):
            psi4.set_global_option('WFN', 'CCSD_T')
    scf_helper(name, **kwargs)
    psi4.transqt2()
    returnvalue = psi4.plugin('fvno.so')
Example #20
0
def run_v2rdm_casscf(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    v2rdm_casscf can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('v2rdm_casscf')

    """

    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    optstash = p4util.OptionsState(
        ['SCF', 'DF_INTS_IO'])

    psi4.set_local_option('SCF', 'DF_INTS_IO', 'SAVE')

    # Your plugin's psi4 run sequence goes here
    ref_wfn = kwargs.get('ref_wfn', None)
    if ref_wfn is None:
        ref_wfn = driver.scf_helper(name, **kwargs)

    # if restarting from a checkpoint file, this file
    # needs to be in scratch with the correct name
    filename = psi4.get_option("V2RDM_CASSCF","RESTART_FROM_CHECKPOINT_FILE")

    # todo PSIF_V2RDM_CHECKPOINT should be definied in psifiles.h
    if ( filename != "" ):
        molname = ref_wfn.molecule().name()
        p4util.copy_file_to_scratch(filename,'psi',molname,269,False)

    # Ensure IWL files have been written when not using DF/CD
    scf_type = psi4.get_option('SCF', 'SCF_TYPE')
    if ( scf_type == 'PK' or scf_type == 'DIRECT' ):
        proc_util.check_iwl_file_from_scf_type(psi4.get_option('SCF', 'SCF_TYPE'), ref_wfn)

    returnvalue = psi4.plugin('v2rdm_casscf.so', ref_wfn)

    #psi4.set_variable('CURRENT ENERGY', returnvalue)

    #return psi4.get_variable('CURRENT ENERGY')
    return returnvalue
Example #21
0
def run_aomp2(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    aomp2 can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('aomp2')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    ref_wfn = kwargs.get('ref_wfn', None)
    if ref_wfn is None:
        ref_wfn = driver.scf_helper(name, **kwargs)

    # Your plugin's psi4 run sequence goes here
    #psi4.set_local_option('AOMP2', 'PRINT', 1)
    #scf_helper(name, **kwargs)
    returnvalue = psi4.plugin("aomp2.so", ref_wfn)
    #psi4.set_variable('CURRENT ENERGY', returnvalue)

    return returnvalue
Example #22
0
def run_ccambit(name, **kwargs):
    r"""Function encoding sequence of PSI module and plugin calls so that
    ccambit can be called via :py:func:`~driver.energy`. For post-scf plugins.

    >>> energy('ccambit')

    """
    lowername = name.lower()
    kwargs = p4util.kwargs_lower(kwargs)

    # Your plugin's psi4 run sequence goes here
    if ('wfn' in kwargs):
        if (kwargs['wfn'] == 'ccsd'):
            psi4.set_global_option('WFN', 'CCSD')
        elif (kwargs['wfn'] == 'ccsd(t)'):
            psi4.set_global_option('WFN', 'CCSD_T')
    scf_wfn = kwargs.get('ref_wfn', None)
    if scf_wfn is None:
        scf_wfn = driver.scf_helper(name, **kwargs)
    check_iwl_file_from_scf_type(psi4.get_option('SCF', 'SCF_TYPE'), scf_wfn)
    return psi4.plugin('ccambit.so', scf_wfn)
Example #23
0
def localize():
    psi4.plugin('plugin_fragment.so')
    pass
Example #24
0
def spectrum():
    # Simple call to the plugin
    psi4.plugin('vibronic.so')
Example #25
0
def localize():
    psi4.plugin('plugin_fragment.so')
    pass
Example #26
0
def fit():
    psi4.plugin('resp2.so')
Example #27
0
def fit():
    psi4.plugin('resp2.so')