Skip to content

numthy · NthPowerClass

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

Worked example

The complete checked program Construct S4 natively and inspect its stabilizer chain consequences uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Construct S4 natively and inspect its stabilizer chain consequences."""

from noether.groups import Permutation, PermutationGroup


def main() -> None:
    group = PermutationGroup.from_generators(
        4,
        [Permutation.from_images([1, 0, 2, 3]), Permutation.from_images([1, 2, 3, 0])],
    )
    assert group.order == 24
    assert group.is_transitive
    assert group.stabilizer(0).order == 6
    random = group.uniform_random_element(seed=2026)
    assert random.element in group
    print(f"|S4|={group.order}; |Stab(0)|={group.stabilizer(0).order}; sample={random.element}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/19_permutation_groups.py.

numthy.NthPowerClass

One canonical class in an effective quotient K*/K*^n.

class NthPowerClass

noether::numthy::NthPowerClass · Direct Rust declaration

pub struct NthPowerClass<R: Field> { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@1

Executable usage: validation/unit/numthy/test_elliptic_curve_facade.py:100 · validation/unit/numthy/test_elliptic_curve_facade.py:109 · validation/unit/numthy/test_elliptic_curve_facade.py:12

numthy.NthPowerClass.__mul__

Multiply this value by another compatible value.

(self, other: NthPowerClass[P]) -> NthPowerClass[P]

noether::numthy::NthPowerClass::mul · Direct Rust declaration

fn mul(self, rhs: &NthPowerClass<RationalField>) -> Self::Output
fn mul( self, rhs: &NthPowerClass<RationalFunctionField<RationalField>>, ) -> Self::Output
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@1

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

numthy.NthPowerClass.__pow__

Raise this value to the supplied power.

(self, exponent: int, modulus: None=None) -> NthPowerClass[P]

noether::numthy::NthPowerClass · 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
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@1

numthy.NthPowerClass.__truediv__

Divide this value by another compatible value.

(self, other: NthPowerClass[P]) -> NthPowerClass[P]

noether::numthy::NthPowerClass · 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
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@1

numthy.NthPowerClass.from_json

Deserialize and revalidate a NthPowerClass from typed JSON.

Detailed contract

Restore and recompute all rational prime valuations. Restore and recompute all constant and polynomial valuations.

(cls, value: str) -> NthPowerClass[PowerClassBase]

noether::numthy::NthPowerClass::from_json · Direct Rust declaration

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

numthy.NthPowerClass.group

Return the group recorded by this NthPowerClass.

Detailed contract

Owning quotient context.

(self) -> NthPowerClassGroup[P]

noether::numthy::NthPowerClass::group · Direct Rust declaration

pub fn group(&self) -> &NthPowerClassGroup<R>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@1

Executable usage: examples/19_permutation_groups.py:13 · examples/19_permutation_groups.py:14 · examples/19_permutation_groups.py:15 · examples/19_permutation_groups.py:16 · examples/19_permutation_groups.py:17 · examples/19_permutation_groups.py:18

numthy.NthPowerClass.inverse

Compute inverse for this NthPowerClass.

Detailed contract

Multiplicative inverse.

(self) -> NthPowerClass[P]

noether::numthy::NthPowerClass::inverse · Direct Rust declaration

pub fn inverse(&self) -> Result<Self, PowerClassError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@1

Executable usage: examples/distributed/f2_linear_algebra.py:37 · examples/distributed/f2_linear_algebra.py:39 · validation/unit/commalg/test_context_tower_workload.py:121 · validation/unit/commalg/test_context_tower_workload.py:122 · validation/unit/commalg/test_context_tower_workload.py:75 · validation/unit/commalg/test_context_tower_workload.py:77

numthy.NthPowerClass.is_identity

Test whether this NthPowerClass is identity.

Detailed contract

Whether this is the trivial class.

(self) -> bool

noether::numthy::NthPowerClass::is_identity · Direct Rust declaration

pub fn is_identity(&self) -> bool
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@1

Executable usage: examples/26_elliptic_descent_functions.py:39 · validation/unit/groups/test_acceptance_workload.py:103 · validation/unit/numthy/test_elliptic_curve_facade.py:108 · validation/unit/numthy/test_elliptic_curve_facade.py:93 · validation/corpus/groups/hurwitz-degree-nine-generating-triple.py:20

numthy.NthPowerClass.pow

Compute pow for this NthPowerClass.

Detailed contract

Raise the class to an arbitrary-precision signed integer.

(self, exponent: int) -> NthPowerClass[P]

noether::numthy::NthPowerClass::pow · Direct Rust declaration

pub fn pow(&self, exponent: &Integer) -> Result<Self, PowerClassError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@1

Executable usage: examples/17_weighted_power_series.py:18 · validation/unit/commalg/test_polynomial_ideal_facade.py:368 · validation/unit/commalg/test_polynomial_ideal_facade.py:369 · validation/unit/commalg/test_polynomial_ideal_facade.py:370 · validation/unit/commalg/test_polynomial_ideal_facade.py:373 · validation/unit/commalg/test_polynomial_ideal_facade.py:381

numthy.NthPowerClass.representative

Compute representative for this NthPowerClass.

Detailed contract

Materialize a deterministic rational representative. Materialize a deterministic rational-function representative.

(self) -> EllipticCoefficient

noether::numthy::NthPowerClass::representative · Direct Rust declaration

pub fn representative(&self) -> Result<Rational, PowerClassError>
pub fn representative( &self, ) -> Result<RationalFunction<RationalField>, PowerClassError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@1

Executable usage: validation/unit/commalg/test_residue_ring_facade.py:101 · validation/unit/commalg/test_residue_ring_facade.py:110 · validation/unit/commalg/test_residue_ring_facade.py:129 · validation/unit/commalg/test_residue_ring_facade.py:26 · validation/unit/commalg/test_residue_ring_facade.py:80 · validation/unit/groups/test_acceptance_workload.py:125

numthy.NthPowerClass.to_json

Serialize this NthPowerClass to its canonical typed JSON representation.

Detailed contract

Serialize a canonical representative; restoration refactors it.

(self) -> str

noether::numthy::NthPowerClass::to_json · Direct Rust declaration

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

numthy.NthPowerClass.verify

Replay and verify the mathematical evidence carried by this NthPowerClass.

Detailed contract

Recheck reduced exponent ranges and factor ordering.

(self) -> None

noether::numthy::NthPowerClass::verify · Direct Rust declaration

pub fn verify(&self) -> Result<(), VerificationError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/NthPowerClass@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