Skip to content

Releases: DeloneCommons/pbcgraph

v0.1.3.post1 - Metadata fixes

13 Mar 23:42

Choose a tag to compare

v0.1.3

26 Jan 13:07
fdb5adf

Choose a tag to compare

This release merges three versions (0.1.1 => 0.1.3) and is focused on making pbcgraph deterministic, safer to mutate, and more robust for lift-based workflows.

  • Deterministic, stable core iteration

    • All public iteration APIs (nodes, edges, neighbors, successors, predecessors, plus in_neighbors*) now yield results deterministically, with a stable fallback order when objects are not mutually comparable.
    • Iteration internals were further optimized in 0.1.3 to stream deterministically without materializing/sorting full edge lists.
  • Safer attribute handling and edge-key semantics

    • Node/edge data accessors now return read-only live views; attribute mutation is routed through set_node_attrs() / set_edge_attrs() (with clarified data_version semantics).
    • Edge key generation became deterministic and local to (u, v) pairs; explicit keys must be int (bool rejected).
    • PeriodicGraph.check_invariants() was added to validate undirected pairing invariants.
  • Finite lift patches and NetworkX export

    • Introduced lift_patch(...) to extract finite patches of the infinite lift around a seed instance (BFS radius and/or cell-index bounding boxes), storing snapshot edge attributes and deterministically deduplicating paired realizations for undirected containers.
    • Directed periodic containers now produce directed patches by default; LiftPatch.to_networkx(as_undirected=True, ...) provides undirected views.
    • 0.1.3 change: NetworkX export metadata for undirected views is consolidated under a single reserved edge attribute __pbcgraph__ (and PBC_META_KEY internally). Code that previously read _pbc_* or orig_edges must now read __pbcgraph__.
  • Canonical lifts

    • Added canonical_lift(...) to select strand representatives (cosets in Z^d/L), with placements tree, best_anchor, and greedy_cut, and optional spanning-tree edge return.
    • Added read-only PeriodicComponent.snf and PeriodicComponent.tree_parent_map() and adjusted canonical lift internals to avoid touching private component caches.
  • Robustness and maintenance

    • Added scoped errors: CanonicalLiftError, LiftPatchError.
    • Removed SymPy by implementing exact inversion for unimodular matrices.
    • Refactoring work split pbcgraph.alg.lift into _lift_patch / _canonical_lift modules and simplified internal filtering/exports; lift_patch(...) for undirected containers avoids redundant incoming-edge traversal (no semantic change).

v0.1.0 First version

24 Jan 13:50

Choose a tag to compare

Implements core functionality for periodic graphs on Zd:

  • PeriodicGraph (undirected) and PeriodicDiGraph (directed), enforcing one edge per (u, v, tvec).
  • PeriodicMultiGraph and PeriodicMultiDiGraph when you really need parallel edges for the same (u, v, tvec).
  • A PeriodicComponent view that exposes lattice invariants of the component translation subgroup:
    • rank (periodic dimension of the component),
    • torsion_invariants (torsion / interpenetration signature),
    • deterministic inst_key(...) keys for lifted instances within a component.
  • same_fragment(...): exact "are these two lifted instances in the same connected fragment?" checks.
  • shortest_path_quotient(...): fast BFS in the quotient with connectivity='directed'|'weak'.