pygeoinf.checks package

Submodules

pygeoinf.checks.affine_operators module

Provides a self-checking mechanism for AffineOperator implementations.

class pygeoinf.checks.affine_operators.AffineOperatorAxiomChecks[source]

Bases: NonLinearOperatorAxiomChecks

A mixin for checking the mathematical properties of an AffineOperator.

Inherits the finite-difference derivative checks from NonLinearOperatorAxiomChecks and adds specific checks for affine mappings.

check(*, n_checks: int = 5, op2=None, check_rtol: float = 1e-05, check_atol: float = 1e-08, measure: GaussianMeasure = None) None[source]

Runs all checks for the AffineOperator, including base non-linear checks and affine-specific identities.

pygeoinf.checks.hilbert_space module

class pygeoinf.checks.hilbert_space.HilbertSpaceAxiomChecks[source]

Bases: object

A mixin class providing a self-checking mechanism for Hilbert space axioms.

When inherited by a HilbertSpace subclass, it provides the .check() method to run a suite of randomized tests, ensuring the implementation is valid.

check(*, n_checks: int = 10, measure: GaussianMeasure = None) None[source]

Runs a suite of randomized checks to verify the Hilbert space axioms.

This method performs n_checks iterations, generating new random vectors and scalars for each one. It provides an “interactive” way to validate any concrete HilbertSpace implementation.

Parameters:
  • n_checks – The number of randomized trials to run.

  • measure – A GaussianMeasure on the space from which random samples can be generated. Defaults to None, in which case the classes .random() method is used.

Raises:
  • AssertionError – If any of the underlying axiom checks fail.

  • ValueError – If the measure provided is defined on the wrong space.

pygeoinf.checks.linear_operators module

Provides a self-checking mechanism for LinearOperator implementations.

class pygeoinf.checks.linear_operators.LinearOperatorAxiomChecks[source]

Bases: NonLinearOperatorAxiomChecks

A mixin for checking the properties of a LinearOperator.

Inherits the derivative check from NonLinearOperatorAxiomChecks and adds checks for linearity and the adjoint identity.

check(*, n_checks: int = 5, op2=None, check_rtol: float = 1e-05, check_atol: float = 1e-08, domain_measure: GaussianMeasure = None, codomain_measure: GaussianMeasure = None) None[source]

Runs all checks for the LinearOperator, including non-linear checks and algebraic identities.

Parameters:
  • n_checks – The number of randomized trials to perform.

  • op2 – An optional second operator for testing algebraic rules.

  • check_rtol – The relative tolerance for numerical checks.

  • check_atol – The absolute tolerance for numerical checks.

  • measure – A GaussianMeasure on the space from which random samples can be generated. Defaults to None, in which case the classes .random() method is used.

pygeoinf.checks.nonlinear_operators module

Provides a self-checking mechanism for NonLinearOperator implementations.

class pygeoinf.checks.nonlinear_operators.NonLinearOperatorAxiomChecks[source]

Bases: object

A mixin for checking the properties of a NonLinearOperator.

check(*, n_checks: int = 5, op2=None, check_rtol: float = 1e-05, check_atol: float = 1e-08, measure: GaussianMeasure = None) None[source]

Runs randomized checks to validate the operator’s derivative and its algebraic properties.

Parameters:
  • n_checks – The number of randomized trials to perform.

  • op2 – An optional second operator for testing algebraic rules.

  • check_rtol – The relative tolerance for numerical checks.

  • check_atol – The absolute tolerance for numerical checks.

  • measure – A GaussianMeasure on the space from which random samples can be generated. Defaults to None, in which case the classes .random() method is used.

Module contents