|
| 1 | +from typing import overload |
| 2 | +from flint.flint_base.flint_base import flint_poly |
| 3 | +from .fmpz import fmpz, ifmpz |
| 4 | +from .fmpz_mod import fmpz_mod |
| 5 | +from .fmpz_poly import fmpz_poly, ifmpz_poly |
| 6 | +from .fmpz_mod_poly import fmpz_mod_poly |
| 7 | +from .fq_default import fq_default_type, fq_default_ctx, fq_default, ifq_default |
| 8 | + |
| 9 | +ifmpz_mod = int | fmpz | fmpz_mod |
| 10 | +ifq_default_poly = fq_default_poly | ifq_default | ifmpz_poly |
| 11 | + |
| 12 | +class fq_default_poly_ctx: |
| 13 | + r"""Context object for creating :class:`~.fq_default_poly` initialised |
| 14 | + with a finite field `GF(p^d)`. |
| 15 | + """ |
| 16 | + |
| 17 | + @overload |
| 18 | + def __init__(self, p: fq_default_ctx, /) -> None: ... |
| 19 | + @overload |
| 20 | + def __init__( |
| 21 | + self, |
| 22 | + p: fq_default_ctx | ifmpz | None = None, |
| 23 | + degree: int | None = None, |
| 24 | + var: str | None = None, |
| 25 | + modulus: fmpz_mod_poly | fmpz_poly | None = None, |
| 26 | + fq_type: str | int | fq_default_type = fq_default_type.DEFAULT, |
| 27 | + check_prime: bool = True, |
| 28 | + check_modulus: bool = True, |
| 29 | + ): ... |
| 30 | + def __init__( |
| 31 | + self, |
| 32 | + p: fq_default_ctx | ifmpz | None = None, |
| 33 | + degree: int | None = None, |
| 34 | + var: str | None = None, |
| 35 | + modulus: fmpz_mod_poly | fmpz_poly | None = None, |
| 36 | + fq_type: str | int | fq_default_type = fq_default_type.DEFAULT, |
| 37 | + check_prime: bool = True, |
| 38 | + check_modulus: bool = True, |
| 39 | + ): ... |
| 40 | + def base_field(self) -> fq_default_ctx: ... |
| 41 | + def characteristic(self) -> fmpz: ... |
| 42 | + def prime(self) -> fmpz: ... |
| 43 | + def zero(self) -> fq_default_poly: ... |
| 44 | + def one(self) -> fq_default_poly: ... |
| 45 | + def gen(self) -> fq_default_poly: ... |
| 46 | + def random_element( |
| 47 | + self, |
| 48 | + degree: int = 3, |
| 49 | + not_zero: bool = False, |
| 50 | + monic: bool = False, |
| 51 | + irreducible: bool = False, |
| 52 | + ) -> fq_default_poly: ... |
| 53 | + def __str__(self) -> str: ... |
| 54 | + def __repr__(self) -> str: ... |
| 55 | + def __call__(self, val: ifq_default_poly) -> fq_default_poly: ... |
| 56 | + |
| 57 | +class fq_default_poly(flint_poly[fq_default]): |
| 58 | + """ |
| 59 | + The *fq_default_poly* type represents univariate polynomials |
| 60 | + over a finite field. |
| 61 | + """ |
| 62 | + |
| 63 | + def __init__( |
| 64 | + self, other: ifq_default_poly | list[ifq_default], ctx: fq_default_poly_ctx, / |
| 65 | + ) -> None: ... |
| 66 | + def __getitem__(self, i: int, /) -> fq_default: ... |
| 67 | + def __setitem__(self, i: int, x: ifq_default, /) -> None: ... |
| 68 | + def __len__(self) -> int: ... |
| 69 | + def length(self) -> int: ... |
| 70 | + def degree(self) -> int: ... |
| 71 | + def constant_coefficient(self) -> fq_default: ... |
| 72 | + def leading_coefficient(self) -> fq_default: ... |
| 73 | + def reverse(self, degree: int | None = None) -> fq_default_poly: ... |
| 74 | + def truncate(self, n: int) -> fq_default_poly: ... |
| 75 | + def monic(self) -> fq_default_poly: ... |
| 76 | + def is_zero(self) -> bool: ... |
| 77 | + def is_one(self) -> bool: ... |
| 78 | + def is_gen(self) -> bool: ... |
| 79 | + def is_constant(self) -> bool: ... |
| 80 | + def is_monic(self) -> bool: ... |
| 81 | + def is_irreducible(self) -> bool: ... |
| 82 | + def is_squarefree(self) -> bool: ... |
| 83 | + def __pos__(self) -> fq_default_poly: ... |
| 84 | + def __neg__(self) -> fq_default_poly: ... |
| 85 | + def __add__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 86 | + def __radd__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 87 | + def __sub__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 88 | + def __rsub__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 89 | + def __mul__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 90 | + def __rmul__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 91 | + def __floordiv__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 92 | + def __rfloordiv__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 93 | + def __mod__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 94 | + def __rmod__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 95 | + def __divmod__( |
| 96 | + self, other: ifq_default_poly, / |
| 97 | + ) -> tuple[fq_default_poly, fq_default_poly]: ... |
| 98 | + def __rdivmod__( |
| 99 | + self, other: ifq_default_poly, / |
| 100 | + ) -> tuple[fq_default_poly, fq_default_poly]: ... |
| 101 | + def __truediv__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 102 | + def __rtruediv__(self, other: ifq_default_poly, /) -> fq_default_poly: ... |
| 103 | + def __pow__( |
| 104 | + self, e: int, mod: ifq_default_poly | None = None |
| 105 | + ) -> fq_default_poly: ... |
| 106 | + def pow_mod(self, e: int, modulus: ifq_default_poly) -> fq_default_poly: ... |
| 107 | + def divmod( |
| 108 | + self, other: ifq_default_poly |
| 109 | + ) -> tuple[fq_default_poly, fq_default_poly]: ... |
| 110 | + def exact_division(self, other: ifq_default_poly) -> fq_default_poly: ... |
| 111 | + def gcd(self, other: ifq_default_poly) -> fq_default_poly: ... |
| 112 | + def xgcd( |
| 113 | + self, other: ifq_default_poly, / |
| 114 | + ) -> tuple[fq_default_poly, fq_default_poly, fq_default_poly]: ... |
| 115 | + def square(self) -> fq_default_poly: ... |
| 116 | + def left_shift(self, n: int) -> fq_default_poly: ... |
| 117 | + def right_shift(self, n: int) -> fq_default_poly: ... |
| 118 | + def sqrt(self) -> fq_default_poly: ... |
| 119 | + def mul_mod( |
| 120 | + self, other: ifq_default_poly, modulus: ifq_default_poly |
| 121 | + ) -> fq_default_poly: ... |
| 122 | + def equal_trunc(self, other: ifq_default_poly, n: int) -> bool: ... |
| 123 | + def add_trunc(self, other: ifq_default_poly, n: int) -> fq_default_poly: ... |
| 124 | + def sub_trunc(self, other: ifq_default_poly, n: int) -> fq_default_poly: ... |
| 125 | + def mul_low(self, other: ifq_default_poly, n: int) -> fq_default_poly: ... |
| 126 | + def pow_trunc(self, e: int, n: int) -> fq_default_poly: ... |
| 127 | + def sqrt_trunc(self, n: int) -> fq_default_poly: ... |
| 128 | + def inv_sqrt_trunc(self, n: int) -> fq_default_poly: ... |
| 129 | + def inverse_series_trunc(self, n: int) -> fq_default_poly: ... |
| 130 | + def inverse_mod(self, other: ifq_default_poly) -> fq_default_poly: ... |
| 131 | + def derivative(self) -> fq_default_poly: ... |
| 132 | + def radical(self) -> fq_default_poly: ... |
| 133 | + def inflate(self, n: int) -> fq_default_poly: ... |
| 134 | + def deflate(self, n: int) -> fq_default_poly: ... |
| 135 | + def deflation(self) -> tuple[fq_default_poly, int]: ... |
| 136 | + def __call__(self, input: fq_default_poly | ifq_default) -> fq_default_poly: ... |
| 137 | + def evaluate(self, input: ifq_default) -> fq_default_poly: ... |
| 138 | + def compose(self, other: ifq_default_poly) -> fq_default_poly: ... |
| 139 | + def compose_mod( |
| 140 | + self, other: ifq_default_poly, modulus: ifq_default_poly |
| 141 | + ) -> fq_default_poly: ... |
| 142 | + def factor_squarefree( |
| 143 | + self, |
| 144 | + ) -> tuple[fq_default_poly, list[tuple[fq_default_poly, int]]]: ... |
| 145 | + def factor(self) -> tuple[fq_default_poly, list[tuple[fq_default_poly, int]]]: ... |
| 146 | + def roots(self, multiplicities=True) -> list[tuple[fq_default, int]]: ... |
0 commit comments