vibeqc.define_functional

vibeqc.define_functional(name, components, *, hf_exchange_fraction=0.0)[source]

Register a user-defined XC functional alias at runtime.

Once registered, Functional(name) resolves the alias exactly like a built-in functional.

Parameters:
  • name (str) – Name for the functional (case-insensitive). Registering the same dynamic alias again replaces its recipe. An external-functional name cannot be replaced.

  • components (list) – List of (libxc_name, weight) pairs. libxc_name is a libxc functional name such as "GGA_X_PW91"; the weight scales the component’s contribution to the total XC energy.

  • hf_exchange_fraction (float) – Global HF-exchange fraction for hand-mixed hybrids. Set to 0.20 for a PW1PW-style hybrid, 0.0 for pure DFT.

Return type:

None

Examples

Define a PW1PW clone:

>>> vq.define_functional(
...     "my-pw1pw",
...     [("GGA_X_PW91", 0.80), ("GGA_C_PW91", 1.00)],
...     hf_exchange_fraction=0.20,
... )
>>> f = Functional("my-pw1pw")
>>> f.hf_exchange_fraction
0.2

Notes

Thread-safe. Define or replace an alias before any SCF calculation that references it; existing Functional objects keep their original recipe.