Skip to main content

PyTree

A fast implementation of trees from the mathematical theory of graphs

Inspired and applied in condensed matter physics, cellular biology and the World Wide Web.

Mathematical Introduction

Graphs

Mathematical objects of the theory of graphs have one-to-one matrix representations, as described by the theory of linear algebra. In general, a graph is a network structure, whose off-diagonal terms in the matrix representation are known to Condensed Matter Physicists as hopping or interaction terms.

Trees

A particular graph, known as a tree, is a network with a hierarchical structure, which we use to index objects in their matrix representation.

Python implementation

The Tree is a Python subclass of a List, which adds the following attributes and methods:

Attributes

  • parent : Tree or none (default) children : Tree or none (default)
  • ancestors : list of Trees lineage upwards
  • root: root of the tree (parent without parent)
  • descendants : lists lineage downwards (list of list of Trees)
  • buds : lists descendants without descendants

Methods

  • set_ids : add an index (id) to the buds of this Tree
  • get_ids : get the indices (ids) of the buds of this Tree .attribute : attributes are inherited down the linage

Summary

A graph structure defines a matrix; a tree structure indexes the matrix.

The tree structure adds parents, children, ancestors, descendants and inheritance of attributes.

Installation

Development environment

pip install --editable . --break-system-packages

Build and upload

python3 -m build
twine upload dist/*

Release files for Tree.Network 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Tree.Network 0.0.1
File Size Uploaded
Tree.Network-0.0.1.tar.gz 2.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Tree.Network 0.0.1
File Interpreter ABI Platform
Tree.Network-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.3 kB

Release files / Tree.Network-0.0.1.tar.gz

Download URL Tree.Network-0.0.1.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3ce7a8437aea5b74192651b94027fcc4810777692b4479f82662014985615ed4
BLAKE2b-256 checksum
How to use checksums
94090d86b136883e71660330b6b3f0352cf2a84b377dc409e53fed0009d6213d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / Tree.Network-0.0.1-py3-none-any.whl

Download URL Tree.Network-0.0.1-py3-none-any.whl
Size 2.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34bca320a74dc3b7a05f761340bab24164822d206b047df9e1a91333ce80f1de
BLAKE2b-256 checksum
How to use checksums
a0a4e3f104368294e8a957ac8889f3d2544130fe980e82d92a175f31ba21f4bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page