Beispiel #1
0
import json
import psi4
import pytest

from addons import *

import qcengine as qcng
from qcengine.testing import using_mp2d

pytestmark = pytest.mark.quick

using_ambit = pytest.mark.skipif(
    psi4.addons("ambit") is False,
    reason="Psi4 not compiled with ambit. Rebuild with -DENABLE_ambit")
using_cfour = pytest.mark.skipif(
    psi4.addons("cfour") is False,
    reason="Psi4 not detecting CFOUR. Add `xcfour` to envvar PSIPATH or PATH")
using_chemps2 = pytest.mark.skipif(
    psi4.addons("chemps2") is False,
    reason="Psi4 not compiled with CheMPS2. Rebuild with -DENABLE_CheMPS2")
using_dkh = pytest.mark.skipif(
    psi4.addons("dkh") is False,
    reason="Psi4 not compiled with dkh. Rebuild with -DENABLE_dkh")
using_libefp = pytest.mark.skipif(
    psi4.addons("libefp") is False,
    reason="Psi4 not compiled with libefp. Rebuild with -DENABLE_libefp")
using_erd = pytest.mark.skipif(
    psi4.addons("erd") is False,
    reason="Psi4 not compiled with erd. Rebuild with -DENABLE_erd")
using_gdma = pytest.mark.skipif(
    psi4.addons("gdma") is False,
Beispiel #2
0
            return False
        else:
            return ngpu > 0


# Figure out what is imported
# * only using psi4.addons for C-linked b/c _programs more responsive to env
# * `which` not taking PSIPATH into account
_programs = {
    # non-QC
    "memory_profiler": which_import('memory_profiler', return_bool=True),
    "networkx": which_import("networkx", return_bool=True),

    # QC
    "adcc": which_import("adcc", return_bool=True),
    "ambit": psi4.addons("ambit"),
    "cct3": which_import("cct3", return_bool=True),
    "chemps2": psi4.addons("chemps2"),
    "cppe": which_import("cppe",
                         return_bool=True),  # package pycppe, import cppe
    "dkh": psi4.addons("dkh"),
    "libefp": which_import("pylibefp", return_bool=True),
    "erd": psi4.addons("erd"),
    "fockci":
    which_import("psi4fockci",
                 return_bool=True),  # package fockci, import psi4fockci
    "forte": which_import("forte", return_bool=True),
    "gdma": psi4.addons("gdma"),
    "gpu_dfcc": which_import("gpu_dfcc", return_bool=True),
    "ipi": which_import("ipi", return_bool=True),
    "mrcc": which("dmrcc", return_bool=True),
Beispiel #3
0
import json
import psi4
import pytest

from addons import *


pytestmark = pytest.mark.quick

using_ambit = pytest.mark.skipif(psi4.addons("ambit") is False,
                                reason="Psi4 not compiled with ambit. Rebuild with -DENABLE_ambit")
using_cfour = pytest.mark.skipif(psi4.addons("cfour") is False,
                                reason="Psi4 not detecting CFOUR. Add `xcfour` to envvar PSIPATH or PATH")
using_chemps2 = pytest.mark.skipif(psi4.addons("chemps2") is False,
                                reason="Psi4 not compiled with CheMPS2. Rebuild with -DENABLE_CheMPS2")
using_dkh = pytest.mark.skipif(psi4.addons("dkh") is False,
                                reason="Psi4 not compiled with dkh. Rebuild with -DENABLE_dkh")
using_libefp = pytest.mark.skipif(psi4.addons("libefp") is False,
                                reason="Psi4 not compiled with libefp. Rebuild with -DENABLE_libefp")
using_erd = pytest.mark.skipif(psi4.addons("erd") is False,
                                reason="Psi4 not compiled with erd. Rebuild with -DENABLE_erd")
using_gdma = pytest.mark.skipif(psi4.addons("gdma") is False,
                                reason="Psi4 not compiled with gdma. Rebuild with -DENABLE_gdma")
using_mrcc = pytest.mark.skipif(psi4.addons("mrcc") is False,
                                reason="Psi4 not detecting MRCC. Add `dmrcc` to envvar PSIPATH or PATH")
using_pcmsolver = pytest.mark.skipif(psi4.addons("pcmsolver") is False,
                                reason="Psi4 not compiled with PCMSolver. Rebuild with -DENABLE_PCMSolver")
using_simint = pytest.mark.skipif(psi4.addons("simint") is False,
                                reason="Psi4 not compiled with simint. Rebuild with -DENABLE_simint")
using_v2rdm_casscf = pytest.mark.skipif(psi4.addons("v2rdm_casscf") is False,
                                reason="Psi4 not detecting plugin v2rdm_casscf. Build plugin if necessary and add to envvar PYTHONPATH")
Beispiel #4
0
import psi4
import pytest


using_ambit = pytest.mark.skipif(psi4.addons("ambit") is False,
                                reason="Psi4 not compiled with ambit. Rebuild with -DENABLE_ambit")
using_cfour = pytest.mark.skipif(psi4.addons("cfour") is False,
                                reason="Psi4 not detecting CFOUR. Add `xcfour` to envvar PSIPATH or PATH")
using_chemps2 = pytest.mark.skipif(psi4.addons("chemps2") is False,
                                reason="Psi4 not compiled with CheMPS2. Rebuild with -DENABLE_CheMPS2")
using_dftd3 = pytest.mark.skipif(psi4.addons("dftd3") is False,
                                reason="Psi4 not detecting DFTD3. Add `dftd3` to envvar PSIPATH or PATH")
using_dkh = pytest.mark.skipif(psi4.addons("dkh") is False,
                                reason="Psi4 not compiled with dkh. Rebuild with -DENABLE_dkh")
using_libefp = pytest.mark.skipif(psi4.addons("libefp") is False,
                                reason="Psi4 not compiled with libefp. Rebuild with -DENABLE_libefp")
using_erd = pytest.mark.skipif(psi4.addons("erd") is False,
                                reason="Psi4 not compiled with erd. Rebuild with -DENABLE_erd")
using_gcp = pytest.mark.skipif(psi4.addons("gcp") is False,
                                reason="Psi4 not detecting GCP. Add `gcp` to envvar PSIPATH or PATH")
using_gdma = pytest.mark.skipif(psi4.addons("gdma") is False,
                                reason="Psi4 not compiled with gdma. Rebuild with -DENABLE_gdma")
using_mrcc = pytest.mark.skipif(psi4.addons("mrcc") is False,
                                reason="Psi4 not detecting MRCC. Add `dmrcc` to envvar PSIPATH or PATH")
using_pcmsolver = pytest.mark.skipif(psi4.addons("pcmsolver") is False,
                                reason="Psi4 not compiled with PCMSolver. Rebuild with -DENABLE_PCMSolver")
using_simint = pytest.mark.skipif(psi4.addons("simint") is False,
                                reason="Psi4 not compiled with simint. Rebuild with -DENABLE_simint")
using_v2rdm_casscf = pytest.mark.skipif(psi4.addons("v2rdm_casscf") is False,
                                reason="Psi4 not detecting plugin v2rdm_casscf. Build plugin if necessary and add to envvar PYTHONPATH")
Beispiel #5
0
def allen_focal_point(func, label, **kwargs):
    r"""Function to call Wes Allen-style Focal
    Point Analysis. JCP 127 014306.  Uses
    :py:func:`~psi4.driver.cbs` to evaluate the following
    expression. SCF employs a three-point extrapolation according
    to :py:func:`~psi4.driver.driver_cbs.scf_xtpl_helgaker_3`. MP2, CCSD, and
    CCSD(T) employ two-point extrapolation performed according to
    :py:func:`~psi4.driver.driver_cbs.corl_xtpl_helgaker_2`.  CCSDT and CCSDT(Q)
    are plain deltas. This wrapper requires :ref:`Kallay's MRCC code <sec:mrcc>`.

    .. math:: E_{total}^{\text{FPA}} = E_{total,\; \text{SCF}}^{\text{cc-pV[Q56]Z}} \; + E_{corl,\; \text{MP2}}^{\text{cc-pV[56]Z}} \; + \delta_{\text{MP2}}^{\text{CCSD}}\big\vert_{\text{cc-pV[56]Z}} \; + \delta_{\text{CCSD}}^{\text{CCSD(T)}}\big\vert_{\text{cc-pV[56]Z}} \; + \delta_{\text{CCSD(T)}}^{\text{CCSDT}}\big\vert_{\text{cc-pVTZ}} \; + \delta_{\text{CCSDT}}^{\text{CCSDT(Q)}}\big\vert_{\text{cc-pVDZ}}

    >>> # [1] single-point energy by this composite method
    >>> energy('allen_focal_point')

    >>> # [2] single-point energy reducing the Hartree-Fock basis sets size
    >>> energy('allen_focal_point', scf_basis='cc-pV[TQ5]Z')

    """

    if not psi4.addons("mrcc"):
        raise ImportError(
            "Install MRCC (executable 'dmrcc') to use the allen_focal_point function."
        )

    scf = {  # HF
        'wfn': 'hf',
        'basis': kwargs.pop('scf_basis', 'cc-pV[Q56]Z'),
        'scheme': kwargs.pop('scf_scheme', 'scf_xtpl_helgaker_3'),
    }
    corl = {  # MP2 - HF
        'wfn': kwargs.pop('corl_wfn', 'mp2'),
        'basis': kwargs.pop('corl_basis', 'cc-pV[56]Z'),
        'scheme': kwargs.pop('corl_scheme', 'corl_xtpl_helgaker_2'),
    }
    delta = {  # CCSD - MP2
        'wfn': kwargs.pop('delta_wfn', 'mrccsd'),
        'wfn_lesser': kwargs.pop('delta_wfn_lesser', 'mp2'),
        'basis': kwargs.pop('delta_basis', 'cc-pV[56]Z'),
        'scheme': kwargs.pop('delta_scheme', 'corl_xtpl_helgaker_2'),
    }
    delta2 = {  # CCSD(T) - CCSD
        'wfn': kwargs.pop('delta2_wfn', 'mrccsd(t)'),
        'wfn_lesser': kwargs.pop('delta2_wfn_lesser', 'mrccsd'),
        'basis': kwargs.pop('delta2_basis', 'cc-pV[56]Z'),
        'scheme': kwargs.pop('delta2_scheme', 'corl_xtpl_helgaker_2'),
    }
    delta3 = {  # CCSDT - CCSD(T)
        'wfn': kwargs.pop('delta3_wfn', 'mrccsdt'),
        'wfn_lesser': kwargs.pop('delta3_wfn_lesser', 'mrccsd(t)'),
        'basis': kwargs.pop('delta3_basis', 'cc-pVTZ'),
        'scheme': kwargs.pop('delta3_scheme', 'xtpl_highest_1'),
    }
    delta4 = {  # CCSDT(Q) - CCSDT
        'wfn': kwargs.pop('delta4_wfn', 'mrccsdt(q)'),
        'wfn_lesser': kwargs.pop('delta4_wfn_lesser', 'mrccsdt'),
        'basis': kwargs.pop('delta4_basis', 'cc-pVDZ'),
        'scheme': kwargs.pop('delta4_scheme', 'xtpl_highest_1'),
    }

    kwargs["cbs_metadata"] = [scf, corl, delta, delta2, delta3, delta4]
    return driver_cbs.cbs(func, label, **kwargs)
Beispiel #6
0
import psi4
import pytest

using_ambit = pytest.mark.skipif(
    psi4.addons("ambit") is False,
    reason="Psi4 not compiled with ambit. Rebuild with -DENABLE_ambit")
using_cfour = pytest.mark.skipif(
    psi4.addons("cfour") is False,
    reason="Psi4 not detecting CFOUR. Add `xcfour` to envvar PSIPATH or PATH")
using_chemps2 = pytest.mark.skipif(
    psi4.addons("chemps2") is False,
    reason="Psi4 not compiled with CheMPS2. Rebuild with -DENABLE_CheMPS2")
using_dftd3 = pytest.mark.skipif(
    psi4.addons("dftd3") is False,
    reason="Psi4 not detecting DFTD3. Add `dftd3` to envvar PSIPATH or PATH")
using_dkh = pytest.mark.skipif(
    psi4.addons("dkh") is False,
    reason="Psi4 not compiled with dkh. Rebuild with -DENABLE_dkh")
using_libefp = pytest.mark.skipif(
    psi4.addons("libefp") is False,
    reason="Psi4 not compiled with libefp. Rebuild with -DENABLE_libefp")
using_erd = pytest.mark.skipif(
    psi4.addons("erd") is False,
    reason="Psi4 not compiled with erd. Rebuild with -DENABLE_erd")
using_gcp = pytest.mark.skipif(
    psi4.addons("gcp") is False,
    reason="Psi4 not detecting GCP. Add `gcp` to envvar PSIPATH or PATH")
using_gdma = pytest.mark.skipif(
    psi4.addons("gdma") is False,
    reason="Psi4 not compiled with gdma. Rebuild with -DENABLE_gdma")
using_mrcc = pytest.mark.skipif(