code stringlengths 17 6.64M |
|---|
def solve_system_with_difficult_last_row(B, A):
'\n Solve the matrix equation B*Z = A when the last row of `B`\n contains huge entries.\n\n INPUT:\n\n - B -- a square n x n nonsingular matrix with painful big bottom row.\n - A -- an n x k matrix.\n\n OUTPUT:\n\n the unique solution to B*Z = A... |
def saturation(A, proof=True, p=0, max_dets=5):
'\n Compute a saturation matrix of A.\n\n INPUT:\n\n - A -- a matrix over ZZ\n - proof -- bool (default: True)\n - p -- int (default: 0); if not 0 only guarantees that output is\n p-saturated\n - max_dets -- int (default: 4) max number... |
def index_in_saturation(A, proof=True):
'\n The index of A in its saturation.\n\n INPUT:\n\n - ``A`` -- matrix over `\\ZZ`\n\n - ``proof`` -- boolean (``True`` or ``False``)\n\n OUTPUT:\n\n An integer\n\n EXAMPLES::\n\n sage: from sage.matrix.matrix_integer_dense_saturation import inde... |
def row_iterator(A):
for i in range(A.nrows()):
(yield A.row(i))
|
def prm_mul(p1, p2, mask_free, prec):
"\n Return the product of ``p1`` and ``p2``, putting free variables in\n ``mask_free`` to `1`.\n\n This function is mainly use as a subroutine of\n :func:`permanental_minor_polynomial`.\n\n INPUT:\n\n - `p1,p2` -- polynomials as dictionaries\n\n - ``mask_... |
def permanental_minor_polynomial(A, permanent_only=False, var='t', prec=None):
'\n Return the polynomial of the sums of permanental minors of ``A``.\n\n INPUT:\n\n - `A` -- a matrix\n\n - `permanent_only` -- if True, return only the permanent of `A`\n\n - `var` -- name of the polynomial variable\n\... |
def is_MatrixSpace(x):
'\n Return whether ``self`` is an instance of ``MatrixSpace``.\n\n EXAMPLES::\n\n sage: from sage.matrix.matrix_space import is_MatrixSpace\n sage: MS = MatrixSpace(QQ,2)\n sage: A = MS.random_element()\n sage: is_MatrixSpace(MS)\n True\n sage... |
def get_matrix_class(R, nrows, ncols, sparse, implementation):
"\n Return a matrix class according to the input.\n\n .. NOTE::\n\n This returns the base class without the category.\n\n INPUT:\n\n - ``R`` -- a base ring\n\n - ``nrows`` -- number of rows\n\n - ``ncols`` -- number of columns... |
class MatrixSpace(UniqueRepresentation, Parent):
"\n The space of matrices of given size and base ring\n\n EXAMPLES:\n\n Some examples of square 2 by 2 rational matrices::\n\n sage: MS = MatrixSpace(QQ, 2)\n sage: MS.dimension()\n 4\n sage: MS.dims()\n (2, 2)\n s... |
def dict_to_list(entries, nrows, ncols):
'\n Given a dictionary of coordinate tuples, return the list given by\n reading off the nrows\\*ncols matrix in row order.\n\n EXAMPLES::\n\n sage: from sage.matrix.matrix_space import dict_to_list\n sage: d = {}\n sage: d[(0,0)] = 1\n ... |
def _test_trivial_matrices_inverse(ring, sparse=True, implementation=None, checkrank=True):
"\n Tests inversion, determinant and is_invertible for trivial matrices.\n\n This function is a helper to check that the inversion of trivial matrices\n (of size 0x0, nx0, 0xn or 1x1) is handled consistently by th... |
def _MatrixSpace_ZZ_2x2():
from sage.rings.integer_ring import ZZ
return MatrixSpace(ZZ, 2)
|
class OperationTable(SageObject):
"\n An object that represents a binary operation as a table.\n\n Primarily this object is used to provide a\n :meth:`~sage.categories.magmas.Magmas.ParentMethods.multiplication_table`\n for objects in the category of magmas (monoids, groups, ...) and\n :meth:`~sage... |
def matrix_method(func=None, name=None):
"\n Allows a function to be tab-completed on the global matrix\n constructor object.\n\n INPUT:\n\n - ``*function`` -- a single argument. The function that is being\n decorated.\n\n - ``**kwds`` -- a single optional keyword argument\n ``name=<strin... |
@matrix_method
def column_matrix(*args, **kwds):
'\n Construct a matrix, and then swap rows for columns and columns for rows.\n\n .. note::\n\n Linear algebra in Sage favors rows over columns. So,\n generally, when creating a matrix, input vectors and lists are\n treated as rows. This... |
@matrix_method
def random_matrix(ring, nrows, ncols=None, algorithm='randomize', implementation=None, *args, **kwds):
'\n Return a random matrix with entries in a specified ring, and possibly with additional properties.\n\n INPUT:\n\n - ``ring`` -- base ring for entries of the matrix\n\n - ``nrows``... |
@matrix_method
def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
"\n Return a square matrix with specified diagonal entries, and zeros elsewhere.\n\n FORMATS:\n\n 1. diagonal_matrix(entries)\n\n 2. diagonal_matrix(nrows, entries)\n\n 3. diagonal_matrix(ring, entries)\n\n ... |
@matrix_method
def identity_matrix(ring, n=0, sparse=False):
'\n Return the `n \\times n` identity matrix over the given\n ring.\n\n The default ring is the integers.\n\n EXAMPLES::\n\n sage: M = identity_matrix(QQ, 2); M\n [1 0]\n [0 1]\n sage: M.parent()\n Full Mat... |
@matrix_method
def lehmer(ring, n=0):
'\n Return the `n \\times n` Lehmer matrix.\n\n The default ring is the rationals.\n\n Element `(i, j)` in the Lehmer matrix is\n `min(i, j)/max(i, j)`.\n\n See :wikipedia:`Lehmer_matrix`.\n\n EXAMPLES::\n\n sage: matrix.lehmer(3)\n [ 1 1/2 1/... |
@matrix_method
def zero_matrix(ring, nrows=None, ncols=None, sparse=False):
'\n Return the `nrows \\times ncols` zero matrix over the given\n ring.\n\n The default ring is the integers.\n\n EXAMPLES::\n\n sage: M = zero_matrix(QQ, 2); M\n [0 0]\n [0 0]\n sage: M.parent()\n ... |
@matrix_method
def ones_matrix(ring, nrows=None, ncols=None, sparse=False):
'\n Return a matrix with all entries equal to 1.\n\n CALL FORMATS:\n\n In each case, the optional keyword ``sparse`` can be used.\n\n 1. ones_matrix(ring, nrows, ncols)\n 2. ones_matrix(ring, nrows)\n 3. ones_matri... |
@matrix_method
def elementary_matrix(arg0, arg1=None, **kwds):
"\n Creates a square matrix that corresponds to a row operation or a column operation.\n\n FORMATS:\n\n In each case, ``R`` is the base ring, and is optional. ``n`` is the size\n of the square matrix created. Any call may include the ``sp... |
@matrix_method
def circulant(v, sparse=None):
'\n Return the circulant matrix specified by its 1st row `v`\n\n A circulant `n \\times n` matrix specified by the 1st row `v=(v_0...v_{n-1})` is\n the matrix `(c_{ij})_{0 \\leq i,j\\leq n-1}`, where `c_{ij}=v_{j-i \\mod b}`.\n\n INPUT:\n\n - ``v`` -- a... |
def _determine_block_matrix_grid(sub_matrices):
'\n For internal use. This tries to determine the dimensions\n of rows/columns when assembling the matrices in sub_matrices in a\n rectangular grid. It returns a pair of lists containing\n respectively the sizes of rows and columns.\n\n sub_matrices m... |
def _determine_block_matrix_rows(sub_matrices):
'\n For internal use. This tests if the matrices in sub_matrices\n fit in a rectangular matrix when assembled a row at a time.\n\n sub_matrices must be a list of lists of matrices.\n\n It returns a pair (row_heights, zero_widths, width) where\n row_he... |
@matrix_method
def block_matrix(*args, **kwds):
"\n Return a larger matrix made by concatenating submatrices\n (rows first, then columns). For example, the matrix\n\n ::\n\n [ A B ]\n [ C D ]\n\n is made up of submatrices A, B, C, and D.\n\n INPUT:\n\n The block_matrix command take... |
@matrix_method
def block_diagonal_matrix(*sub_matrices, **kwds):
'\n Create a block matrix whose diagonal block entries are given by\n sub_matrices, with zero elsewhere.\n\n See also :meth:`block_matrix`.\n\n EXAMPLES::\n\n sage: A = matrix(ZZ, 2, [1,2,3,4])\n sage: block_diagonal_matrix... |
@matrix_method
def jordan_block(eigenvalue, size, sparse=False):
"\n Return the Jordan block for the given eigenvalue with given size.\n\n INPUT:\n\n - ``eigenvalue`` -- eigenvalue for the diagonal entries of the block\n - ``size`` -- size of the square matrix\n - ``sparse`` -- (default: ``False... |
@matrix_method
def companion_matrix(poly, format='right'):
"\n Create a companion matrix from a monic polynomial.\n\n INPUT:\n\n - ``poly`` -- a univariate polynomial, or an iterable containing\n the coefficients of a polynomial, with low-degree coefficients first.\n The polynomial (or the poly... |
@matrix_method
def random_rref_matrix(parent, num_pivots):
"\n Generate a matrix in reduced row-echelon form with a specified number of non-zero rows.\n\n INPUT:\n\n - ``parent`` -- A matrix space specifying the base ring, dimensions and\n representation (dense/sparse) for the result. The base ring... |
@matrix_method
def random_echelonizable_matrix(parent, rank, upper_bound=None, max_tries=100):
"\n Generate a matrix of a desired size and rank, over a desired ring, whose reduced\n row-echelon form has only integral values.\n\n INPUT:\n\n - ``parent`` -- A matrix space specifying the base ring, dimen... |
@matrix_method
def random_subspaces_matrix(parent, rank=None):
"\n Create a matrix of the designated size and rank whose right and\n left null spaces, column space, and row space have desirable\n properties that simplify the subspaces.\n\n INPUT:\n\n - ``parent`` - A matrix space specifying the bas... |
@matrix_method
def random_unimodular_matrix(parent, upper_bound=None, max_tries=100):
"\n Generate a random unimodular (determinant 1) matrix of a desired size over a desired ring.\n\n INPUT:\n\n - ``parent`` - A matrix space specifying the base ring, dimensions\n and representation (dense/sparse) f... |
@matrix_method
def random_diagonalizable_matrix(parent, eigenvalues=None, dimensions=None):
"\n Create a random matrix that diagonalizes nicely.\n\n To be used as a teaching tool. Return matrices have only real\n eigenvalues.\n\n INPUT:\n\n If eigenvalues and dimensions are not specified in a list... |
@matrix_method
def vector_on_axis_rotation_matrix(v, i, ring=None):
"\n Return a rotation matrix `M` such that `det(M)=1` sending the vector\n `v` on the i-th axis so that all other coordinates of `Mv` are zero.\n\n .. NOTE::\n\n Such a matrix is not uniquely determined. This function returns one\... |
@matrix_method
def ith_to_zero_rotation_matrix(v, i, ring=None):
"\n Return a rotation matrix that sends the i-th coordinates of the\n vector v to zero by doing a rotation with the (i-1)-th coordinate.\n\n INPUT:\n\n - ``v`` -- vector\n - ``i`` -- integer\n - ``ring`` -- ring (optional, default:... |
@matrix_method
def hilbert(dim, ring=QQ):
'\n Return a Hilbert matrix of the given dimension.\n\n The `n` dimensional Hilbert matrix is a square matrix with entries being\n unit fractions,\n\n .. MATH::\n\n H_{ij} = \\frac{1}{i+j-1},\\qquad i, j = 1,\\ldots, n.\n\n For more information see t... |
@matrix_method
def vandermonde(v, ring=None):
"\n Return a Vandermonde matrix of the given vector.\n\n The `n` dimensional Vandermonde matrix is a square matrix with columns\n being the powers of a given vector `v`,\n\n .. MATH::\n\n V_{ij} = v_i^{j-1},\\qquad i, j = 1,\\ldots, n.\n\n For mo... |
@matrix_method
def toeplitz(c, r, ring=None):
'\n Return a Toeplitz matrix of given first column and first row.\n\n In a Toeplitz matrix, each descending diagonal from left to right is\n constant, such that:\n\n .. MATH:: T_{i,j} = T_{i+1, j+1}.\n\n For more information see the :wikipedia:`Toeplitz... |
@matrix_method
def hankel(c, r=None, ring=None):
"\n Return a Hankel matrix of given first column and whose elements are zero\n below the first anti-diagonal.\n\n The Hankel matrix is symmetric and constant across the anti-diagonals,\n with elements\n\n .. MATH::\n\n H_{ij} = v_{i+j-1},\\qqu... |
def _inplace_move_to_positive_pivot(G, row, col, B, pivot):
'\n Modify G so that v = G[row, col] appears at G[pivot, pivot+1].\n Modify B so that B * G * B.transpose() has the value v appearing\n at G[pivot, pivot+1].\n\n WARNING: not intended for external use!\n\n EXAMPLES::\n\n sage: from ... |
def symplectic_basis_over_field(M):
'\n Find a symplectic basis for an anti-symmetric, alternating matrix\n M defined over a field.\n\n Returns a pair (F, C) such that the rows of C form a symplectic\n basis for M and ``F = C * M * C.transpose()``.\n\n Anti-symmetric means that `M = -M^t`. Alterna... |
def _smallest_element_position_or_None(E, pivot):
'\n Return a tuple (row, col) such that E[row, col] is the smallest\n positive element of E, or None if E has no positive elements, and\n ``row >= pivot`` and ``col >= pivot``.\n\n WARNING: not intended for external use!\n\n EXAMPLES::\n\n sa... |
def symplectic_basis_over_ZZ(M):
'\n Find a symplectic basis for an anti-symmetric, alternating matrix\n M defined over the integers.\n\n Returns a pair (F, C) such that the rows of C form a symplectic\n basis for M and F = C * M * C.transpose().\n\n Anti-symmetric means that `M = -M^t`. Alternati... |
def Q6():
"\n Return the matroid `Q_6`, represented over `GF(4)`.\n\n The matroid `Q_6` is a 6-element matroid of rank-3.\n It is representable over a field if and only if that field has at least\n four elements. It is the unique relaxation of the rank-3 whirl.\n See [Oxl2011]_, p. 641.\n\n EXAM... |
def P6():
"\n Return the matroid `P_6`, represented as circuit closures.\n\n The matroid `P_6` is a 6-element matroid of rank-3.\n It is representable over a field if and only if that field has at least\n five elements.\n It is the unique relaxation of `Q_6`.\n It is an excluded minor for the cl... |
def R6():
'\n Return the matroid `R_6`, represented over `GF(3)`.\n\n The matroid `R_6` is a 6-element matroid of rank-3.\n It is representable over a field if and only if that field has at least\n three elements.\n It is isomorphic to the 2-sum of two copies of `U_{2, 4}`.\n See [Oxl2011]_, p. ... |
def Fano():
"\n Return the Fano matroid, represented over `GF(2)`.\n\n The Fano matroid, or Fano plane, or `F_7`, is a 7-element matroid of\n rank-3.\n It is representable over a field if and only if that field has\n characteristic two.\n It is also the projective plane of order two, i.e. `\\mat... |
def NonFano():
"\n Return the non-Fano matroid, represented over `GF(3)`\n\n The non-Fano matroid, or `F_7^-`, is a 7-element matroid of rank-3.\n It is representable over a field if and only if that field has\n characteristic other than two.\n It is the unique relaxation of `F_7`. See [Oxl2011]_, ... |
def O7():
"\n Return the matroid `O_7`, represented over `GF(3)`.\n\n The matroid `O_7` is a 7-element matroid of rank-3.\n It is representable over a field if and only if that field has at least\n three elements.\n It is obtained by freely adding a point to any line of `M(K_4)`.\n See [Oxl2011]... |
def P7():
'\n Return the matroid `P_7`, represented over `GF(3)`.\n\n The matroid `P_7` is a 7-element matroid of rank-3.\n It is representable over a field if and only if that field has at least\n 3 elements.\n It is one of two ternary 3-spikes, with the other being `F_7^-`.\n See [Oxl2011]_, p... |
def AG32prime():
"\n Return the matroid `AG(3, 2)'`, represented as circuit closures.\n\n The matroid `AG(3, 2)'` is a 8-element matroid of rank-4.\n It is a smallest non-representable matroid.\n It is the unique relaxation of `AG(3, 2)`. See [Oxl2011]_, p. 646.\n\n EXAMPLES::\n\n sage: from... |
def R8():
'\n Return the matroid `R_8`, represented over `GF(3)`.\n\n The matroid `R_8` is a 8-element matroid of rank-4.\n It is representable over a field if and only if the characteristic of that\n field is not two.\n It is the real affine cube. See [Oxl2011]_, p. 646.\n\n EXAMPLES::\n\n ... |
def F8():
"\n Return the matroid `F_8`, represented as circuit closures.\n\n The matroid `F_8` is a 8-element matroid of rank-4.\n It is a smallest non-representable matroid. See [Oxl2011]_, p. 647.\n\n EXAMPLES::\n\n sage: from sage.matroids.advanced import *\n sage: M = matroids.named_... |
def Q8():
"\n Return the matroid `Q_8`, represented as circuit closures.\n\n The matroid `Q_8` is a 8-element matroid of rank-4.\n It is a smallest non-representable matroid. See [Oxl2011]_, p. 647.\n\n EXAMPLES::\n\n sage: from sage.matroids.advanced import setprint\n sage: M = matroids... |
def L8():
"\n Return the matroid `L_8`, represented as circuit closures.\n\n The matroid `L_8` is a 8-element matroid of rank-4.\n It is representable over all fields with at least five elements.\n It is a cube, yet it is not a tipless spike. See [Oxl2011]_, p. 648.\n\n EXAMPLES::\n\n sage: ... |
def S8():
"\n Return the matroid `S_8`, represented over `GF(2)`.\n\n The matroid `S_8` is a 8-element matroid of rank-4.\n It is representable over a field if and only if that field has\n characteristic two.\n It is the unique deletion of a non-tip element from the binary 4-spike.\n See [Oxl201... |
def Vamos():
"\n Return the Vamos matroid, represented as circuit closures.\n\n The Vamos matroid, or Vamos cube, or `V_8` is a 8-element matroid of\n rank-4.\n It violates Ingleton's condition for representability over a division\n ring.\n It is not algebraic. See [Oxl2011]_, p. 649.\n\n EXA... |
def T8():
"\n Return the matroid `T_8`, represented over `GF(3)`.\n\n The matroid `T_8` is a 8-element matroid of rank-4.\n It is representable over a field if and only if that field has\n characteristic three.\n It is an excluded minor for the dyadic matroids. See [Oxl2011]_, p. 649.\n\n EXAMPL... |
def J():
"\n Return the matroid `J`, represented over `GF(3)`.\n\n The matroid `J` is a 8-element matroid of rank-4.\n It is representable over a field if and only if that field has at least\n three elements. See [Oxl2011]_, p. 650.\n\n EXAMPLES::\n\n sage: from sage.matroids.advanced import... |
def P8():
"\n Return the matroid `P_8`, represented over `GF(3)`.\n\n The matroid `P_8` is a 8-element matroid of rank-4.\n It is uniquely representable over all fields of characteristic other than\n two.\n It is an excluded minor for all fields of characteristic two with four or\n more elements... |
def P8pp():
"\n Return the matroid `P_8^=`, represented as circuit closures.\n\n The matroid `P_8^=` is a 8-element matroid of rank-4.\n It can be obtained from `P_8` by relaxing the unique pair of disjoint\n circuit-hyperplanes.\n It is an excluded minor for `GF(4)`-representability.\n It is re... |
def K33dual():
'\n Return the matroid `M*(K_{3, 3})`, represented over the regular partial\n field.\n\n The matroid `M*(K_{3, 3})` is a 9-element matroid of rank-4.\n It is an excluded minor for the class of graphic matroids.\n It is the graft matroid of the 4-wheel with every vertex except the hub... |
def TernaryDowling3():
"\n Return the matroid `Q_3(GF(3)^\times)`, represented over `GF(3)`.\n\n The matroid `Q_3(GF(3)^\times)` is a 9-element matroid of rank-3.\n It is the rank-3 ternary Dowling geometry.\n It is representable over a field if and only if that field does not have\n characteristic... |
def CompleteGraphic(n):
'\n Return the cycle matroid of the complete graph on `n` vertices.\n\n INPUT:\n\n - ``n`` -- an integer, the number of vertices of the underlying complete\n graph.\n\n OUTPUT:\n\n The graphic matroid associated with the `n`-vertex complete graph.\n This matroid has ... |
def Wheel(n, field=None, ring=None):
'\n Return the rank-`n` wheel.\n\n INPUT:\n\n - ``n`` -- a positive integer. The rank of the desired matroid.\n - ``ring`` -- any ring. If provided, output will be a linear matroid\n over the ring or field ``ring``. If the ring is `\\ZZ`, then output\n wi... |
def Whirl(n):
'\n Return the rank-`n` whirl.\n\n INPUT:\n\n - ``n`` -- a positive integer. The rank of the desired matroid.\n\n OUTPUT:\n\n The rank-`n` whirl matroid, represented as a ternary matroid.\n\n The whirl is the unique relaxation of the wheel. See [Oxl2011]_, p. 659.\n\n EXAMPLES::... |
def Uniform(r, n):
'\n Return the uniform matroid of rank `r` on `n` elements.\n\n INPUT:\n\n - ``r`` -- a nonnegative integer. The rank of the uniform matroid.\n - ``n`` -- a nonnegative integer. The number of elements of the uniform\n matroid.\n\n OUTPUT:\n\n The uniform matroid `U_{r,n}`... |
def PG(n, q, x=None):
"\n Return the projective geometry of dimension ``n`` over the finite field\n of order ``q``.\n\n INPUT:\n\n - ``n`` -- a positive integer. The dimension of the projective space. This\n is one less than the rank of the resulting matroid.\n - ``q`` -- a positive integer th... |
def AG(n, q, x=None):
"\n Return the affine geometry of dimension ``n`` over the finite field of\n order ``q``.\n\n INPUT:\n\n - ``n`` -- a positive integer. The dimension of the projective space. This\n is one less than the rank of the resulting matroid.\n - ``q`` -- a positive integer that i... |
def R10():
'\n Return the matroid `R_{10}`, represented over the regular partial field.\n\n The matroid `R_{10}` is a 10-element regular matroid of rank-5.\n It is the unique splitter for the class of regular matroids.\n It is the graft matroid of `K_{3, 3}` in which every vertex is coloured.\n See... |
def R12():
'\n Return the matroid `R_{12}`, represented over the regular partial field.\n\n The matroid `R_{12}` is a 12-element regular matroid of rank-6.\n It induces a 3-separation in its 3-connected majors within the class of\n regular matroids.\n An excluded minor for the class of graphic or c... |
def NonVamos():
"\n Return the non-Vamos matroid.\n\n The non-Vamos matroid, or `V_8^+` is an 8-element matroid of rank 4. It is\n a tightening of the Vamos matroid. It is representable over some field.\n See [Oxl2011]_, p. 72, 84.\n\n EXAMPLES::\n\n sage: from sage.matroids.advanced import ... |
def Pappus():
"\n Return the Pappus matroid.\n\n The Pappus matroid is a 9-element matroid of rank-3.\n It is representable over a field if and only if that field either has 4\n elements or more than 7 elements.\n It is an excluded minor for the class of GF(5)-representable matroids.\n See [Oxl2... |
def NonPappus():
"\n Return the non-Pappus matroid.\n\n The non-Pappus matroid is a 9-element matroid of rank-3.\n It is not representable over any commutative field.\n It is the unique relaxation of the Pappus matroid. See [Oxl2011]_, p. 655.\n\n EXAMPLES::\n\n sage: from sage.matroids.adva... |
def TicTacToe():
'\n Return the TicTacToe matroid.\n\n The dual of the TicTacToe matroid is not algebraic; it is unknown whether\n the TicTacToe matroid itself is algebraic. See [Hoc]_.\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.TicTacToe()\n sage: M.is_valid() # long time\n ... |
def Q10():
"\n Return the matroid `Q_{10}`, represented over `\\GF{4}`.\n\n `Q_{10}` is a 10-element, rank-5, self-dual matroid. It is representable\n over `\\GF{3}` and `\\GF{4}`, and hence is a sixth-roots-of-unity matroid.\n `Q_{10}` is a splitter for the class of sixth-root-of-unity matroids.\n\n ... |
def N1():
'\n Return the matroid `N_1`, represented over `\\GF{3}`.\n\n `N_1` is an excluded minor for the dyadic matroids. See [Oxl2011]_, p. 554.\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.N1()\n sage: M.is_field_isomorphic(M.dual())\n True\n sage: M.is_valid()\n ... |
def N2():
'\n Return the matroid `N_2`, represented over `\\GF{3}`.\n\n `N_2` is an excluded minor for the dyadic matroids. See [Oxl2011]_, p. 554.\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.N2()\n sage: M.is_field_isomorphic(M.dual())\n True\n sage: M.is_valid()\n ... |
def BetsyRoss():
'\n Return the Betsy Ross matroid, represented by circuit closures.\n\n An extremal golden-mean matroid.\n That is, if `M` is simple, rank 3, has the Betsy Ross matroid as a\n restriction and is a Golden Mean matroid, then `M` is the Betsy Ross\n matroid.\n\n EXAMPLES::\n\n ... |
def Block_9_4():
'\n Return the paving matroid whose non-spanning circuits form the blocks of a\n `2-(9, 4, 3)` design.\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.Block_9_4()\n sage: M.is_valid() # long time\n True\n sage: BD = BlockDesign(M.groundset(), M.nonspannin... |
def Block_10_5():
'\n Return the paving matroid whose non-spanning circuits form the blocks of a\n `3-(10, 5, 3)` design.\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.Block_10_5()\n sage: M.is_valid() # long time\n True\n sage: BD = BlockDesign(M.groundset(), M.nonspan... |
def ExtendedBinaryGolayCode():
'\n Return the matroid of the extended binary Golay code.\n\n See\n :class:`GolayCode <sage.coding.golay_code.GolayCode>`\n documentation for more on this code.\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.ExtendedBinaryGolayCode()\n sage: C = Li... |
def ExtendedTernaryGolayCode():
'\n Return the matroid of the extended ternary Golay code.\n\n See\n :class:`GolayCode <sage.coding.golay_code.GolayCode>`\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.ExtendedTernaryGolayCode()\n sage: C = LinearCode(M.representation())\n s... |
def AG23minus():
'\n Return the ternary affine plane minus a point.\n\n This is a sixth-roots-of-unity matroid, and an excluded minor for the\n class of near-regular matroids.\n See [Oxl2011]_, p. 653.\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.AG23minus()\n sage: M.is_valid... |
def NotP8():
'\n Return the matroid ``NotP8``.\n\n This is a matroid that is not `P_8`, found on page 512 of [Oxl1992]_ (the\n first edition).\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.P8()\n sage: N = matroids.named_matroids.NotP8()\n sage: M.is_isomorphic(N)\n ... |
def D16():
'\n Return the matroid `D_{16}`.\n\n Let `M` be a 4-connected binary matroid and `N` an internally 4-connected\n proper minor of `M` with at least 7 elements. Then some element of `M` can\n be deleted or contracted preserving an `N`-minor, unless `M` is `D_{16}`.\n See [CMO2012]_.\n\n ... |
def Terrahawk():
'\n Return the Terrahawk matroid.\n\n The Terrahawk is a binary matroid that is a sporadic exception in a chain\n theorem for internally 4-connected binary matroids. See [CMO2011]_.\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.Terrahawk()\n sage: M\n Terra... |
def R9A():
'\n Return the matroid `R_9^A`.\n\n The matroid `R_9^A` is not representable over any field, yet none of the\n cross-ratios in its Tuttegroup equal 1. It is one of the 4 matroids on at\n most 9 elements with this property, the others being `{R_9^A}^*`, `R_9^B`\n and `{R_9^B}^*`.\n\n E... |
def R9B():
'\n Return the matroid `R_9^B`.\n\n The matroid `R_9^B` is not representable over any field, yet none of the\n cross-ratios in its Tuttegroup equal 1.\n It is one of the 4 matroids on at most 9 elements with this property, the\n others being `{R_9^B}^*`, `R_9^A` and `{R_9^A}^*`.\n\n E... |
def T12():
'\n Return the matroid `T_{12}`.\n\n The edges of the Petersen graph can be labeled by the 4-circuits of\n `T_{12}` so that two edges are adjacent if and only if the corresponding\n 4-circuits overlap in exactly two elements.\n Relaxing a circuit-hyperplane yields an excluded minor for t... |
def P9():
'\n Return the matroid `P_9`.\n\n This is the matroid referred to as `P_9` by Oxley in his paper "The binary\n matroids with no 4-wheel minor"\n\n EXAMPLES::\n\n sage: M = matroids.named_matroids.P9()\n sage: M\n P9: Binary matroid of rank 4 on 9 elements, type (1, 1)\n ... |
def Matroid(groundset=None, data=None, **kwds):
'\n Construct a matroid.\n\n Matroids are combinatorial structures that capture the abstract properties\n of (linear/algebraic/...) dependence. Formally, a matroid is a pair\n `M = (E, I)` of a finite set `E`, the *groundset*, and a collection of\n su... |
class DualMatroid(Matroid):
"\n Dual of a matroid.\n\n For some matroid representations it can be computationally expensive to\n derive an explicit representation of the dual. This class wraps around any\n matroid to provide an abstract dual. It also serves as default\n implementation.\n\n INPUT... |
class GraphicMatroid(Matroid):
'\n The graphic matroid class.\n\n INPUT:\n\n - ``G`` -- a Graph\n - ``groundset`` -- (optional) a list in 1-1 correspondence with\n ``G.edge_iterator()``\n\n OUTPUT:\n\n A ``GraphicMatroid`` instance where the ground set elements are\n the edges of ``G``.\... |
def it(M, B1, nB1, lps):
'\n Return points on and off the triangle and lines to be drawn for a rank 3\n matroid.\n\n INPUT:\n\n - ``M`` -- A matroid.\n - ``B1``-- A list of groundset elements of ``M`` that corresponds to a\n basis of matroid ``M``.\n - ``nB1``-- A list of elements in the gr... |
def trigrid(tripts):
'\n Return a grid of 4 points inside given 3 points as a list.\n\n INPUT:\n\n - ``tripts`` -- A list of 3 lists of the form [x,y] where x and y are the\n Cartesian coordinates of a point.\n\n OUTPUT:\n\n A list of lists containing 4 points in following order:\n\n - 1. B... |
def addnontripts(tripts_labels, nontripts_labels, ptsdict):
"\n Return modified ``ptsdict`` with additional keys and values corresponding\n to ``nontripts``.\n\n INPUT:\n\n - ``tripts`` -- A list of 3 ground set elements that are to be placed on\n vertices of the triangle.\n - ``ptsdict`` -- A... |
def createline(ptsdict, ll, lineorders2=None):
"\n Return ordered lists of coordinates of points to be traversed to draw a\n 2D line.\n\n INPUT:\n\n - ``ptsdict`` -- A dictionary containing keys and their (x,y) position as\n values.\n - ``ll`` -- A list of keys in ``ptsdict`` through which a l... |
def slp(M1, pos_dict=None, B=None):
'\n Return simple matroid, loops and parallel elements of given matroid.\n\n INPUT:\n\n - ``M1`` -- A matroid.\n - ``pos_dict`` -- (optional) A dictionary containing non loopy elements of\n ``M`` as keys and their (x,y) positions.\n as keys. While simplify... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.