You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using PHAT's Python bindings to detect the births of essential cycles on a cubical 2-torus. I've noticed that changing the order in which the indices of a cell's faces are listed — e.g. (2, [9, 10, 14, 18]) to (2, [10, 14, 9, 18]) — causes different/incorrect persistence pairs to be reported. Here's a MWE:
fromrandomimportsampleimportphatvertices= [(0, [])]*9edges= [
(1, [0, 1]),
(1, [0, 3]),
(1, [0, 2]),
(1, [0, 6]),
(1, [1, 2]),
(1, [1, 4]),
(1, [1, 7]),
(1, [2, 5]),
(1, [2, 8]),
(1, [3, 4]),
(1, [3, 6]),
(1, [3, 5]),
(1, [4, 5]),
(1, [4, 7]),
(1, [5, 8]),
(1, [6, 7]),
(1, [6, 8]),
(1, [7, 8]),
]
squares= [
(2, [9, 10, 14, 18]),
(2, [13, 14, 16, 21]),
(2, [18, 19, 22, 24]),
(2, [21, 22, 23, 26]),
(2, [10, 11, 16, 20]),
(2, [9, 12, 15, 24]),
(2, [19, 20, 23, 25]),
(2, [13, 15, 17, 26]),
(2, [11, 12, 17, 25]),
]
# To compare the resultant persistence pairs, we shuffle the order in which the# indices of each square's faces are listed. These indices are listed in increasing# order by default.forquestion, shufflerinzip(["original", "shuffled"], [lambdaA: A, lambdaB: sample(B, len(B))]):
# Shuffle the ordering of the squares' faces and construct the cubical complex.squares= [(d, shuffler(faces)) ford, facesinsquares]
complex=vertices+edges+squares# Construct the boundary matrix and compute the persistence pairs.boundary=phat.boundary_matrix()
boundary.columns=complexpairs=boundary.compute_persistence_pairs()
pairs.sort()
pairs=list(pairs)
# Determine the births of essential cycles; these should be invariant under# re-orderings of the squares' faces in the specification.deaths=set([dforb, dinpairs])
births=set([bforb, dinpairs])
times=set(range(len(complex)))
essential=times-(births|deaths)
print(question)
print(f"births @ {births}")
print(f"deaths @ {deaths}")
print(f"essential @ {essential}")
print()
I've been using PHAT's Python bindings to detect the births of essential cycles on a cubical 2-torus. I've noticed that changing the order in which the indices of a cell's faces are listed — e.g.
(2, [9, 10, 14, 18])
to(2, [10, 14, 9, 18])
— causes different/incorrect persistence pairs to be reported. Here's a MWE:which outputs
which are correct and incorrect, respectively. Is this behavior intended?
The text was updated successfully, but these errors were encountered: