Skip to content

Operator

Λ(f, x, κ, μ, S=TYPE_DOMAIN, ny=INTEGRAL_NUM)

Compute the operator $$ Λ_κ[f](x) = ∫_{y ∈ S} κ(y, x) f(y) \mathrm{d}μ(y) $$ for each \(x ∈ S\) in the input array.

Parameters:

Name Type Description Default
f Function

A function that takes an array of vertices and returns an array of values.

required
x VertexType

An array of vertices at which to evaluate the operator.

required
κ Kernel

A kernel function that takes two arrays of vertices and returns an array of values.

required
μ TypeMeasure

A measure function that takes an array of vertices and returns an array of measure values.

required
S TypeDomain

A tuple defining the domain of integration (default is (0.0, 1.0)).

TYPE_DOMAIN
ny IntegralNum

The number of points to use for numerical integration (default is 1000).

INTEGRAL_NUM

Returns:

Type Description
Array

An array of values representing \(Λ_κ[f](x)\) for each \(x\) in the input array.

Source code in src/bprg/operator.py
def Λ(
    f: Function,
    x: VertexType,
    κ: Kernel,
    μ: TypeMeasure,
    S: TypeDomain = TYPE_DOMAIN,
    ny: IntegralNum = INTEGRAL_NUM,
) -> Array:
    r"""
    Compute the operator
    $$
    Λ_κ\[f\](x) = ∫_{y ∈ S} κ(y, x) f(y) \mathrm{d}μ(y)
    $$
    for each $x ∈ S$ in the input array.

    Args:
        f: A function that takes an array of vertices and returns an array of values.
        x: An array of vertices at which to evaluate the operator.
        κ: A kernel function that takes two arrays of vertices and returns an array of values.
        μ: A measure function that takes an array of vertices and returns an array of measure values.
        S: A tuple defining the domain of integration (default is (0.0, 1.0)).
        ny: The number of points to use for numerical integration (default is 1000).

    Returns:
        An array of values representing $Λ_κ[f](x)$ for each $x$ in the input array.
    """
    return _Λ_jit(f, x, κ, μ, S, ny)

Πk(f, x, k, κ, μ, S=TYPE_DOMAIN, ny=INTEGRAL_NUM)

Compute the operator $$ Π_κ^k[f](x) = \frac{(Λ_κ[f](x))^k}{k!} e^{-Λ_κ[f](x)} $$ for each \(x\) in the input array.

Parameters:

Name Type Description Default
f Function

A function that takes an array of vertices and returns an array of values.

required
x VertexType

An array of vertices at which to evaluate the operator.

required
k int

The threshold of vertices.

required
κ Kernel

A kernel function that takes two arrays of vertices and returns an array of values.

required
μ TypeMeasure

A measure function that takes an array of vertices and returns an array of measure values.

required
S TypeDomain

A tuple defining the domain of integration (default is (0.0, 1.0)).

TYPE_DOMAIN
ny IntegralNum

The number of points to use for numerical integration (default is 1000).

INTEGRAL_NUM

Returns:

Type Description
Array

An array of values representing \(Π_κ^k[f](x)\) for each \(x\) in the input array.

Source code in src/bprg/operator.py
def Πk(
    f: Function,
    x: VertexType,
    k: int,
    κ: Kernel,
    μ: TypeMeasure,
    S: TypeDomain = TYPE_DOMAIN,
    ny: IntegralNum = INTEGRAL_NUM,
) -> Array:
    r"""
    Compute the operator
    $$
    Π_κ^k\[f\](x) = \frac{(Λ_κ\[f\](x))^k}{k!} e^{-Λ_κ\[f\](x)}
    $$
    for each $x$ in the input array.

    Args:
        f: A function that takes an array of vertices and returns an array of values.
        x: An array of vertices at which to evaluate the operator.
        k: The threshold of vertices.
        κ: A kernel function that takes two arrays of vertices and returns an array of values.
        μ: A measure function that takes an array of vertices and returns an array of measure values.
        S: A tuple defining the domain of integration (default is (0.0, 1.0)).
        ny: The number of points to use for numerical integration (default is 1000).

    Returns:
        An array of values representing $Π_κ^k[f](x)$ for each $x$ in the input array.
    """
    return _Πk_jit(f, x, k, κ, μ, S, ny)

Π(f, x, K, κ, μ, S=TYPE_DOMAIN, ny=INTEGRAL_NUM)

Compute the operator \(Π_κ^k[f](x)\) for \(k ∈ \{0, 1, …, K\}\) for each \(x\) in the input array.

Parameters:

Name Type Description Default
f Function

A function that takes an array of vertices and returns an array of values.

required
x VertexType

An array of vertices at which to evaluate the operator.

required
K int

The maximum threshold of vertices.

required
κ Kernel

A kernel function that takes two arrays of vertices and returns an array of values.

required
μ TypeMeasure

A measure function that takes an array of vertices and returns an array of measure values.

required
S TypeDomain

A tuple defining the domain of integration (default is (0.0, 1.0)).

TYPE_DOMAIN
ny IntegralNum

The number of points to use for numerical integration (default is 1000).

INTEGRAL_NUM

Returns:

Type Description
Array

An array of shape (len(x), K+1) representing \(Π_κ^k[f](x)\) for each \(x\) in the input array and for \(k = 0, 1, …, K\).

Source code in src/bprg/operator.py
def Π(
    f: Function,
    x: VertexType,
    K: int,
    κ: Kernel,
    μ: TypeMeasure,
    S: TypeDomain = TYPE_DOMAIN,
    ny: IntegralNum = INTEGRAL_NUM,
) -> Array:
    r"""
    Compute the operator $Π_κ^k[f](x)$ for $k ∈ \{0, 1, …, K\}$ for each $x$ in the input array.

    Args:
        f: A function that takes an array of vertices and returns an array of values.
        x: An array of vertices at which to evaluate the operator.
        K: The maximum threshold of vertices.
        κ: A kernel function that takes two arrays of vertices and returns an array of values.
        μ: A measure function that takes an array of vertices and returns an array of measure values.
        S: A tuple defining the domain of integration (default is (0.0, 1.0)).
        ny: The number of points to use for numerical integration (default is 1000).

    Returns:
        An array of shape (len(x), K+1) representing $Π_κ^k[f](x)$ for each $x$ in the input array and for $k = 0, 1, …, K$.
    """
    return _Π_jit(f, x, K, κ, μ, S, ny)

Ψ(f, x, κ, μ, η, S=TYPE_DOMAIN, ny=INTEGRAL_NUM)

Compute the operator $$ Ψ_κ[f](x) = ∑_{k=0}^{K} η_k(x) \left(1 - ∑_{j=0}^{k-1} Π_κ^j[f](x)\right) $$ for each \(x\) in the input array.

Parameters:

Name Type Description Default
f Function

A function that takes an array of vertices and returns an array of values.

required
x VertexType

An array of vertices at which to evaluate the operator.

required
κ Kernel

A kernel function that takes two arrays of vertices and returns an array of values.

required
μ TypeMeasure

A measure function that takes an array of vertices and returns an array of measure values.

required
η ThresholdMeasure

A threshold measure function that takes an array of vertices and returns an array of threshold values.

required
S TypeDomain

A tuple defining the domain of integration (default is (0.0, 1.0)).

TYPE_DOMAIN
ny IntegralNum

The number of points to use for numerical integration (default is 1000).

INTEGRAL_NUM

Returns:

Type Description
Array

An array of values representing \(Ψ_κ[f](x)\) for each \(x\) in the input array.

Source code in src/bprg/operator.py
def Ψ(
    f: Function,
    x: VertexType,
    κ: Kernel,
    μ: TypeMeasure,
    η: ThresholdMeasure,
    S: TypeDomain = TYPE_DOMAIN,
    ny: IntegralNum = INTEGRAL_NUM,
) -> Array:
    r"""
    Compute the operator
    $$
    Ψ_κ\[f\](x) = ∑_{k=0}^{K} η_k(x) \left(1 - ∑\_{j=0}^{k-1} Π_κ^j\[f\](x)\right)
    $$
    for each $x$ in the input array.

    Args:
        f: A function that takes an array of vertices and returns an array of values.
        x: An array of vertices at which to evaluate the operator.
        κ: A kernel function that takes two arrays of vertices and returns an array of values.
        μ: A measure function that takes an array of vertices and returns an array of measure values.
        η: A threshold measure function that takes an array of vertices and returns an array of threshold values.
        S: A tuple defining the domain of integration (default is (0.0, 1.0)).
        ny: The number of points to use for numerical integration (default is 1000).

    Returns:
        An array of values representing $Ψ_κ[f](x)$ for each $x$ in the input array.
    """
    return _Ψ_jit(f, x, κ, μ, η, S, ny)