Base classes for ebcc.ham.

ebcc.ham.base.BaseHamiltonian(**kwargs)

Bases: Namespace[Any], ABC

Base class for Hamiltonians.

Initialise the namespace.

Source code in ebcc/util/misc.py
def __init__(self, **kwargs: T):
    """Initialise the namespace."""
    self.__dict__["_members"] = {}
    for key, val in kwargs.items():
        self.__dict__["_members"][key] = val

ebcc.ham.base.BaseHamiltonian.__getitem__(key) abstractmethod

Just-in-time getter.

Parameters:
  • key (str) –

    Key to get.

Returns:
  • Any

    Slice of the Hamiltonian.

Source code in ebcc/ham/base.py
@abstractmethod
def __getitem__(self, key: str) -> Any:
    """Just-in-time getter.

    Args:
        key: Key to get.

    Returns:
        Slice of the Hamiltonian.
    """
    pass

ebcc.ham.base.BaseRHamiltonian(**kwargs)

Bases: BaseHamiltonian

Base class for restricted Hamiltonians.

Initialise the namespace.

Source code in ebcc/util/misc.py
def __init__(self, **kwargs: T):
    """Initialise the namespace."""
    self.__dict__["_members"] = {}
    for key, val in kwargs.items():
        self.__dict__["_members"][key] = val

ebcc.ham.base.BaseUHamiltonian(**kwargs)

Bases: BaseHamiltonian

Base class for unrestricted Hamiltonians.

Initialise the namespace.

Source code in ebcc/util/misc.py
def __init__(self, **kwargs: T):
    """Initialise the namespace."""
    self.__dict__["_members"] = {}
    for key, val in kwargs.items():
        self.__dict__["_members"][key] = val

ebcc.ham.base.BaseGHamiltonian(**kwargs)

Bases: BaseHamiltonian

Base class for general Hamiltonians.

Initialise the namespace.

Source code in ebcc/util/misc.py
def __init__(self, **kwargs: T):
    """Initialise the namespace."""
    self.__dict__["_members"] = {}
    for key, val in kwargs.items():
        self.__dict__["_members"][key] = val

ebcc.ham.base.BaseFock(cc, array=None, space=None, mo_coeff=None, g=None)

Bases: BaseHamiltonian

Base class for Fock matrices.

Initialise the Fock matrix.

Parameters:
  • cc (BaseEBCC) –

    Coupled cluster object.

  • array (Optional[Any], default: None ) –

    Fock matrix in the MO basis.

  • space (Optional[tuple[Any, ...]], default: None ) –

    Space object for each index.

  • mo_coeff (Optional[tuple[Any, ...]], default: None ) –

    Molecular orbital coefficients for each index.

  • g (Optional[Namespace[Any]], default: None ) –

    Namespace containing blocks of the electron-boson coupling matrix.

Source code in ebcc/ham/base.py
def __init__(
    self,
    cc: BaseEBCC,
    array: Optional[Any] = None,
    space: Optional[tuple[Any, ...]] = None,
    mo_coeff: Optional[tuple[Any, ...]] = None,
    g: Optional[Namespace[Any]] = None,
) -> None:
    """Initialise the Fock matrix.

    Args:
        cc: Coupled cluster object.
        array: Fock matrix in the MO basis.
        space: Space object for each index.
        mo_coeff: Molecular orbital coefficients for each index.
        g: Namespace containing blocks of the electron-boson coupling matrix.
    """
    Namespace.__init__(self)

    # Parameters:
    self.__dict__["cc"] = cc
    self.__dict__["space"] = space if space is not None else (cc.space,) * 2
    self.__dict__["mo_coeff"] = mo_coeff if mo_coeff is not None else (cc.mo_coeff,) * 2
    self.__dict__["array"] = array if array is not None else self._get_fock()
    self.__dict__["g"] = g if g is not None else cc.g

    # Boson parameters:
    self.__dict__["shift"] = cc.options.shift if g is not None else None
    self.__dict__["xi"] = cc.xi if g is not None else None

ebcc.ham.base.BaseERIs(cc, array=None, space=None, mo_coeff=None)

Bases: BaseHamiltonian

Base class for electronic repulsion integrals.

Initialise the ERIs.

Parameters:
  • cc (BaseEBCC) –

    Coupled cluster object.

  • array (Optional[Any], default: None ) –

    ERIs in the MO basis.

  • space (Optional[tuple[Any, ...]], default: None ) –

    Space object for each index.

  • mo_coeff (Optional[tuple[Any, ...]], default: None ) –

    Molecular orbital coefficients for each index.

Source code in ebcc/ham/base.py
def __init__(
    self,
    cc: BaseEBCC,
    array: Optional[Any] = None,
    space: Optional[tuple[Any, ...]] = None,
    mo_coeff: Optional[tuple[Any, ...]] = None,
) -> None:
    """Initialise the ERIs.

    Args:
        cc: Coupled cluster object.
        array: ERIs in the MO basis.
        space: Space object for each index.
        mo_coeff: Molecular orbital coefficients for each index.
    """
    Namespace.__init__(self)

    # Parameters:
    self.__dict__["cc"] = cc
    self.__dict__["space"] = space if space is not None else (cc.space,) * 4
    self.__dict__["mo_coeff"] = mo_coeff if mo_coeff is not None else (cc.mo_coeff,) * 4
    self.__dict__["array"] = array if array is not None else None

ebcc.ham.base.BaseElectronBoson(cc, array=None, space=None)

Bases: BaseHamiltonian

Base class for electron-boson coupling matrices.

Initialise the electron-boson coupling matrix.

Parameters:
  • cc (BaseEBCC) –

    Coupled cluster object.

  • array (Optional[Any], default: None ) –

    Electron-boson coupling matrix in the MO basis.

  • space (Optional[tuple[Any, ...]], default: None ) –

    Space object for each index.

Source code in ebcc/ham/base.py
def __init__(
    self,
    cc: BaseEBCC,
    array: Optional[Any] = None,
    space: Optional[tuple[Any, ...]] = None,
) -> None:
    """Initialise the electron-boson coupling matrix.

    Args:
        cc: Coupled cluster object.
        array: Electron-boson coupling matrix in the MO basis.
        space: Space object for each index.
    """
    Namespace.__init__(self)

    # Parameters:
    self.__dict__["cc"] = cc
    self.__dict__["space"] = space if space is not None else (cc.space,) * 2
    self.__dict__["array"] = array if array is not None else self._get_g()