API Reference

class tmsnets.core.PolynomialNetConstructor[source]

Bases: object

A class implementing algorithms for constructing (t,m,s)-networks using polynomials over finite fields.

Current implementation include Niederreiter algorithm and Rosenbloom-Tsfasman algorithm.

static construct_niederreiter(b, t, m, s, verbose=False)[source]

Constructing (t, m, s)-net via Niederreiter algorithm

Parameters:
  • b – base of (t, m, s)-net. Using for calculation over GF(b).

  • t – quality measure of (t, m, s)-net.

  • m – the number of points in the (t, m, s)-net is characterized as b^m

  • s – dimension of (t, m, s)-net

static construct_rosenbloom_tsfasman(q, m, s, beta=None)[source]

Constructs a (0, m, s)-network using the Rosenblum-Tsfasman method.Due to its combinatorial nature, this method takes a long time to work.

Parameters:
  • q – base of (0, m, s)-net. Using for calculation over GF(q).

  • m – the number of points in the (0, m, s)-net is characterized as q^m

  • s – dimension of (0, m, s)-net

static is_prime(n)[source]
static is_prime_power(n)[source]
class tmsnets.core.TMSNet(t, m, s, b, points)[source]

Bases: object

A class for storing, analyzing, and visualizing (t,m,s)-networks.

Parameters:
  • b – base of (t, m, s)-net. Using for calculation over GF(b).

  • t – quality measure of (t, m, s)-net.

  • m – the number of points in the (t, m, s)-net is characterized as b^m

  • s – dimension of (t, m, s)-net

verify() bool[source]

Checks whether a set of points is a (t,m,s)-network.If the check with the initial ‘t’ fails, the function finds the smallest possible value of t for which the points form a valid network and updates self.t.

visualize()[source]

Visualizes network points. Supports both 2D and 3D cases.

tmsnets.core.convert_points_to_fractions(points: ndarray, b: int) ndarray[source]

Converts an array of floating-point coordinates to an array of Fraction objects. This is crucial for exact arithmetic when checking if points fall into b-adic intervals.

tmsnets.core.generate_D_A_pairs(t: int, m: int, s: int, b: int) Dict[Tuple[int, ...], List[Tuple[int, ...]]][source]

Generates a dictionary that maps each vector D to a list of all possible corresponding vectors A. For a given D=(d_1, …, d_s), a vector A is (a_1, …, a_s) where 0 <= a_j < b^d_j for each j.

tmsnets.core.generate_D_vectors(t: int, m: int, s: int) ndarray[source]

Generates all possible integer vectors D = (d_1, …, d_s) for a (t, m, s)-net. These vectors satisfy d_i >= 0 and sum(d_i) = m - t, and they define the elementary intervals used for the verification check.