Atelier des rouesLab FR
Objects/Documentation

strate29.py

A polynomial for schedules with two visits per active residue · strate29.py

Download ↓
"""Count the (2,0,2) repeated stratum by a four-cycle of pair compatibility matrices."""
from itertools import combinations
from functools import lru_cache
from longueurs28 import transfer
import json
from math import comb
def accepts(times,N,k):
    # Visit times have prescribed shifts. An automaton enforces both boundary dwells.
    fixed=dict(times);states={(s,0,0) for s in (-1,0,1)}
    for slot in range(N):
        new=set()
        for s,age,c in states:
            for v in (s,) if age<2 or c==k else (-1,0,1):
                if slot in fixed and fixed[slot]!=v:continue
                new.add((v,min(2,age+1) if v==s else 1,c+int(s!=v)))
        states=new

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.