{ "info": { "author": "Roberto Pagaria, Giovanni Paolini", "author_email": "giovanni.paolini@sns.it", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development :: Build Tools" ], "description": "# Arithmat\nSage implementation of arithmetic matroids and toric arrangements.\n\nAuthors: Roberto Pagaria and Giovanni Paolini\n\n* [Requirements](#requirements)\n* [Installation](#installation)\n* [Overview](#overview)\n* [Citing Arithmat](#citing-arithmat)\n* [Documentation](#documentation)\n + [Import](#import)\n + [Available classes for arithmetic matroids](#available-classes-for-arithmetic-matroids)\n + [Available methods](#available-methods)\n* [Bibliography](#bibliography)\n* [License](#license)\n\n\n## Requirements\n\n* [Python](https://www.python.org/) 2.7\n* [Sage](http://www.sagemath.org/) >= 8\n\n\n## Installation\n\n### From PyPI\n\nThe easiest way to start using Arithmat is to install [the latest release from PyPI](https://pypi.org/project/arithmat/).\nType the following command:\n\n```bash\nsage -pip install --upgrade arithmat\n```\n\n### From source\n\nDownload the source from the git repository:\n\n```bash\ngit clone https://github.com/giove91/arithmat.git\n```\n\nChange to the root directory and run:\n\n```bash\nsage -pip install --upgrade --no-index -v .\n```\n\n\n## Overview\n\nArithmat is a Sage package that implements arithmetic matroids and toric arrangements.\n\nAt its core there is the class `ArithmeticMatroidMixin`, which is intended to be used in combination with [any existing matroid class of Sage](http://doc.sagemath.org/html/en/reference/matroids/index.html) (e.g. `RankMatroid`, `BasisMatroid`, `LinearMatroid`) via multiple inheritance.\nThe most common combinations are already defined: `ArithmeticMatroid` (deriving from `RankMatroid`), `BasisArithmeticMatroid` (deriving from `BasisMatroid`), and `LinearArithmeticMatroid` (deriving from `LinearMatroid`).\n\nAn additional class `ToricArithmeticMatroid` is implemented, for arithmetic matroids constructed from a fixed given representation.\n\n\n## Citing Arithmat\n\nTo cite Arithmat, you can use (some variant of) the following BibTeX code:\n\n```latex\n@Misc{arithmat,\n author = {Pagaria, Roberto and Paolini, Giovanni},\n title = {{Arithmat}: {Sage} implementation of arithmetic matroids and toric arrangements},\n year = {2019},\n url = \"https://github.com/giove91/arithmat\",\n}\n```\n\n## Documentation\n\n### Import\n\nAll defined classes and functions can be imported at once:\n\n```sage\nfrom arithmat import *\n```\n\nAlternatively, it is possible to import only specific classes and/or functions. For example:\n\n```sage\nfrom arithmat import ArithmeticMatroid, ToricArithmeticMatroid\n```\n\n\n### Available classes for arithmetic matroids\n\nAll classes for arithmetic matroids derive from `ArithmeticMatroidMixin` and from some subclass of Sage's `Matroid`.\nThe class `ArithmeticMatroidMixin` is not intended to be used by itself, but it is possible to subclass it in order to create new classes for arithmetic matroids.\n\nThe classes which are already provided in `arithmat` are the following.\n\n* `ArithmeticMatroid(groundset, rank_function, multiplicity_function)`\n\n This is the simplest arithmetic matroid class, and derives from `ArithmeticMatroidMixin` and `RankMatroid`.\n\n ```sage\n E = [1,2,3,4,5]\n\n def rk(X):\n return min(2, len(X))\n\n def m(X):\n if len(X) == 2 and all(x in [3,4,5] for x in X):\n return 2\n else:\n return 1\n\n M = ArithmeticMatroid(E, rk, m)\n print M\n # Arithmetic matroid of rank 2 on 5 elements\n\n print M.arithmetic_tutte_polynomial()\n # y^3 + x^2 + 2*y^2 + 3*x + 3*y + 3\n\n print M.representation()\n # None (this arithmetic matroid is not representable)\n ```\n* `ToricArithmeticMatroid(arrangement_matrix, torus_matrix=None, ordered_groundset=None)`\n\n Arithmetic matroid associated with a given toric arrangement. This class derives from `ArithmeticMatroidMixin` and `Matroid`.\n\n The constructor requires an integer matrix `arrangement_matrix` representing the toric arrangement. Optionally it accepts another integer matrix `torus_matrix` (whose cokernel describes the ambient torus, and defaults to `matrix(ZZ, arrangement_matrix.nrows(), 0)`) and/or an ordered copy `ordered_groundset` of the groundset (defaults to `range(matrix.ncols())`). The number of rows of `arrangement_matrix` must be equal to the numer of rows of `torus_matrix`.\n\n The two matrices are not guaranteed to remain unchanged: internally,`torus_matrix` is kept in Smith normal form (this also affects `arrangement_matrix`).\n\n ```sage\n A = matrix(ZZ, [[-1, 1, 0, 2], [3, 1, -1, -2]])\n M = ToricArithmeticMatroid(A)\n\n print M\n # Toric arithmetic matroid of rank 2 on 4 elements\n\n print M.arrangement_matrix()\n # [-1 1 0 2]\n # [ 3 1 -1 -2]\n\n print M.torus_matrix()\n # []\n\n P = M.poset_of_layers()\n print P\n # Finite poset containing 11 elements\n\n P.show(label_elements=False)\n ```\n \n\n ```sage\n A = matrix(ZZ, [[-1, 1, 0, 2], [3, 1, -1, -2]])\n Q = matrix(ZZ, [[5], [1]])\n N = ToricArithmeticMatroid(A, Q)\n\n print N\n # Toric arithmetic matroid of rank 1 on 4 elements\n\n print N.arrangement_matrix()\n # [-16 -4 5 12]\n\n print N.torus_matrix()\n # []\n\n ```\n\nThe classes `BasisArithmeticMatroid` and `LinearArithmeticMatroid` derive from the Sage classes `BasisMatroid` and `LinearMatroid`, respectively.\nAn instance of `XxxArithmeticMatroid` can be constructed with `XxxArithmeticMatroid(..., multiplicity_function=m)`, where `...` should be replaced by arguments to construct an instance of `XxxMatroid`, and `m` is the multiplicity function.\nThe multiplicity function needs to be passed as a keyword argument (and not as a positional argument).\n\n* `BasisArithmeticMatroid(M=None, groundset=None, bases=None, ..., multiplicity_function)`\n\n ```sage\n def m(X):\n if len(X) == 2 and all(x in ['b','c','d'] for x in X):\n return 2\n else:\n return 1\n\n M = BasisArithmeticMatroid(groundset='abcd', bases=['ab', 'ac', 'ad', 'bc', 'bd', 'cd'], multiplicity_function=m)\n\n print M\n # Basis arithmetic matroid of rank 2 on 4 elements\n\n print M.is_valid()\n # True\n ```\n\n It is possible to cast any arithmetic matroid to a `BasisArithmeticMatroid`:\n\n ```sage\n M1 = ToricArithmeticMatroid(matrix(ZZ, [[-1, 1, 0, 7], [6, 1, -1, -2]]))\n M2 = BasisArithmeticMatroid(M1)\n\n print M1\n # Toric arithmetic matroid of rank 2 on 4 elements\n\n print M2\n # Basis arithmetic matroid of rank 2 on 4 elements\n\n print M2.full_multiplicity() == M1.full_multiplicity()\n # True\n ```\n\n* `LinearArithmeticMatroid(matrix=None, groundset=None, ..., multiplicity_function)`\n\n ```sage\n A = matrix(GF(2), [[1, 0, 0, 1, 1], [0, 1, 0, 1, 0], [0, 0, 1, 0, 1]])\n\n def m(X):\n return 1\n\n M = LinearArithmeticMatroid(A, multiplicity_function=m)\n\n print M\n # Linear arithmetic matroid of rank 3 on 5 elements\n\n print M.is_valid()\n # True\n ```\n\nFinally, `MinorArithmeticMatroid` and `DualArithmeticMatroid` are the analogs of `MinorMatroid` and `DualMatroid`.\nThey are used when calling `contract(X)`, `delete(X)`, `dual()` (see below).\n\n\n### Available methods\n\nAll classes for arithmetic matroids must also derive from some subclass of Sage's `Matroid`.\nIn particular, `Matroid` methods are still available. For example:\n```sage\nM = ToricArithmeticMatroid(matrix(ZZ, [[1,2,3], [0,1, 1]]))\nprint list(M.bases())\n# [frozenset([0, 1]), frozenset([0, 2]), frozenset([1, 2])]\n```\n\nAll subclasses of `ArithmeticMatroidMixin` also (re-)implement the following methods.\n\n* `multiplicity(X)`\n Return the multiplicity of the set `X`.\n\n* `full_multiplicity()`\n Return the multiplicity of the groundset.\n\n* `is_valid()`\n Check if the arithmetic matroid axioms are satisfied.\n This method overwrites `Matroid.is_valid`.\n\n* `is_torsion_free()`\n Check if the matroid is torsion-free, i.e. the multiplicity of the empty set is equal to 1.\n\n* `is_surjective()`\n Check if the matroid is surjective, i.e. the multiplicity of the groundset is equal to 1.\n\n* `is_gcd()`\n Check if the matroid satisfies the gcd property, defined in [DM13, Section 3].\n\n* `is_strong_gcd()`\n Check if the matroid satisfies the strong gcd property, defined in [PP19, Section 3].\n\n* `is_isomorphic(other, morphism)`\n Check if the two arithmetic matroids are isomorphic.\n This method overwrites `Matroid.is_isomorphic`.\n\n* `is_isomorphism(other, morphism)`\n Check if the given morphism of groundsets is an isomorphism of arithmetic matroids.\n It works also when comparing instances of different subclasses of `ArithmeticMatroid`.\n This method overwrites `Matroid.is_isomorphism`.\n\n* `contract(X)`\n Contract elements.\n This method overwrites `Matroid.contract`.\n\n* `delete(X)`\n Delete elements.\n This method overwrites `Matroid.delete`.\n\n* `minor(contractions=None, deletions=None)`\n Contract some elements and delete some other elements.\n This method overwrites `Matroid.minor`.\n\n* `dual()`\n Return the dual of the matroid.\n This method overwrites `Matroid.dual`.\n\n* `arithmetic_tutte_polynomial(x=None, y=None)`\n Return the arithmetic Tutte polynomial of the matroid.\n\n* `reduction()`\n Return the reduction of the matroid, defined in [PP19, Section 4].\n\n* `check_representation(A, ordered_groundset=None)`\n Check if the given integer matrix `A` is a representation of the matroid.\n The optional parameter `ordered_groundset` specifies the bijection between the columns of the matrix and the groundset.\n\n* `all_representations(ordered_groundset=None)`\n Generator of all non-equivalent essential representations of the matroid, computed using the algorithm of [PP19, Section 5].\n\n* `num_representations()`\n Return the number of non-equivalent essential representations of the matroid.\n This calls `all_representations()`.\n\n* `representation(ordered_groundset=None)`\n Return any essential representation of the matroid, or `None` if the matroid is not representable.\n\n* `is_representable()`\n Check if the matroid is representable.\n This calls `representation()`.\n\n* `is_orientable()`\n Check if the matroid is orientable as an arithmetic matroid, as defined in [Pag18].\n\nIn addition, `ToricArithmeticMatroid` has the following methods.\n\n* `ordered_groundset()`\n Return the groundset as a list, in the same order as the columns of the matrix of the defining toric arrangement.\n\n* `arrangement_matrix()`\n Return the matrix of the defining toric arrangement.\n\n* `torus_matrix()`\n Return the matrix describing the ambient torus.\n\n* `poset_of_layers()`\n Return the poset of layers of the toric arrangement, computed using Lenz's algorithm [Len17a].\n\n* `arithmetic_independence_poset()`\n Return the arithmetic independence poset of the toric arrangement, defined in [Len17b, Definition 5], [Mar18, Definitions 2.1 and 2.2], [DD18, Section 7].\n Notice that it is not the same as the independence poset of the underlying matroid.\n\n* `decomposition()`\n Return the partition of the groundset corresponding to the decomposition of the matroid as a direct sum of indecomposable matroids.\n Uses the algorithm of [PP19, Section 7].\n\n* `is_decomposable()`\n Check if the matroid is decomposable.\n\n* `is_indecomposable()`\n Check if the matroid is not decomposable.\n\n* `is_equivalent(other, morphism=None)`\n Check if the two ToricArithmeticMatroids are equivalent (i.e. the defining representations are equivalent; see [PP19, Section 2]).\n If the morphism is not given, the two ordered groundsets are assumed to be the same.\n\nThe following function is available outside of arithmetic matroid classes.\n\n* `signed_hermite_normal_form(A)`\n Return the signed Hermite normal form of the integer matrix `A`, defined in [PP19, Section 6].\n ```sage\n from arithmat import signed_hermite_normal_form\n\n print signed_hermite_normal_form(matrix([[3, 2, 1], [-1, 1, 3]]))\n # [ 1 1 -3]\n # [ 0 5 -10]\n ```\n\nMore examples can be found in the [test file](https://github.com/giove91/arithmat/blob/master/arithmat/test.sage).\n\n\n## Bibliography\n\n[BM14] P. Br\u00e4nd\u00e9n and L. Moci, *The multivariate arithmetic Tutte polynomial*, Transactions of the American Mathematical Society **366** (2014), no. 10, 5523-5540.\n\n[DM13] M. D'Adderio and L. Moci, *Arithmetic matroids, the Tutte polynomial and toric arrangements*, Advances in Mathematics **232** (2013), 335-367.\n\n[DD18] A. D'Al\u00ec and E. Delucchi, *Stanley-Reisner rings for symmetric simplicial complexes, G-semimatroids and Abelian arrangements*, ArXiv preprint 1804.07366 (2018).\n\n[DGP17] E. Delucchi, N. Girard, and G. Paolini, *Shellability of posets of labeled partitions and arrangements defined by root systems*, ArXiv preprint 1706.06360 (2017).\n\n[Len17a] M. Lenz, *Computing the poset of layers of a toric arrangement*, ArXiv preprint 1708.06646 (2017).\n\n[Len17b] M. Lenz, *Stanley-Reisner rings for quasi-arithmetic matroids*, ArXiv preprint 1709.03834 (2017).\n\n[Len19] M. Lenz, *Representations of weakly multiplicative arithmetic matroids are unique*, Annals of Combinatorics **23** (2019), no. 2, 335-346.\n\n[Mar18] I. Martino, *Face module for realizable Z-matroids*, Contributions to Discrete Mathematics **13** (2018).\n\n[Pag17] R. Pagaria, *Combinatorics of Toric Arrangements*, ArXiv preprint 1710.00409 (2017).\n\n[Pag18] R. Pagaria, *Orientable arithmetic matroids*, ArXiv preprint 1805.11888 (2018).\n\n[Pag19] R. Pagaria, *Two Examples of Toric Arrangements*, Journal of Combinatorial Theory, Series A **167** (2019), 389-402.\n\n[PP19] R. Pagaria and G. Paolini, *Representations of torsion-free arithmetic matroids*, ArXiv preprint 1908.04137 (2019).\n\n\n## License\n\nThis project is licensed under the [GNU General Public License v3.0](LICENSE.md).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/giove91/arithmat", "keywords": "SageMath packaging", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "arithmat", "package_url": "https://pypi.org/project/arithmat/", "platform": "", "project_url": "https://pypi.org/project/arithmat/", "project_urls": { "Homepage": "https://github.com/giove91/arithmat", "Source": "https://github.com/giove91/arithmat", "Tracker": "https://github.com/giove91/arithmat/issues" }, "release_url": "https://pypi.org/project/arithmat/1.0.1/", "requires_dist": [ "sage-package", "networkx (~=2.2)" ], "requires_python": ">=2.7, <3", "summary": "Sage implementation of arithmetic matroids and toric arrangements", "version": "1.0.1" }, "last_serial": 5686555, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "2814b0afedbd1097c1068c501e702d17", "sha256": "7035dfe850d27f0c2d4c36bca8ae6e1c9bd4bbc5a93f50b31c59a25cf3e379d6" }, "downloads": -1, "filename": "arithmat-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "2814b0afedbd1097c1068c501e702d17", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, <3", "size": 34252, "upload_time": "2019-07-23T16:55:37", "url": "https://files.pythonhosted.org/packages/37/19/b22d7664534e570f6afb4c215f5ec71a8a93525a5dc70926e4eb54333e43/arithmat-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "39807f17ce09e2239ef189ab69b8b362", "sha256": "dcab204310b0d7710f8e4f9a0e81211440d52c031f49360ebf4ec8ffe2d18c77" }, "downloads": -1, "filename": "arithmat-1.0.0.tar.gz", "has_sig": false, "md5_digest": "39807f17ce09e2239ef189ab69b8b362", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, <3", "size": 25131, "upload_time": "2019-07-23T16:55:40", "url": "https://files.pythonhosted.org/packages/98/85/904c0adca57c0a9818d3af52ae2ee2ffca2ebd2fe6d56a73e3c2e8f996d9/arithmat-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "c92d79fcc8a0973ff22a73eecd3632ec", "sha256": "4f42e631502d59e306a95bee497c2ed454890b57bdeee0cc2f4b68a6bcb3c313" }, "downloads": -1, "filename": "arithmat-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "c92d79fcc8a0973ff22a73eecd3632ec", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, <3", "size": 34850, "upload_time": "2019-08-16T08:44:35", "url": "https://files.pythonhosted.org/packages/30/cc/516e961cd3afdeaa5357e8d43df7413f65aa4ea5c246c193e198ed7f071b/arithmat-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6360fd39bc929429e56eab4d4e6e71ae", "sha256": "9fef6776eddb0e1982880d613ec5f224cf66e20aba52d80c4fc02fff6c58796f" }, "downloads": -1, "filename": "arithmat-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6360fd39bc929429e56eab4d4e6e71ae", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, <3", "size": 93799, "upload_time": "2019-08-16T08:44:38", "url": "https://files.pythonhosted.org/packages/5d/4b/05256ad2f855a134ae5ac4347297558b237afe87f9e7da1ae08a373910da/arithmat-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c92d79fcc8a0973ff22a73eecd3632ec", "sha256": "4f42e631502d59e306a95bee497c2ed454890b57bdeee0cc2f4b68a6bcb3c313" }, "downloads": -1, "filename": "arithmat-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "c92d79fcc8a0973ff22a73eecd3632ec", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, <3", "size": 34850, "upload_time": "2019-08-16T08:44:35", "url": "https://files.pythonhosted.org/packages/30/cc/516e961cd3afdeaa5357e8d43df7413f65aa4ea5c246c193e198ed7f071b/arithmat-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6360fd39bc929429e56eab4d4e6e71ae", "sha256": "9fef6776eddb0e1982880d613ec5f224cf66e20aba52d80c4fc02fff6c58796f" }, "downloads": -1, "filename": "arithmat-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6360fd39bc929429e56eab4d4e6e71ae", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, <3", "size": 93799, "upload_time": "2019-08-16T08:44:38", "url": "https://files.pythonhosted.org/packages/5d/4b/05256ad2f855a134ae5ac4347297558b237afe87f9e7da1ae08a373910da/arithmat-1.0.1.tar.gz" } ] }