Open mmore500 opened 1 year ago
sketch
class ApplyUntantle:
def __call__(
self: "ApplyUntangle",
state: State,
event_buffer: typing.Optional = None,
) -> None:
dpxs = state.px[1:, :] - state.px[:-1, :]
dpys = state.py[1:, :] - state.py[:-1, :]
# up downs
dots = dpxs[1:, :] * dpxs[:-1, :] + dpys[1:, :] * dpys[:-1, :]
flags = dots < 0
state.px
Detect entanglement by seeing if any is angle between cell positions > 180 degrees (if dot products are negative) or maybe somehow by monitoring less-than/greater-than relationships between positions