Skip to content

Commit

Permalink
Create pyi stub files for cython modules in sage/src/sage/arith
Browse files Browse the repository at this point in the history
Add pyi stub files for cython modules in `arith` and `algebras`
  • Loading branch information
tobiasdiez committed Jan 4, 2025
1 parent c9dd1e8 commit 8dccdc4
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/sage/algebras/clifford_algebra_element.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from collections.abc import Iterator
from typing import Any

class CliffordAlgebraElement:
def _repr_(self) -> str: ...
def _latex_(self) -> str: ...
def _mul_(self, other: CliffordAlgebraElement) -> CliffordAlgebraElement: ...
def _mul_self_term(self, supp: Any, coeff: Any) -> CliffordAlgebraElement: ...
def _mul_term_self(self, supp: Any, coeff: Any) -> CliffordAlgebraElement: ...
def list(self) -> list[tuple[Any, Any]]: ...
def support(self) -> list[Any]: ...
def reflection(self) -> CliffordAlgebraElement: ...
degree_negation = reflection
def transpose(self) -> CliffordAlgebraElement: ...
def conjugate(self) -> CliffordAlgebraElement: ...
clifford_conjugate = conjugate

class ExteriorAlgebraElement(CliffordAlgebraElement):
def _mul_(self, other: ExteriorAlgebraElement) -> ExteriorAlgebraElement: ...
def _mul_self_term(self, supp: Any, coeff: Any) -> ExteriorAlgebraElement: ...
def _mul_term_self(self, supp: Any, coeff: Any) -> ExteriorAlgebraElement: ...
def reduce(self, I: Any, left: bool = True) -> ExteriorAlgebraElement: ...
def interior_product(self, x: Any) -> ExteriorAlgebraElement: ...
antiderivation = interior_product
def hodge_dual(self) -> ExteriorAlgebraElement: ...
def constant_coefficient(self) -> Any: ...
def scalar(self, other: ExteriorAlgebraElement) -> Any: ...

class CohomologyRAAGElement(CliffordAlgebraElement):
def _mul_(self, other: CohomologyRAAGElement) -> CohomologyRAAGElement: ...
90 changes: 90 additions & 0 deletions src/sage/algebras/exterior_algebra_groebner.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
from collections.abc import List, Set

class GBElement:
def __init__(self, x: Any, ls: Any, n: int) -> None:
...

def __hash__(self) -> int:
...

def __richcmp__(self, other: Any, op: int) -> Any:
...

class GroebnerStrategy:
def __init__(self, I: Any) -> None:
...

def leading_support(self, f: Any) -> Any:
...

def partial_S_poly_left(self, f: GBElement, g: GBElement) -> GBElement:
...

def partial_S_poly_right(self, f: GBElement, g: GBElement) -> GBElement:
...

def build_elt(self, f: Any) -> GBElement:
...

def prod_GB_term(self, f: GBElement, t: Any) -> GBElement:
...

def prod_term_GB(self, t: Any, f: GBElement) -> GBElement:
...

def build_S_poly(self, f: GBElement, g: GBElement) -> bool:
...

def preprocessing(self, P: List[tuple[GBElement, GBElement]], G: List[GBElement]) -> Set[GBElement]:
...

def reduction(self, P: List[tuple[GBElement, GBElement]], G: List[GBElement]) -> List[GBElement]:
...

def compute_groebner(self, reduced: bool = True) -> None:
...

def reduced_gb(self, G: List[GBElement]) -> int:
...

def reduce_computed_gb(self) -> None:
...

def reduce(self, f: Any) -> Any:
...

def reduce_single(self, f: Any, g: Any) -> bool:
...

def bitset_to_int(self, X: Any) -> int:
...

def int_to_bitset(self, n: int) -> Any:
...

def sorted_monomials(self, as_dict: bool = False) -> List[Any]:
...

def monomial_to_int(self) -> dict:
...

class GroebnerStrategyNegLex(GroebnerStrategy):
def bitset_to_int(self, X: Any) -> int:
...

def int_to_bitset(self, n: int) -> Any:
...

class GroebnerStrategyDegRevLex(GroebnerStrategy):
def bitset_to_int(self, X: Any) -> int:
...

def int_to_bitset(self, n: int) -> Any:
...

class GroebnerStrategyDegLex(GroebnerStrategy):
def bitset_to_int(self, X: Any) -> int:
...

def int_to_bitset(self, n: int) -> Any:
...
6 changes: 6 additions & 0 deletions src/sage/arith/functions.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from collections.abc import Iterable
from typing import Any

def lcm(a: Any, b: Any = None) -> Any: ...
def LCM_list(v: Iterable[Any]) -> Any: ...
def LCM_generic(itr: Iterable[Any], ret: Any) -> Any: ...
3 changes: 3 additions & 0 deletions src/sage/arith/rational_reconstruction.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Any

def mpq_rational_reconstruction(answer: Any, a: Any, m: Any) -> int: ...

0 comments on commit 8dccdc4

Please sign in to comment.