{ "info": { "author": "Bryn Keller", "author_email": "bryn.keller@intel.com", "bugtrack_url": null, "classifiers": [], "description": "Persistent Homology Algorithm Toolkit (PHAT)\n============================================\n\nThis is a Python interface for the `Persistent Homology Algorithm Toolkit`_, a software library\nthat contains methods for computing the persistence pairs of a\nfiltered cell complex represented by an ordered boundary matrix with Z\\ :sub:`2` coefficients.\n\nFor an introduction to persistent homology, see the textbook [1]_. This software package\ncontains code for several algorithmic variants:\n\n* The \"standard\" algorithm (see [1]_, p.153)\n* The \"row\" algorithm from [2]_ (called pHrow in that paper)\n* The \"twist\" algorithm, as described in [3]_ (default algorithm)\n* The \"chunk\" algorithm presented in [4]_\n* The \"spectral sequence\" algorithm (see [1]_, p.166)\n\nAll but the standard algorithm exploit the special structure of the boundary matrix\nto take shortcuts in the computation. The chunk and the spectral sequence algorithms\nmake use of multiple CPU cores if PHAT is compiled with OpenMP support.\n\nAll algorithms are implemented as function objects that manipulate a given\n``boundary_matrix`` (to be defined below) object to reduced form.\nFrom this reduced form one can then easily extract the persistence pairs.\nAlternatively, one can use the ``compute_persistence_pairs function`` which takes an\nalgorithm as a parameter, reduces the given ``boundary_matrix`` and stores the\nresulting pairs in a given ``persistence_pairs`` object.\n\nThe ``boundary_matrix`` class takes a \"Representation\" class as a parameter.\nThis representation defines how columns of the matrix are represented and how\nlow-level operations (e.g., column additions) are performed. The right choice of the\nrepresentation class can be as important for the performance of the program as choosing\nthe algorithm. We provide the following choices of representation classes:\n\n* ``vector_vector``: Each column is represented as a sorted ``std::vector`` of integers, containing the indices of the non-zero entries of the column. The matrix itself is a ``std::vector`` of such columns.\n* ``vector_heap``: Each column is represented as a heapified ``std::vector`` of integers, containing the indices of the non-zero entries of the column. The matrix itself is a ``std::vector`` of such columns.\n* ``vector_set``: Each column is a ``std::set`` of integers, with the same meaning as above. The matrix is stored as a ``std::vector`` of such columns.\n* ``vector_list``: Each column is a sorted ``std::list`` of integers, with the same meaning as above. The matrix is stored as a ``std::vector`` of such columns.\n* ``sparse_pivot_column``: The matrix is stored as in the vector_vector representation. However, when a column is manipulated, it is first converted into a ``std::set``, using an extra data field called the \"pivot column\". When another column is manipulated later, the pivot column is converted back to the ``std::vector`` representation. This can lead to significant speed improvements when many columns are added to a given pivot column consecutively. In a multicore setup, there is one pivot column per thread.\n* ``heap_pivot_column``: The same idea as in the sparse version. Instead of a ``std::set``, the pivot column is represented by a ``std::priority_queue``.\n* ``full_pivot_column``: The same idea as in the sparse version. However, instead of a ``std::set``, the pivot column is expanded into a bit vector of size n (the dimension of the matrix). To avoid costly initializations, the class remembers which entries have been manipulated for a pivot column and updates only those entries when another column becomes the pivot.\n* ``bit_tree_pivot_column`` (default representation): Similar to the ``full_pivot_column`` but the implementation is more efficient. Internally it is a bit-set with fast iteration over nonzero elements, and fast access to the maximal element.\n\nInstallation\n------------\n\nIf you wish to use the released version of PHAT, you can simply install from PyPI::\n\n pip install phat\n\nInstallation from Source\n------------------------\nSuppose you have checked out the PHAT repository at location $PHAT. Then you can::\n\n cd $PHAT\n\n pip install .\n\nThis will install PHAT for whatever Python installation your ``pip`` executable is associated with.\nPlease ensure you use the ``pip`` that comes from the same directory where your ``python`` executable lives!\n\nCurrently, the PHAT Python bindings are known to work on:\n\n* Linux with Python 2.7 (tested on Ubuntu 14.04 with system Python)\n* Linux with Python 3.5 (tested on Ubuntu 14.04 with Anaconda)\n* Mac OS X with Python 2.7.12 (tested on Sierra with homebrew)\n* Mac OS X with Python 3.5 (tested on Sierra with homebrew)\n\nOther configurations are untested.\n\nPlease note that this package DOES NOT work with the Python 2.7.10 that ships with the operating\nsystem in Mac OS X. These words of wisdom from `python.org`_ are worth heeding:\n\n The version of Python that ships with OS X is great for learning but it\u2019s not good for development.\n The version shipped with OS X may be out of date from the official current Python release,\n which is considered the stable production version.\n\nWe recommend installing Python on Mac OS X using either homebrew or Anaconda, according to your taste.\n\nPlease let us know if there is a platform you'd like us to support, we will do so if we can.\n\nSample usage\n------------\n\nWe will build an ordered boundary matrix of this simplicial complex consisting of a single triangle::\n\n 3\n |\\\\\n | \\\\\n | \\\\\n | \\\\ 4\n 5| \\\\\n | \\\\\n | 6 \\\\\n | \\\\\n |________\\\\\n 0 2 1\n\nNow the code::\n\n import phat\n\n # define a boundary matrix with the chosen internal representation\n boundary_matrix = phat.boundary_matrix(representation = phat.representations.vector_vector)\n\n # set the respective columns -- (dimension, boundary) pairs\n boundary_matrix.columns = [ (0, []),\n (0, []),\n (1, [0,1]),\n (0, []),\n (1, [1,3]),\n (1, [0,3]),\n (2, [2,4,5])]\n\n # or equivalently, boundary_matrix = phat.boundary_matrix(representation = ..., columns = ...)\n # would combine the creation of the matrix and the assignment of the columns\n\n # print some information of the boundary matrix:\n print(\"\\nThe boundary matrix has %d columns:\" % len(boundary_matrix.columns))\n for col in boundary_matrix.columns:\n s = \"Column %d represents a cell of dimension %d.\" % (col.index, col.dimension)\n if (col.boundary):\n s = s + \" Its boundary consists of the cells \" + \" \".join([str(c) for c in col.boundary])\n print(s)\n print(\"Overall, the boundary matrix has %d entries.\" % len(boundary_matrix))\n\n pairs = boundary_matrix.compute_persistence_pairs()\n\n pairs.sort()\n\n print(\"\\nThere are %d persistence pairs: \" % len(pairs))\n for pair in pairs:\n print(\"Birth: %d, Death: %d\" % pair)\n\nReferences:\n\n.. [1] H.Edelsbrunner, J.Harer: Computational Topology, An Introduction. American Mathematical Society, 2010, ISBN 0-8218-4925-5\n.. [2] V.de Silva, D.Morozov, M.Vejdemo-Johansson: Dualities in persistent (co)homology. Inverse Problems 27, 2011\n.. [3] C.Chen, M.Kerber: Persistent Homology Computation With a Twist. 27th European Workshop on Computational Geometry, 2011.\n.. [4] U.Bauer, M.Kerber, J.Reininghaus: Clear and Compress: Computing Persistent Homology in Chunks. arXiv:1303.0477_\n.. _arXiv:1303.0477: http://arxiv.org/pdf/1303.0477.pdf\n.. _`Persistent Homology Algorithm Toolkit`: https://bitbucket.org/phat/phat-code\n.. _`python.org`:http://docs.python-guide.org/en/latest/starting/install/osx/", "description_content_type": null, "docs_url": "https://pythonhosted.org/phat/", "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/phat-code/phat", "keywords": "algebraic-topology PHAT distributed topology persistent-homology", "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "phat", "package_url": "https://pypi.org/project/phat/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/phat/", "project_urls": { "Homepage": "https://bitbucket.org/phat-code/phat" }, "release_url": "https://pypi.org/project/phat/1.5.0/", "requires_dist": null, "requires_python": null, "summary": "Python bindings for PHAT, the C++ based Persistent Homology Algorithm Toolbox", "version": "1.5.0" }, "last_serial": 2598779, "releases": { "1.5.0": [ { "comment_text": "", "digests": { "md5": "52a68b6fcb6c90b1f3c746c0bfee30df", "sha256": "51e7fe5e05adf5c7e0895765572fff05b979731234251f13011610d71d4980ab" }, "downloads": -1, "filename": "phat-1.5.0a.tar.gz", "has_sig": false, "md5_digest": "52a68b6fcb6c90b1f3c746c0bfee30df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4665166, "upload_time": "2017-01-26T00:18:13", "url": "https://files.pythonhosted.org/packages/43/82/c14de81dc2953a71a060f72f2bc34c41996307956b162751f2a47e2c78f7/phat-1.5.0a.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "52a68b6fcb6c90b1f3c746c0bfee30df", "sha256": "51e7fe5e05adf5c7e0895765572fff05b979731234251f13011610d71d4980ab" }, "downloads": -1, "filename": "phat-1.5.0a.tar.gz", "has_sig": false, "md5_digest": "52a68b6fcb6c90b1f3c746c0bfee30df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4665166, "upload_time": "2017-01-26T00:18:13", "url": "https://files.pythonhosted.org/packages/43/82/c14de81dc2953a71a060f72f2bc34c41996307956b162751f2a47e2c78f7/phat-1.5.0a.tar.gz" } ] }