Skip to content

geometry · Polytope

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

Worked example

The complete checked program Solve an underdetermined rational system and verify its affine space uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Solve an underdetermined rational system and verify its affine space."""

from noether import Q
from noether.linalg import Matrix, Vector


def main() -> None:
    matrix = Matrix.from_rows(Q, [[1, 2, 3], [2, 4, 6]])
    right_hand_side = Vector.from_values(Q, [1, 2])
    solutions = matrix.solve(right_hand_side)
    solutions.verify()
    assert matrix @ solutions.particular == right_hand_side
    assert solutions.dimension == 2
    print(f"particular={solutions.particular}; nullity={solutions.dimension}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/03_exact_linear_systems.py.

geometry.Polytope

A nonempty bounded convex polytope with exact rational coordinates.

class Polytope

noether::geometry::Polytope · Direct Rust declaration

pub struct Polytope { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/geometry/test_acceptance_workload.py:61 · validation/unit/geometry/test_acceptance_workload.py:62 · validation/unit/geometry/test_acceptance_workload.py:63 · validation/unit/geometry/test_acceptance_workload.py:66 · validation/unit/geometry/test_acceptance_workload.py:9 · validation/unit/geometry/test_polytope_facade.py:10

geometry.Polytope.ambient_dimension

Ambient coordinate dimension.

(self) -> int

noether::geometry::Polytope::ambient_dimension · Direct Rust declaration

pub fn ambient_dimension(&self) -> usize
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/commalg/test_kahler_differentials.py:98 · validation/unit/geometry/test_geometry_facade.py:23 · validation/unit/geometry/test_geometry_facade.py:46 · validation/unit/geometry/test_polytope_facade.py:30 · validation/unit/linalg/test_exact_linear_algebra_facade.py:152 · validation/unit/linalg/test_exact_linear_algebra_facade.py:153

geometry.Polytope.dimension

Affine dimension.

Detailed contract

Affine dimension of the polytope.

(self) -> int

noether::geometry::Polytope::dimension · Direct Rust declaration

pub fn dimension(&self) -> usize
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: examples/03_exact_linear_systems.py:15 · examples/03_exact_linear_systems.py:16 · examples/15_groebner_twisted_cubic.py:14 · examples/15_groebner_twisted_cubic.py:28 · examples/27_weight_characters.py:25 · examples/34_finite_group_cohomology.py:13

geometry.Polytope.f_vector

Face counts (f_-1, f_0, ..., f_dimension).

Detailed contract

Face counts (f_-1, f_0, ..., f_dimension).

(self) -> list[int]

noether::geometry::Polytope::f_vector · Direct Rust declaration

pub fn f_vector(&self) -> Vec<usize>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: examples/25_exact_geometry.py:13 · examples/25_exact_geometry.py:15 · validation/unit/geometry/test_polytope_facade.py:38 · validation/unit/geometry/test_polytope_facade.py:79 · validation/parity/polyhedral/test_convex_hull_parity.py:11 · validation/parity/polyhedral/test_convex_hull_parity.py:154

geometry.Polytope.face_lattice

Faces as (dimension, vertex_indices), including the empty face.

Detailed contract

Complete face lattice and its Hasse covering relation.

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

noether::geometry::Polytope::face_lattice · Direct Rust declaration

pub fn face_lattice(&self) -> FaceLattice
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL released
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/geometry/test_acceptance_workload.py:86 · validation/unit/geometry/test_polytope_facade.py:80 · validation/parity/polyhedral/test_convex_hull_parity.py:11 · validation/parity/polyhedral/test_convex_hull_parity.py:213 · validation/parity/polyhedral/test_convex_hull_parity.py:224 · validation/corpus/geometry/order-four-permutahedron.py:19

geometry.Polytope.face_lattice_covers

Hasse covering pairs indexing face_lattice().

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

noether::geometry::Polytope · 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, geom-core, convex-hull
GIL released
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/geometry/test_acceptance_workload.py:87 · validation/parity/polyhedral/test_convex_hull_parity.py:232 · validation/corpus/geometry/order-three-permutahedron.py:25

geometry.Polytope.facets

Exact ambient inequalities (normal, rhs).

Detailed contract

Exact ambient facet inequalities. The kernel’s inequalities for a lower-dimensional polytope live in a deterministic affine coordinate frame, not the original ambient coordinates. This method fails in that case instead of mislabelling them; incidence and the face lattice remain available.

(self) -> list[tuple[list[Fraction], Fraction]]

noether::geometry::Polytope::facets · Direct Rust declaration

pub fn facets(&self) -> Result<&[Facet], GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/combinatorics/test_poset.py:132 · validation/unit/geometry/test_acceptance_workload.py:60 · validation/unit/geometry/test_acceptance_workload.py:79 · validation/unit/geometry/test_polytope_facade.py:39 · validation/unit/geometry/test_polytope_facade.py:82 · validation/unit/topology/test_simplicial_complex_facade.py:59

geometry.Polytope.from_halfspaces

Construct a bounded polytope from normal_i · x <= rhs_i.

Detailed contract

Construct a bounded polytope from inequalities normal_i · x <= rhs_i. Empty, infeasible, and unbounded regions fail rather than being represented by a bounded type.

(normals: Sequence[Sequence[int | Fraction]], rhs: Sequence[int | Fraction]) -> Polytope

noether::geometry::Polytope::from_halfspaces · Direct Rust declaration

pub fn from_halfspaces( normals: &[Vec<Rational>], rhs: &[Rational], ) -> Result<Self, GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL released
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/geometry/test_acceptance_workload.py:61 · validation/unit/geometry/test_acceptance_workload.py:62 · validation/unit/geometry/test_polytope_facade.py:48 · validation/unit/geometry/test_polytope_facade.py:69 · validation/unit/geometry/test_polytope_facade.py:71 · validation/unit/geometry/test_polytope_facade.py:73

geometry.Polytope.from_json

Deserialize and recompute every derived invariant.

Detailed contract

Deserialize and recompute every derived polytope invariant.

(value: str) -> Polytope

noether::geometry::Polytope::from_json · Direct Rust declaration

pub fn from_json(value: &str) -> Result<Self, GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@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

geometry.Polytope.from_vertices

Construct the exact convex hull of rational vertices.

Detailed contract

Construct the convex hull of exact rational points.

(points: Sequence[Sequence[int | Fraction]]) -> Polytope

noether::geometry::Polytope::from_vertices · Direct Rust declaration

pub fn from_vertices(points: &[Vec<Rational>]) -> Result<Self, GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL released
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/geometry/test_acceptance_workload.py:62 · validation/unit/geometry/test_acceptance_workload.py:63 · validation/unit/geometry/test_acceptance_workload.py:85 · validation/unit/geometry/test_acceptance_workload.py:86 · validation/unit/geometry/test_acceptance_workload.py:87 · validation/unit/geometry/test_polytope_facade.py:54

geometry.Polytope.is_facet

Whether an exact ambient inequality defines a facet.

Detailed contract

Whether an ambient inequality defines a facet.

(self, normal: Sequence[int | Fraction], rhs: int | Fraction) -> bool

noether::geometry::Polytope::is_facet · Direct Rust declaration

pub fn is_facet( &self, normal: &[Rational], rhs: &Rational, ) -> Result<bool, GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/geometry/test_polytope_facade.py:43 · validation/parity/polyhedral/test_convex_hull_parity.py:12 · validation/parity/polyhedral/test_convex_hull_parity.py:213 · validation/parity/polyhedral/test_convex_hull_parity.py:221 · validation/parity/polyhedral/test_convex_hull_parity.py:222 · validation/corpus/geometry/antichain-probability-polytope.py:28

geometry.Polytope.is_full_dimensional

Whether the affine hull is the whole ambient space.

(self) -> bool

noether::geometry::Polytope::is_full_dimensional · Direct Rust declaration

pub fn is_full_dimensional(&self) -> bool
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/geometry/test_polytope_facade.py:31 · validation/corpus/geometry/order-three-permutahedron.py:16 · validation/corpus/geometry/oscar-pentagon-face-structure.py:31

geometry.Polytope.is_vertex

Whether an exact ambient point is a vertex.

Detailed contract

Whether an ambient rational point is a vertex.

(self, point: Sequence[int | Fraction]) -> bool

noether::geometry::Polytope::is_vertex · Direct Rust declaration

pub fn is_vertex(&self, point: &[Rational]) -> Result<bool, GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: examples/25_exact_geometry.py:14 · validation/unit/geometry/test_polytope_facade.py:41 · validation/unit/geometry/test_polytope_facade.py:42 · validation/parity/polyhedral/test_convex_hull_parity.py:12 · validation/parity/polyhedral/test_convex_hull_parity.py:213 · validation/parity/polyhedral/test_convex_hull_parity.py:216

geometry.Polytope.to_json

Serialize exact defining vertices and semantic identity.

Detailed contract

Serialize the type identity and exact defining vertices.

(self) -> str

noether::geometry::Polytope::to_json · Direct Rust declaration

pub fn to_json(&self) -> Result<String, GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@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

geometry.Polytope.verify

Recompute the exact hull and all derived combinatorics.

Detailed contract

Reconstruct from the defining vertices and compare every derived value.

(self) -> None

noether::geometry::Polytope::verify · Direct Rust declaration

pub fn verify(&self) -> Result<(), GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL released
Semantic ID noether/geometry/Polytope@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

geometry.Polytope.vertex_facet_incidence

Vertex indices lying on each facet.

(self) -> list[list[int]]

noether::geometry::Polytope::vertex_facet_incidence · Direct Rust declaration

pub fn vertex_facet_incidence(&self) -> &[Vec<usize>]
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: validation/unit/geometry/test_acceptance_workload.py:79 · validation/unit/geometry/test_acceptance_workload.py:85 · validation/unit/geometry/test_polytope_facade.py:40 · validation/parity/polyhedral/test_convex_hull_parity.py:193 · validation/corpus/geometry/order-three-permutahedron.py:20 · validation/corpus/geometry/oscar-pentagon-face-structure.py:35

geometry.Polytope.vertices

Exact vertices as fractions.Fraction values.

Detailed contract

Lexicographically ordered vertices in ambient coordinates.

(self) -> list[list[Fraction]]

noether::geometry::Polytope::vertices · Direct Rust declaration

pub fn vertices(&self) -> &[Vec<Rational>]
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded
Semantic ID noether/geometry/Polytope@1

Executable usage: examples/25_exact_geometry.py:15 · validation/unit/geometry/test_acceptance_workload.py:62 · validation/unit/geometry/test_acceptance_workload.py:76 · validation/unit/geometry/test_polytope_facade.py:32 · validation/unit/geometry/test_polytope_facade.py:54 · validation/unit/infra/test_magma_release_protocol.py:256