Skip to content

homalg · ExteriorElement

21 accepted declarations. Python and Rust forms, contracts, evidence, failure boundaries, and checked usages are kept together below.

Worked example

The complete checked program Compute in an exterior algebra and induce a linear map on two-forms uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Compute in an exterior algebra and induce a linear map on two-forms."""

from noether import Q
from noether.commalg import PolynomialRing
from noether.homalg import FreeModule, ModuleElement, ModuleHomomorphism
from noether.linalg import Matrix, Vector


def main() -> None:
    ring = PolynomialRing(Q, ["t"])
    module = FreeModule(ring, 3, basis_labels=["e0", "e1", "e2"])
    exterior = module.exterior_algebra()
    e0, e1, e2 = [exterior.generator(position) for position in range(3)]

    volume = e0 * e1 * e2
    assert volume == exterior.alternating_product(
        [
            ModuleElement(module, Vector.from_values(ring, [1, 0, 0])),
            ModuleElement(module, Vector.from_values(ring, [0, 1, 0])),
            ModuleElement(module, Vector.from_values(ring, [0, 0, 1])),
        ]
    )
    assert e1 * e0 == -(e0 * e1)
    assert e0 * e0 == exterior.zero()

    e0_dual = ModuleElement(module.dual(), Vector.from_values(ring, [1, 0, 0]))
    assert volume.contract(e0_dual) == e1 * e2

    linear_map = ModuleHomomorphism(
        module,
        module,
        Matrix.from_rows(ring, [[1, 1, 0], [0, 1, 0], [0, 0, 2]]),
    )
    on_two_forms = linear_map.exterior_power(2)
    on_two_forms.verify()
    assert on_two_forms.apply_exterior(e1 * e2) == 2 * (e0 * e2 + e1 * e2)
    print(
        "Λ² has basis",
        exterior.basis(2),
        "and the induced map sends e1∧e2 to",
        on_two_forms.apply_exterior(e1 * e2).terms,
    )


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/40_exterior_algebra.py.

homalg.ExteriorElement

A canonical sparse, possibly inhomogeneous, exact exterior-algebra element.

class ExteriorElement

noether::homalg::ExteriorElement · Direct Rust declaration

pub struct ExteriorElement<R: CommutativeRing> { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: validation/unit/homalg/test_exterior_algebra.py:19 · validation/unit/homalg/test_exterior_algebra.py:202 · validation/unit/homalg/test_exterior_algebra.py:222 · validation/unit/homalg/test_exterior_algebra.py:379 · validation/unit/homalg/test_exterior_algebra.py:393 · validation/unit/homalg/test_exterior_algebra.py:396

homalg.ExteriorElement.__add__

Add another compatible value to this value.

Detailed contract

Add an element of the same exterior algebra. Returns the argument unchanged.

(self, rhs: ExteriorElement[_BasicModuleRing]) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement::add · Direct Rust declaration

pub fn add(&self, rhs: &Self) -> Result<Self, ExteriorAlgebraError>
fn add(self, rhs: &ExteriorElement<R>) -> Self::Output
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: validation/unit/infra/test_discovery.py:211 · validation/unit/infra/test_public_api_index.py:293

homalg.ExteriorElement.__mul__

Multiply this value by another compatible value.

(self, rhs: ExteriorElement[_BasicModuleRing]) -> ExteriorElement[_BasicModuleRing]
(self, rhs: ModuleScalar) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement::mul · Direct Rust declaration

fn mul(self, rhs: &ExteriorElement<R>) -> Self::Output
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: validation/unit/infra/test_public_api_index.py:214

homalg.ExteriorElement.__neg__

Return the additive inverse of this value.

Detailed contract

Negate every retained coefficient.

(self) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement::neg · Direct Rust declaration

pub fn neg(&self) -> Result<Self, ExteriorAlgebraError>
fn neg(self) -> Self::Output
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

homalg.ExteriorElement.__rmul__

Multiply this value by a compatible value on its left.

(self, scalar: ModuleScalar) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement · Python projection

Python projection convenience over this Rust mathematical type
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

homalg.ExteriorElement.__sub__

Subtract another compatible value from this value.

Detailed contract

Subtract an element of the same exterior algebra.

(self, rhs: ExteriorElement[_BasicModuleRing]) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement::sub · Direct Rust declaration

pub fn sub(&self, rhs: &Self) -> Result<Self, ExteriorAlgebraError>
fn sub(self, rhs: &ExteriorElement<R>) -> Self::Output
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: validation/unit/infra/test_discovery.py:212

homalg.ExteriorElement.algebra

Exact exterior-algebra parent carried by this element.

Detailed contract

Exact exterior-algebra parent.

(self) -> ExteriorAlgebra[_BasicModuleRing]

noether::homalg::ExteriorElement::algebra · Direct Rust declaration

pub fn algebra(&self) -> &ExteriorAlgebra<R>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: examples/40_exterior_algebra.py:3 · examples/distributed/f2_linear_algebra.py:3 · validation/unit/commalg/test_acceptance_workload.py:3 · validation/unit/commalg/test_construction_algebras.py:41 · validation/unit/commalg/test_construction_algebras.py:71 · validation/unit/commalg/test_construction_algebras.py:72

homalg.ExteriorElement.coefficient

Coefficient of one strictly increasing exterior basis sequence.

Detailed contract

Coefficient of one canonical basis monomial.

(self, basis: Sequence[int]) -> ModuleScalar

noether::homalg::ExteriorElement::coefficient · Direct Rust declaration

pub fn coefficient<I>( &self, basis: I, ) -> Result<R::Element, ExteriorAlgebraError>where I: IntoIterator<Item = usize>,
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: examples/17_weighted_power_series.py:19 · examples/22_matroids_and_tutte.py:11 · examples/22_matroids_and_tutte.py:12 · examples/22_matroids_and_tutte.py:13 · examples/33_simplicial_cohomology_operations.py:31 · validation/unit/combin/test_acceptance_workload.py:45

homalg.ExteriorElement.contract

Contract with a covector from the exact dual based module.

Detailed contract

Contract by a covector in the exact dual based module. On e_(i1) wedge ... wedge e_(ik), the summand deleting position j has coefficient (-1)^j phi(e_ij). Degree-zero terms contract to zero.

(self, covector: ModuleElement[_BasicModuleRing]) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement::contract · Direct Rust declaration

pub fn contract( &self, covector: &ModuleElement<R>, ) -> Result<Self, ExteriorAlgebraError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: examples/40_exterior_algebra.py:29 · validation/unit/combin/test_acceptance_workload.py:77 · validation/unit/combinatorics/test_matroid.py:55 · validation/unit/homalg/test_exterior_algebra.py:129 · validation/unit/homalg/test_exterior_algebra.py:130 · validation/unit/homalg/test_exterior_algebra.py:131

homalg.ExteriorElement.degrees

Sorted exterior degrees carrying nonzero homogeneous components.

Detailed contract

Sorted degrees with nonzero support.

(self) -> list[int]

noether::homalg::ExteriorElement::degrees · Direct Rust declaration

pub fn degrees(&self) -> Vec<usize>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: examples/14_weighted_polynomials.py:18 · examples/33_simplicial_cohomology_operations.py:32 · validation/unit/homalg/test_chain_complex.py:102 · validation/unit/homalg/test_chain_complex.py:26 · validation/unit/homalg/test_exterior_algebra.py:91 · validation/unit/homalg/test_padic_homology_facade.py:237

homalg.ExteriorElement.from_json

Restore and revalidate a canonical exterior element from typed JSON.

Detailed contract

Deserialize and revalidate an exact exterior element.

(cls, value: str) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement::from_json · Direct Rust declaration

pub fn from_json(value: &str) -> Result<Self, NoetherError>where R: for<'de> Deserialize<'de>, R::Element: for<'de> Deserialize<'de>,
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: validation/unit/category/test_category.py:14 · validation/unit/combin/test_acceptance_workload.py:65 · validation/unit/combin/test_acceptance_workload.py:86 · validation/unit/combin/test_graph_facade.py:106 · validation/unit/combin/test_graph_facade.py:25 · validation/unit/combinatorics/test_kashiwara_crystal.py:32

homalg.ExteriorElement.homogeneous_component

Extract one homogeneous component without changing its parent.

Detailed contract

Retain only the requested homogeneous component.

(self, degree: int) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement::homogeneous_component · Direct Rust declaration

pub fn homogeneous_component(&self, degree: usize) -> Self
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ExteriorElement@1

homalg.ExteriorElement.homogeneous_degree

Unique exterior degree, or None for a nonzero inhomogeneous value.

Detailed contract

Degree when every nonzero term has one degree. The zero element returns None, since it belongs to every homogeneous component. An inhomogeneous nonzero element also returns None; use Self::degrees to distinguish the two cases.

(self) -> int | None

noether::homalg::ExteriorElement::homogeneous_degree · Direct Rust declaration

pub fn homogeneous_degree(&self) -> Option<usize>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:260 · validation/unit/commalg/test_polynomial_facade.py:261 · validation/unit/commalg/test_polynomial_facade.py:262 · validation/unit/commalg/test_polynomial_facade.py:305 · validation/unit/homalg/test_exterior_algebra.py:90 · validation/unit/homalg/test_finite_group_cohomology.py:163

homalg.ExteriorElement.is_zero

Whether the canonical sparse term table is empty.

Detailed contract

Whether this is the additive identity.

(self) -> bool

noether::homalg::ExteriorElement::is_zero · Direct Rust declaration

pub fn is_zero(&self) -> bool
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: examples/17_weighted_power_series.py:16 · examples/17_weighted_power_series.py:17 · examples/39_kahler_differentials.py:20 · validation/unit/commalg/test_graded_commutative_facade.py:26 · validation/unit/commalg/test_kahler_differentials.py:113 · validation/unit/commalg/test_kahler_differentials.py:38

homalg.ExteriorElement.scalar_mul

Multiply every term by a scalar in the exact coefficient context.

Detailed contract

Multiply every coefficient by a scalar in the exact base context.

(self, scalar: ModuleScalar) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement::scalar_mul · Direct Rust declaration

pub fn scalar_mul( &self, scalar: &R::Element, ) -> Result<Self, ExteriorAlgebraError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: validation/unit/commalg/test_intersection_theory.py:30 · validation/unit/commalg/test_intersection_theory.py:37 · validation/unit/commalg/test_intersection_theory.py:51 · validation/unit/commalg/test_power_series_facade.py:152 · validation/unit/numthy/test_elliptic_curve_facade.py:36 · validation/bench/macaulay2_derived.py:693

homalg.ExteriorElement.term_count

Number of nonzero canonical sparse terms.

Detailed contract

Number of retained nonzero basis terms.

(self) -> int

noether::homalg::ExteriorElement::term_count · Direct Rust declaration

pub fn term_count(&self) -> usize
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ExteriorElement@1

homalg.ExteriorElement.terms

Canonical (increasing basis positions, coefficient) terms.

Detailed contract

Iterate over canonical (basis positions, coefficient) terms.

(self) -> list[tuple[list[int], ModuleScalar]]

noether::homalg::ExteriorElement::terms · Direct Rust declaration

pub fn terms(&self) -> impl ExactSizeIterator<Item = (&[usize], &R::Element)>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: examples/07_integer_factorization.py:14 · examples/40_exterior_algebra.py:43 · validation/unit/combin/test_acceptance_workload.py:45 · validation/unit/combin/test_acceptance_workload.py:81 · validation/unit/combinatorics/test_boundary.py:31 · validation/unit/combinatorics/test_boundary.py:44

homalg.ExteriorElement.to_json

Serialize the value as faithful typed JSON.

Detailed contract

Serialize the parent and exact canonical sparse terms.

(self) -> str

noether::homalg::ExteriorElement::to_json · Direct Rust declaration

pub fn to_json(&self) -> Result<String, NoetherError>where R: Serialize, R::Element: Serialize,
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: validation/unit/category/test_category.py:14 · validation/unit/category/test_category.py:15 · validation/unit/combin/test_acceptance_workload.py:30 · validation/unit/combin/test_acceptance_workload.py:65 · validation/unit/combin/test_acceptance_workload.py:86 · validation/unit/combin/test_graph_facade.py:106

homalg.ExteriorElement.to_power_element

Convert a homogeneous value to canonical exterior-power coordinates.

Detailed contract

Convert a homogeneous component to the existing exterior-power coordinate module. Zero converts to every degree. A nonzero inhomogeneous element or a homogeneous element of another degree is rejected explicitly.

(self, degree: int) -> ModuleElement[_BasicModuleRing]

noether::homalg::ExteriorElement::to_power_element · Direct Rust declaration

pub fn to_power_element( &self, degree: usize, ) -> Result<ModuleElement<R>, ExteriorAlgebraError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: validation/unit/homalg/test_exterior_algebra.py:219 · validation/unit/homalg/test_exterior_algebra.py:359

homalg.ExteriorElement.verify

Replay canonicality and coefficient-context checks.

Detailed contract

Revalidate canonical ordering, coefficient ownership, and alternating bases.

(self) -> None

noether::homalg::ExteriorElement::verify · Direct Rust declaration

pub fn verify(&self) -> Result<(), ExteriorAlgebraError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: examples/01_bezout_certificates.py:10 · examples/01_bezout_certificates.py:3 · examples/03_exact_linear_systems.py:13 · examples/03_exact_linear_systems.py:3 · examples/04_smith_normal_form.py:12 · examples/06_shortest_lattice_vectors.py:12

homalg.ExteriorElement.wedge

Exact wedge product; material sparse work runs without the Python GIL.

Detailed contract

Exterior product with exact Koszul signs. Repeated basis positions vanish by the alternating law. In characteristic two, negation is the identity and the same algorithm therefore gives the correct commutative-but-alternating product.

(self, rhs: ExteriorElement[_BasicModuleRing]) -> ExteriorElement[_BasicModuleRing]

noether::homalg::ExteriorElement::wedge · Direct Rust declaration

pub fn wedge(&self, rhs: &Self) -> Result<Self, ExteriorAlgebraError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL released
Semantic ID noether/homalg/ExteriorElement@1

Executable usage: examples/27_weight_characters.py:28 · validation/unit/homalg/test_exterior_algebra.py:308 · validation/unit/homalg/test_exterior_algebra.py:351 · validation/unit/homalg/test_exterior_algebra.py:393 · validation/unit/homalg/test_exterior_algebra.py:396 · validation/unit/homalg/test_exterior_algebra.py:397