JSON Schemas¶
These schemas are auto-generated from the Pydantic models at documentation build time, so they always reflect the current code.
Each input and output type is a valid JSON Schema (draft 2020-12). You can use them to validate requests and responses programmatically:
import jsonschema
from snforacle.schema import DenseIntMatrix
schema = DenseIntMatrix.model_json_schema()
jsonschema.validate(instance=my_dict, schema=schema)
Integer matrices¶
SparseEntry¶
A single nonzero entry in a sparse integer matrix.
JSON Schema
{
"description": "A single nonzero entry in a sparse integer matrix.",
"properties": {
"row": {
"minimum": 0,
"title": "Row",
"type": "integer"
},
"col": {
"minimum": 0,
"title": "Col",
"type": "integer"
},
"value": {
"title": "Value",
"type": "integer"
}
},
"required": [
"row",
"col",
"value"
],
"title": "SparseEntry",
"type": "object"
}
DenseIntMatrix¶
An integer matrix stored as a full list of rows.
JSON Schema
{
"description": "An integer matrix stored as a full list of rows.",
"properties": {
"format": {
"const": "dense",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols",
"entries"
],
"title": "DenseIntMatrix",
"type": "object"
}
SparseIntMatrix¶
An integer matrix stored as a list of (row, col, value) triples.
JSON Schema
{
"$defs": {
"SparseEntry": {
"description": "A single nonzero entry in a sparse integer matrix.",
"properties": {
"row": {
"minimum": 0,
"title": "Row",
"type": "integer"
},
"col": {
"minimum": 0,
"title": "Col",
"type": "integer"
},
"value": {
"title": "Value",
"type": "integer"
}
},
"required": [
"row",
"col",
"value"
],
"title": "SparseEntry",
"type": "object"
}
},
"description": "An integer matrix stored as a list of (row, col, value) triples.\n\nEntries not listed are implicitly zero. Duplicate (row, col) pairs are\nnot allowed; the last value wins only if ``allow_duplicates`` is True\n(default: False).",
"properties": {
"format": {
"const": "sparse",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"entries": {
"items": {
"$ref": "#/$defs/SparseEntry"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols"
],
"title": "SparseIntMatrix",
"type": "object"
}
SNFResult¶
The Smith normal form of an integer matrix.
JSON Schema
{
"$defs": {
"DenseIntMatrix": {
"description": "An integer matrix stored as a full list of rows.",
"properties": {
"format": {
"const": "dense",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols",
"entries"
],
"title": "DenseIntMatrix",
"type": "object"
}
},
"description": "The Smith normal form of an integer matrix.\n\n``smith_normal_form`` is always returned as a dense matrix whose\ndiagonal contains the invariant factors d\u2081 | d\u2082 | \u2026 | d\u1d63 (in\nnon-decreasing order) and whose off-diagonal entries are zero.\n\n``invariant_factors`` is the same sequence as the diagonal, listed\nwithout the surrounding zero rows/columns.",
"properties": {
"smith_normal_form": {
"$ref": "#/$defs/DenseIntMatrix"
},
"invariant_factors": {
"items": {
"type": "integer"
},
"title": "Invariant Factors",
"type": "array"
}
},
"required": [
"smith_normal_form",
"invariant_factors"
],
"title": "SNFResult",
"type": "object"
}
SNFWithTransformsResult¶
The Smith normal form together with unimodular transformation matrices.
JSON Schema
{
"$defs": {
"DenseIntMatrix": {
"description": "An integer matrix stored as a full list of rows.",
"properties": {
"format": {
"const": "dense",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols",
"entries"
],
"title": "DenseIntMatrix",
"type": "object"
}
},
"description": "The Smith normal form together with unimodular transformation matrices.\n\nLet M be the input matrix. The matrices satisfy::\n\n left_transform \u00b7 M \u00b7 right_transform = smith_normal_form\n\nAll three matrices are returned as dense integer matrices.",
"properties": {
"smith_normal_form": {
"$ref": "#/$defs/DenseIntMatrix"
},
"invariant_factors": {
"items": {
"type": "integer"
},
"title": "Invariant Factors",
"type": "array"
},
"left_transform": {
"$ref": "#/$defs/DenseIntMatrix"
},
"right_transform": {
"$ref": "#/$defs/DenseIntMatrix"
}
},
"required": [
"smith_normal_form",
"invariant_factors",
"left_transform",
"right_transform"
],
"title": "SNFWithTransformsResult",
"type": "object"
}
HNFResult¶
Row Hermite Normal Form of an integer matrix.
JSON Schema
{
"$defs": {
"DenseIntMatrix": {
"description": "An integer matrix stored as a full list of rows.",
"properties": {
"format": {
"const": "dense",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols",
"entries"
],
"title": "DenseIntMatrix",
"type": "object"
}
},
"description": "Row Hermite Normal Form of an integer matrix.\n\nThe Hermite Normal Form is the unique upper-triangular matrix H with\npositive pivots (smallest to largest) satisfying H = U\u00b7M for some\nunimodular integer matrix U.",
"properties": {
"hermite_normal_form": {
"$ref": "#/$defs/DenseIntMatrix"
}
},
"required": [
"hermite_normal_form"
],
"title": "HNFResult",
"type": "object"
}
HNFWithTransformResult¶
Row Hermite Normal Form together with the left unimodular transform.
JSON Schema
{
"$defs": {
"DenseIntMatrix": {
"description": "An integer matrix stored as a full list of rows.",
"properties": {
"format": {
"const": "dense",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols",
"entries"
],
"title": "DenseIntMatrix",
"type": "object"
}
},
"description": "Row Hermite Normal Form together with the left unimodular transform.\n\nLet M be the input matrix. The matrices satisfy::\n\n left_transform \u00b7 M = hermite_normal_form\n\nBoth matrices are returned as dense integer matrices.",
"properties": {
"hermite_normal_form": {
"$ref": "#/$defs/DenseIntMatrix"
},
"left_transform": {
"$ref": "#/$defs/DenseIntMatrix"
}
},
"required": [
"hermite_normal_form",
"left_transform"
],
"title": "HNFWithTransformResult",
"type": "object"
}
ElementaryDivisorsResult¶
Non-zero invariant factors of an integer matrix.
JSON Schema
{
"description": "Non-zero invariant factors of an integer matrix.\n\nThese are the same values as the diagonal of the Smith normal form,\nreturned in non-decreasing order. They can be computed via a potentially\nfaster dedicated path than the full SNF computation.",
"properties": {
"elementary_divisors": {
"items": {
"type": "integer"
},
"title": "Elementary Divisors",
"type": "array"
}
},
"required": [
"elementary_divisors"
],
"title": "ElementaryDivisorsResult",
"type": "object"
}
Finite-field matrices (F_p)¶
SparseFFEntry¶
A single nonzero entry in a sparse finite-field matrix.
JSON Schema
{
"description": "A single nonzero entry in a sparse finite-field matrix.",
"properties": {
"row": {
"minimum": 0,
"title": "Row",
"type": "integer"
},
"col": {
"minimum": 0,
"title": "Col",
"type": "integer"
},
"value": {
"title": "Value",
"type": "integer"
}
},
"required": [
"row",
"col",
"value"
],
"title": "SparseFFEntry",
"type": "object"
}
DenseFFMatrix¶
A matrix over F_p stored as a full list of rows.
JSON Schema
{
"description": "A matrix over F_p stored as a full list of rows.\n\nEach entry is an integer in ``[0, p-1]``.",
"properties": {
"format": {
"const": "dense_ff",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"p": {
"minimum": 2,
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols",
"p",
"entries"
],
"title": "DenseFFMatrix",
"type": "object"
}
SparseFFMatrix¶
A matrix over F_p stored as (row, col, value) triples.
JSON Schema
{
"$defs": {
"SparseFFEntry": {
"description": "A single nonzero entry in a sparse finite-field matrix.",
"properties": {
"row": {
"minimum": 0,
"title": "Row",
"type": "integer"
},
"col": {
"minimum": 0,
"title": "Col",
"type": "integer"
},
"value": {
"title": "Value",
"type": "integer"
}
},
"required": [
"row",
"col",
"value"
],
"title": "SparseFFEntry",
"type": "object"
}
},
"description": "A matrix over F_p stored as (row, col, value) triples.\n\nEntries not listed are implicitly zero. Listed entries must be nonzero\n(value in ``[1, p-1]``). Duplicate (row, col) pairs are not allowed.",
"properties": {
"format": {
"const": "sparse_ff",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"p": {
"minimum": 2,
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"$ref": "#/$defs/SparseFFEntry"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols",
"p"
],
"title": "SparseFFMatrix",
"type": "object"
}
DenseFFMatrixOut¶
A finite-field matrix returned as output (entries in [0, p-1]).
JSON Schema
{
"description": "A finite-field matrix returned as output (entries in [0, p-1]).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DenseFFMatrixOut",
"type": "object"
}
FFSNFResult¶
The Smith normal form of a matrix over F_p.
JSON Schema
{
"$defs": {
"DenseFFMatrixOut": {
"description": "A finite-field matrix returned as output (entries in [0, p-1]).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DenseFFMatrixOut",
"type": "object"
}
},
"description": "The Smith normal form of a matrix over F_p.\n\nOver a field, every nonzero element is a unit, so invariant factors are\neither 1 (nonzero) or 0. The SNF is ``diag(1, ..., 1, 0, ..., 0)``\nwhere the number of 1s equals the rank.\n\n``smith_normal_form`` has 1s at positions (0,0), ..., (r-1,r-1) and 0s\nelsewhere. ``rank`` gives r directly.",
"properties": {
"smith_normal_form": {
"$ref": "#/$defs/DenseFFMatrixOut"
},
"rank": {
"title": "Rank",
"type": "integer"
}
},
"required": [
"smith_normal_form",
"rank"
],
"title": "FFSNFResult",
"type": "object"
}
FFSNFWithTransformsResult¶
The SNF together with invertible left and right transforms over F_p.
JSON Schema
{
"$defs": {
"DenseFFMatrixOut": {
"description": "A finite-field matrix returned as output (entries in [0, p-1]).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DenseFFMatrixOut",
"type": "object"
}
},
"description": "The SNF together with invertible left and right transforms over F_p.\n\nSatisfies: ``left_transform @ M @ right_transform = smith_normal_form``.\nAll matrices have entries in ``[0, p-1]``.",
"properties": {
"smith_normal_form": {
"$ref": "#/$defs/DenseFFMatrixOut"
},
"rank": {
"title": "Rank",
"type": "integer"
},
"left_transform": {
"$ref": "#/$defs/DenseFFMatrixOut"
},
"right_transform": {
"$ref": "#/$defs/DenseFFMatrixOut"
}
},
"required": [
"smith_normal_form",
"rank",
"left_transform",
"right_transform"
],
"title": "FFSNFWithTransformsResult",
"type": "object"
}
FFHNFResult¶
Row Hermite Normal Form of a matrix over F_p.
JSON Schema
{
"$defs": {
"DenseFFMatrixOut": {
"description": "A finite-field matrix returned as output (entries in [0, p-1]).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DenseFFMatrixOut",
"type": "object"
}
},
"description": "Row Hermite Normal Form of a matrix over F_p.\n\nOver a field the HNF is the unique reduced row echelon form (RREF):\nupper-staircase structure with leading 1 in each nonzero row, and all\nother entries in each pivot column equal to 0.",
"properties": {
"hermite_normal_form": {
"$ref": "#/$defs/DenseFFMatrixOut"
}
},
"required": [
"hermite_normal_form"
],
"title": "FFHNFResult",
"type": "object"
}
FFHNFWithTransformResult¶
Row HNF together with the left invertible transform over F_p.
JSON Schema
{
"$defs": {
"DenseFFMatrixOut": {
"description": "A finite-field matrix returned as output (entries in [0, p-1]).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DenseFFMatrixOut",
"type": "object"
}
},
"description": "Row HNF together with the left invertible transform over F_p.\n\nSatisfies: ``left_transform @ M = hermite_normal_form``.",
"properties": {
"hermite_normal_form": {
"$ref": "#/$defs/DenseFFMatrixOut"
},
"left_transform": {
"$ref": "#/$defs/DenseFFMatrixOut"
}
},
"required": [
"hermite_normal_form",
"left_transform"
],
"title": "FFHNFWithTransformResult",
"type": "object"
}
FFRankResult¶
The rank of a matrix over F_p.
JSON Schema
Polynomial matrices (F_p[x])¶
SparsePolyEntry¶
A single nonzero entry in a sparse polynomial matrix.
JSON Schema
{
"description": "A single nonzero entry in a sparse polynomial matrix.",
"properties": {
"row": {
"minimum": 0,
"title": "Row",
"type": "integer"
},
"col": {
"minimum": 0,
"title": "Col",
"type": "integer"
},
"coeffs": {
"items": {
"type": "integer"
},
"title": "Coeffs",
"type": "array"
}
},
"required": [
"row",
"col",
"coeffs"
],
"title": "SparsePolyEntry",
"type": "object"
}
DensePolyMatrix¶
A matrix over F_p[x] stored as a full list of rows.
JSON Schema
{
"description": "A matrix over F_p[x] stored as a full list of rows.\n\nEach entry is a coefficient list ``[c_0, ..., c_d]`` with all\ncoefficients in ``[0, p-1]``. Trailing zeros are not allowed\n(use ``[]`` for the zero polynomial).",
"properties": {
"format": {
"const": "dense_poly",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"p": {
"minimum": 2,
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols",
"p",
"entries"
],
"title": "DensePolyMatrix",
"type": "object"
}
SparsePolyMatrix¶
A matrix over F_p[x] stored as (row, col, coeffs) triples.
JSON Schema
{
"$defs": {
"SparsePolyEntry": {
"description": "A single nonzero entry in a sparse polynomial matrix.",
"properties": {
"row": {
"minimum": 0,
"title": "Row",
"type": "integer"
},
"col": {
"minimum": 0,
"title": "Col",
"type": "integer"
},
"coeffs": {
"items": {
"type": "integer"
},
"title": "Coeffs",
"type": "array"
}
},
"required": [
"row",
"col",
"coeffs"
],
"title": "SparsePolyEntry",
"type": "object"
}
},
"description": "A matrix over F_p[x] stored as (row, col, coeffs) triples.\n\nEntries not listed are implicitly the zero polynomial.",
"properties": {
"format": {
"const": "sparse_poly",
"title": "Format",
"type": "string"
},
"nrows": {
"minimum": 0,
"title": "Nrows",
"type": "integer"
},
"ncols": {
"minimum": 0,
"title": "Ncols",
"type": "integer"
},
"p": {
"minimum": 2,
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"$ref": "#/$defs/SparsePolyEntry"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"format",
"nrows",
"ncols",
"p"
],
"title": "SparsePolyMatrix",
"type": "object"
}
DensePolyMatrixOut¶
A polynomial matrix returned as output (not validated for primality).
JSON Schema
{
"description": "A polynomial matrix returned as output (not validated for primality).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DensePolyMatrixOut",
"type": "object"
}
PolySNFResult¶
The Smith normal form of a polynomial matrix over F_p[x].
JSON Schema
{
"$defs": {
"DensePolyMatrixOut": {
"description": "A polynomial matrix returned as output (not validated for primality).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DensePolyMatrixOut",
"type": "object"
}
},
"description": "The Smith normal form of a polynomial matrix over F_p[x].\n\nInvariant factors are monic polynomials d_1 | d_2 | ... | d_r satisfying\nthe divisibility chain, sorted by degree (ascending) then lexicographically.\nThe SNF matrix has these on its diagonal; all other entries are zero.",
"properties": {
"smith_normal_form": {
"$ref": "#/$defs/DensePolyMatrixOut"
},
"invariant_factors": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Invariant Factors",
"type": "array"
}
},
"required": [
"smith_normal_form",
"invariant_factors"
],
"title": "PolySNFResult",
"type": "object"
}
PolySNFWithTransformsResult¶
SNF of a polynomial matrix together with invertible transforms.
JSON Schema
{
"$defs": {
"DensePolyMatrixOut": {
"description": "A polynomial matrix returned as output (not validated for primality).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DensePolyMatrixOut",
"type": "object"
}
},
"description": "SNF of a polynomial matrix together with invertible transforms.\n\nSatisfies: left_transform @ M @ right_transform = smith_normal_form.\nThe transforms are invertible matrices over F_p[x] (not necessarily\nunimodular in the polynomial sense, but with nonzero constant determinant).",
"properties": {
"smith_normal_form": {
"$ref": "#/$defs/DensePolyMatrixOut"
},
"invariant_factors": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Invariant Factors",
"type": "array"
},
"left_transform": {
"$ref": "#/$defs/DensePolyMatrixOut"
},
"right_transform": {
"$ref": "#/$defs/DensePolyMatrixOut"
}
},
"required": [
"smith_normal_form",
"invariant_factors",
"left_transform",
"right_transform"
],
"title": "PolySNFWithTransformsResult",
"type": "object"
}
PolyHNFResult¶
Row Hermite Normal Form of a polynomial matrix over F_p[x].
JSON Schema
{
"$defs": {
"DensePolyMatrixOut": {
"description": "A polynomial matrix returned as output (not validated for primality).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DensePolyMatrixOut",
"type": "object"
}
},
"description": "Row Hermite Normal Form of a polynomial matrix over F_p[x].\n\nThe HNF is the unique upper-triangular matrix H = U @ M where U is\ninvertible over F_p[x], the pivots are monic, and entries above each\npivot have strictly smaller degree than the pivot.",
"properties": {
"hermite_normal_form": {
"$ref": "#/$defs/DensePolyMatrixOut"
}
},
"required": [
"hermite_normal_form"
],
"title": "PolyHNFResult",
"type": "object"
}
PolyHNFWithTransformResult¶
Row HNF together with the left invertible transform.
JSON Schema
{
"$defs": {
"DensePolyMatrixOut": {
"description": "A polynomial matrix returned as output (not validated for primality).",
"properties": {
"nrows": {
"title": "Nrows",
"type": "integer"
},
"ncols": {
"title": "Ncols",
"type": "integer"
},
"p": {
"title": "P",
"type": "integer"
},
"entries": {
"items": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"type": "array"
},
"title": "Entries",
"type": "array"
}
},
"required": [
"nrows",
"ncols",
"p",
"entries"
],
"title": "DensePolyMatrixOut",
"type": "object"
}
},
"description": "Row HNF together with the left invertible transform.\n\nSatisfies: left_transform @ M = hermite_normal_form.",
"properties": {
"hermite_normal_form": {
"$ref": "#/$defs/DensePolyMatrixOut"
},
"left_transform": {
"$ref": "#/$defs/DensePolyMatrixOut"
}
},
"required": [
"hermite_normal_form",
"left_transform"
],
"title": "PolyHNFWithTransformResult",
"type": "object"
}
PolyElementaryDivisorsResult¶
Non-zero invariant factors (elementary divisors) of a polynomial matrix.
JSON Schema
{
"description": "Non-zero invariant factors (elementary divisors) of a polynomial matrix.\n\nThese are the same monic polynomials as the diagonal of the SNF,\nreturned in ascending-degree order.",
"properties": {
"elementary_divisors": {
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"title": "Elementary Divisors",
"type": "array"
}
},
"required": [
"elementary_divisors"
],
"title": "PolyElementaryDivisorsResult",
"type": "object"
}