def init_DA6(B6, B1):
    gen_by_name = AttrDict({
        "x0": Generator("x0"),
        "x1": Generator("x1"),
        "x2": Generator("x2"),
        "x3": Generator("x3"),
        "r": Generator("r")
    })

    gen_by_name.x0.add_idems(B6.idem_by_name['|(0, 2)|'], B1.idem_by_name.i0)
    gen_by_name.x1.add_idems(B6.idem_by_name['|(1, 6)|'], B1.idem_by_name.i1)
    gen_by_name.x2.add_idems(B6.idem_by_name['|(3, 5)|'], B1.idem_by_name.i2)
    gen_by_name.x3.add_idems(B6.idem_by_name['|(4, 7)|'], B1.idem_by_name.i3)
    gen_by_name.r.add_idems(B6.idem_by_name['|(3, 5)|'], B1.idem_by_name.i1)

    arrows = Bunch_of_arrows([
        # short-near-chords:
        (gen_by_name.x0, (B1.gen_by_name.r1, ), B6.gen_by_name['|(0->1)|'],
         gen_by_name.x1),
        (gen_by_name.x1, (B1.gen_by_name.r2, ), B6.gen_by_name['|(1->2)|'],
         gen_by_name.x0),
        (gen_by_name.x0, (B1.gen_by_name.r3, ), B6.gen_by_name['|(2->3)|'],
         gen_by_name.r),
        (gen_by_name.r, (B1.gen_by_name.r4, ), 1, gen_by_name.x2),
        (gen_by_name.x2, (B1.gen_by_name.r5, ), B6.gen_by_name['|(3->4)|'],
         gen_by_name.x3),
        (gen_by_name.x3, (B1.gen_by_name.r6, ), B6.gen_by_name['|(4->5)|'],
         gen_by_name.x2),
        (gen_by_name.r, (), B6.gen_by_name['|(5->6)|'], gen_by_name.x1),

        # the rest, kind of follows from short ones, but not exactly
        # the game changer for DA bimodule is usually periodic domain, which
        # contains σ and the domain next to it. See below
        (gen_by_name.x0, (B1.gen_by_name.r34, ), B6.gen_by_name['|(2->3)|'],
         gen_by_name.x2),
        (gen_by_name.x2, (B1.gen_by_name.r56, ), B6.gen_by_name['|(3->5)|'],
         gen_by_name.x2),
        (gen_by_name.x0, (B1.gen_by_name.r12, ), B6.gen_by_name['|(0->2)|'],
         gen_by_name.x0),
        (gen_by_name.r, (B1.gen_by_name.r45, ), B6.gen_by_name['|(3->4)|'],
         gen_by_name.x3),
        (gen_by_name.x1, (B1.gen_by_name.r23, ), B6.gen_by_name['|(1->3)|'],
         gen_by_name.r),
        (gen_by_name.x0, (B1.gen_by_name.r345, ), B6.gen_by_name['|(2->4)|'],
         gen_by_name.x3),
        (gen_by_name.x0, (B1.gen_by_name.r1234, ), B6.gen_by_name['|(0->3)|'],
         gen_by_name.x2),
        (gen_by_name.x0, (B1.gen_by_name.r3456, ), B6.gen_by_name['|(2->5)|'],
         gen_by_name.x2),
        (gen_by_name.r, (B1.gen_by_name.r456, ), B6.gen_by_name['|(3->5)|'],
         gen_by_name.x2),
        (gen_by_name.x1, (B1.gen_by_name.r2345, ), B6.gen_by_name['|(1->4)|'],
         gen_by_name.x3),
        (gen_by_name.x1, (B1.gen_by_name.r234, ), B6.gen_by_name['|(1->3)|'],
         gen_by_name.x2),
        (gen_by_name.x1, (B1.gen_by_name.r23456, ), B6.gen_by_name['|(1->5)|'],
         gen_by_name.x2),
        (gen_by_name.x0, (B1.gen_by_name.r12345, ), B6.gen_by_name['|(0->4)|'],
         gen_by_name.x3),
        (gen_by_name.x0, (B1.gen_by_name.r123456, ),
         B6.gen_by_name['|(0->5)|'], gen_by_name.x2),
        (gen_by_name.x0, (B1.gen_by_name.r123, ), B6.gen_by_name['|(0->3)|'],
         gen_by_name.r),

        # game changer
        (gen_by_name.x2, (B1.gen_by_name.r7, ), B6.gen_by_name['|(5->7)|'],
         gen_by_name.x3),
        (gen_by_name.x1, (B1.gen_by_name.r4, B1.gen_by_name.r7),
         B6.gen_by_name['|(6->7)|'], gen_by_name.x3),
        (gen_by_name.x3, (B1.gen_by_name.r67, ), B6.gen_by_name['|(4->7)|'],
         gen_by_name.x3),
        (gen_by_name.x2, (B1.gen_by_name.r567, ), B6.gen_by_name['|(3->7)|'],
         gen_by_name.x3),
        (gen_by_name.x0, (B1.gen_by_name.r34567, ), B6.gen_by_name['|(2->7)|'],
         gen_by_name.x3),
        (gen_by_name.x1, (B1.gen_by_name.r234567, ),
         B6.gen_by_name['|(1->7)|'], gen_by_name.x3),
        (gen_by_name.x0, (B1.gen_by_name.r1234567, ),
         B6.gen_by_name['|(0->7)|'], gen_by_name.x3),
        (gen_by_name.r, (B1.gen_by_name.r4567, ), B6.gen_by_name['|(3->7)|'],
         gen_by_name.x3),
    ])

    return DA_bimodule(gen_by_name, arrows, B6, B1, name="N(η^{-1})")
def init_DD_pmc1(B1, A_pmc1_str3):
    gen_by_name = AttrDict({
        "x0": Generator("x0"),
        "x1": Generator("x1"),
        "x2": Generator("x2"),
        "x3": Generator("x3"),
    })

    gen_by_name.x0.add_idems(
        B1.idem_by_name.i0, A_pmc1_str3.idem_by_name['|(1, 3),(4, 6),(5, 7)|'])
    gen_by_name.x1.add_idems(
        B1.idem_by_name.i1, A_pmc1_str3.idem_by_name['|(0, 2),(4, 6),(5, 7)|'])
    gen_by_name.x2.add_idems(
        B1.idem_by_name.i2, A_pmc1_str3.idem_by_name['|(0, 2),(1, 3),(5, 7)|'])
    gen_by_name.x3.add_idems(
        B1.idem_by_name.i3, A_pmc1_str3.idem_by_name['|(0, 2),(1, 3),(4, 6)|'])

    dd_arrows = Bunch_of_arrows([
        (gen_by_name.x0, B1.gen_by_name['r1'], gen_by_name.x1,
         A_pmc1_str3.gen_by_name['|(4, 6),(5, 7),(0->1)|']),
        (gen_by_name.x0, B1.gen_by_name['r3'], gen_by_name.x1,
         A_pmc1_str3.gen_by_name['|(4, 6),(5, 7),(2->3)|']),
        (gen_by_name.x0, B1.gen_by_name['r123'], gen_by_name.x1,
         A_pmc1_str3.gen_by_name['|(4, 6),(5, 7),(0->3)|']),
        (gen_by_name.x1, B1.gen_by_name['r2'], gen_by_name.x0,
         A_pmc1_str3.gen_by_name['|(4, 6),(5, 7),(1->2)|']),
        (gen_by_name.x2, B1.gen_by_name['r5'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(0, 2),(1, 3),(4->5)|']),
        (gen_by_name.x2, B1.gen_by_name['r7'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(0, 2),(1, 3),(6->7)|']),
        (gen_by_name.x2, B1.gen_by_name['r567'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(0, 2),(1, 3),(4->7)|']),
        (gen_by_name.x3, B1.gen_by_name['r6'], gen_by_name.x2,
         A_pmc1_str3.gen_by_name['|(0, 2),(1, 3),(5->6)|']),
        (gen_by_name.x0, B1.gen_by_name['r1234'], gen_by_name.x2,
         A_pmc1_str3.gen_by_name['|(1, 3),(5, 7),(0->4)|']),
        (gen_by_name.x0, B1.gen_by_name['r34'], gen_by_name.x2,
         A_pmc1_str3.gen_by_name['|(1, 3),(5, 7),(2->4)|']),
        (gen_by_name.x0, B1.gen_by_name['r3456'], gen_by_name.x2,
         A_pmc1_str3.gen_by_name['|(1, 3),(5, 7),(2->6)|']),
        (gen_by_name.x0, B1.gen_by_name['r123456'], gen_by_name.x2,
         A_pmc1_str3.gen_by_name['|(1, 3),(5, 7),(0->6)|']),
        (gen_by_name.x1, B1.gen_by_name['r4'], gen_by_name.x2,
         A_pmc1_str3.gen_by_name['|(0, 2),(5, 7),(3->4)|']),
        (gen_by_name.x1, B1.gen_by_name['r456'], gen_by_name.x2,
         A_pmc1_str3.gen_by_name['|(0, 2),(5, 7),(3->6)|']),
        (gen_by_name.x1, B1.gen_by_name['r234'], gen_by_name.x2,
         A_pmc1_str3.gen_by_name['|(0, 2),(5, 7),(1->4)|']),
        (gen_by_name.x1, B1.gen_by_name['r23456'], gen_by_name.x2,
         A_pmc1_str3.gen_by_name['|(0, 2),(5, 7),(1->6)|']),
        (gen_by_name.x1, B1.gen_by_name['r45'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(0, 2),(4, 6),(3->5)|']),
        (gen_by_name.x1, B1.gen_by_name['r4567'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(0, 2),(4, 6),(3->7)|']),
        (gen_by_name.x1, B1.gen_by_name['r2345'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(0, 2),(4, 6),(1->5)|']),
        (gen_by_name.x1, B1.gen_by_name['r234567'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(0, 2),(4, 6),(1->7)|']),
        (gen_by_name.x0, B1.gen_by_name['r345'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(1, 3),(4, 6),(2->5)|']),
        (gen_by_name.x0, B1.gen_by_name['r34567'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(1, 3),(4, 6),(2->7)|']),
        (gen_by_name.x0, B1.gen_by_name['r12345'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(1, 3),(4, 6),(0->5)|']),
        (gen_by_name.x0, B1.gen_by_name['r1234567'], gen_by_name.x3,
         A_pmc1_str3.gen_by_name['|(1, 3),(4, 6),(0->7)|']),
    ])

    return DD_bimodule(gen_by_name, dd_arrows, B1, A_pmc1_str3, name="K_pmc1")
def init_DA5(B5, B6):
    gen_by_name = AttrDict({
        "y0": Generator("y0"),
        "y1": Generator("y1"),
        "y2": Generator("y2"),
        "y3": Generator("y3"),
        "r": Generator("r")
    })

    gen_by_name.y0.add_idems(B5.idem_by_name['|(0, 5)|'],
                             B6.idem_by_name['|(0, 2)|'])
    gen_by_name.y1.add_idems(B5.idem_by_name['|(1, 6)|'],
                             B6.idem_by_name['|(1, 6)|'])
    gen_by_name.y2.add_idems(B5.idem_by_name['|(2, 4)|'],
                             B6.idem_by_name['|(3, 5)|'])
    gen_by_name.y3.add_idems(B5.idem_by_name['|(3, 7)|'],
                             B6.idem_by_name['|(4, 7)|'])
    gen_by_name.r.add_idems(B5.idem_by_name['|(1, 6)|'],
                            B6.idem_by_name['|(0, 2)|'])

    arrows = Bunch_of_arrows([
        # short-near-chords:
        (gen_by_name.y0, (B6.gen_by_name['|(0->1)|'], ),
         B5.gen_by_name['|(0->1)|'], gen_by_name.y1),
        (gen_by_name.y1, (B6.gen_by_name['|(1->2)|'], ), 1, gen_by_name.r),
        (gen_by_name.r, (B6.gen_by_name['|(2->3)|'], ),
         B5.gen_by_name['|(1->2)|'], gen_by_name.y2),
        (gen_by_name.y2, (B6.gen_by_name['|(3->4)|'], ),
         B5.gen_by_name['|(2->3)|'], gen_by_name.y3),
        (gen_by_name.y3, (B6.gen_by_name['|(4->5)|'], ),
         B5.gen_by_name['|(3->4)|'], gen_by_name.y2),
        (gen_by_name.y0, (), B5.gen_by_name['|(5->6)|'], gen_by_name.r),
        (gen_by_name.y1, (B6.gen_by_name['|(6->7)|'], ),
         B5.gen_by_name['|(6->7)|'], gen_by_name.y3),

        # the rest, kind of follows from short ones, but not exactly
        # the game changer for DA bimodule is usually periodic domain, which
        # contains σ and the domain next to it. See below
        (gen_by_name.y1, (B6.gen_by_name['|(1->3)|'], ),
         B5.gen_by_name['|(1->2)|'], gen_by_name.y2),
        (gen_by_name.r, (B6.gen_by_name['|(2->4)|'], ),
         B5.gen_by_name['|(1->3)|'], gen_by_name.y3),
        (gen_by_name.y2, (B6.gen_by_name['|(3->5)|'], ),
         B5.gen_by_name['|(2->4)|'], gen_by_name.y2),
        (gen_by_name.y0, (B6.gen_by_name['|(0->2)|'], ),
         B5.gen_by_name['|(0->1)|'], gen_by_name.r),
        (gen_by_name.y0, (B6.gen_by_name['|(0->4)|'], ),
         B5.gen_by_name['|(0->3)|'], gen_by_name.y3),
        (gen_by_name.r, (B6.gen_by_name['|(2->5)|'], ),
         B5.gen_by_name['|(1->4)|'], gen_by_name.y2),
        (gen_by_name.y0, (B6.gen_by_name['|(0->3)|'], ),
         B5.gen_by_name['|(0->2)|'], gen_by_name.y2),
        (gen_by_name.y1, (B6.gen_by_name['|(1->5)|'], ),
         B5.gen_by_name['|(1->4)|'], gen_by_name.y2),
        (gen_by_name.y1, (B6.gen_by_name['|(1->4)|'], ),
         B5.gen_by_name['|(1->3)|'], gen_by_name.y3),
        (gen_by_name.y0, (B6.gen_by_name['|(0->5)|'], ),
         B5.gen_by_name['|(0->4)|'], gen_by_name.y2),

        # game changer
        (gen_by_name.y2, (B6.gen_by_name['|(5->6)|'], ),
         B5.gen_by_name['|(4->6)|'], gen_by_name.y1),
        (gen_by_name.y2, (B6.gen_by_name['|(5->7)|'], ),
         B5.gen_by_name['|(4->7)|'], gen_by_name.y3),
        (gen_by_name.y2, (B6.gen_by_name['|(3->6)|'], ),
         B5.gen_by_name['|(2->6)|'], gen_by_name.y1),
        (gen_by_name.r, (B6.gen_by_name['|(2->6)|'], ),
         B5.gen_by_name['|(1->6)|'], gen_by_name.y1),
        (gen_by_name.y3, (B6.gen_by_name['|(4->6)|'], ),
         B5.gen_by_name['|(3->6)|'], gen_by_name.y1),
        (gen_by_name.y0, (B6.gen_by_name['|(0->6)|'], ),
         B5.gen_by_name['|(0->6)|'], gen_by_name.y1),
        (gen_by_name.y1, (B6.gen_by_name['|(1->6)|'], ),
         B5.gen_by_name['|(1->6)|'], gen_by_name.y1),
        (gen_by_name.y2, (B6.gen_by_name['|(3->7)|'], ),
         B5.gen_by_name['|(2->7)|'], gen_by_name.y3),
        (gen_by_name.r, (B6.gen_by_name['|(2->7)|'], ),
         B5.gen_by_name['|(1->7)|'], gen_by_name.y3),
        (gen_by_name.y0, (B6.gen_by_name['|(0->7)|'], ),
         B5.gen_by_name['|(0->7)|'], gen_by_name.y3),
        (gen_by_name.y3, (B6.gen_by_name['|(4->7)|'], ),
         B5.gen_by_name['|(3->7)|'], gen_by_name.y3),
        (gen_by_name.y1, (B6.gen_by_name['|(1->7)|'], ),
         B5.gen_by_name['|(1->7)|'], gen_by_name.y3),
        (gen_by_name.y2, (B6.gen_by_name['|(5->6)|'],
                          B6.gen_by_name['|(1->2)|']),
         B5.gen_by_name['|(4->5)|'], gen_by_name.y0),
        (gen_by_name.y2, (B6.gen_by_name['|(3->6)|'],
                          B6.gen_by_name['|(1->2)|']),
         B5.gen_by_name['|(2->5)|'], gen_by_name.y0),
        (gen_by_name.y3, (B6.gen_by_name['|(4->6)|'],
                          B6.gen_by_name['|(1->2)|']),
         B5.gen_by_name['|(3->5)|'], gen_by_name.y0),
        (gen_by_name.y1, (B6.gen_by_name['|(1->6)|'],
                          B6.gen_by_name['|(1->2)|']),
         B5.gen_by_name['|(1->5)|'], gen_by_name.y0),
        (gen_by_name.r, (B6.gen_by_name['|(2->6)|'],
                         B6.gen_by_name['|(1->2)|']),
         B5.gen_by_name['|(1->5)|'], gen_by_name.y0),
        (gen_by_name.y0, (B6.gen_by_name['|(0->6)|'],
                          B6.gen_by_name['|(1->2)|']),
         B5.gen_by_name['|(0->5)|'], gen_by_name.y0),
    ])

    return DA_bimodule(gen_by_name, arrows, B5, B6, name="N(μ_4)")
def init_DA1(B1, B2):
    gen_by_name = AttrDict({
        "x0": Generator("x0"),
        "x1": Generator("x1"),
        "x2": Generator("x2"),
        "x3": Generator("x3"),
        "r": Generator("r")
    })

    gen_by_name.x0.add_idems(B1.idem_by_name.i0, B2.idem_by_name['|(0, 2)|'])
    gen_by_name.x1.add_idems(B1.idem_by_name.i1, B2.idem_by_name['|(1, 6)|'])
    gen_by_name.x2.add_idems(B1.idem_by_name.i2, B2.idem_by_name['|(3, 5)|'])
    gen_by_name.x3.add_idems(B1.idem_by_name.i3, B2.idem_by_name['|(4, 7)|'])
    gen_by_name.r.add_idems(B1.idem_by_name.i2, B2.idem_by_name['|(1, 6)|'])

    arrows = Bunch_of_arrows([
        # short-near-chords:
        (gen_by_name.x0, (B2.gen_by_name['|(0->1)|'], ), B1.gen_by_name.r1,
         gen_by_name.x1),
        (gen_by_name.x1, (B2.gen_by_name['|(1->2)|'], ), B1.gen_by_name.r2,
         gen_by_name.x0),
        (gen_by_name.x1, (), B1.gen_by_name.r4, gen_by_name.r),
        (gen_by_name.x2, (B2.gen_by_name['|(3->4)|'], ), B1.gen_by_name.r5,
         gen_by_name.x3),
        (gen_by_name.x3, (B2.gen_by_name['|(4->5)|'], ), B1.gen_by_name.r6,
         gen_by_name.x2),
        (gen_by_name.x2, (B2.gen_by_name['|(5->6)|'], ), 1, gen_by_name.r),
        (gen_by_name.r, (B2.gen_by_name['|(6->7)|'], ), B1.gen_by_name.r7,
         gen_by_name.x3),

        # the rest, kind of follows from short ones, but not exactly
        (gen_by_name.x2, (B2.gen_by_name['|(5->7)|'], ), B1.gen_by_name.r7,
         gen_by_name.x3),
        (gen_by_name.x2, (B2.gen_by_name['|(3->5)|'], ), B1.gen_by_name.r56,
         gen_by_name.x2),
        (gen_by_name.x3, (B2.gen_by_name['|(4->7)|'], ), B1.gen_by_name.r67,
         gen_by_name.x3),
        (gen_by_name.x2, (B2.gen_by_name['|(3->7)|'], ), B1.gen_by_name.r567,
         gen_by_name.x3),
        (gen_by_name.x0, (B2.gen_by_name['|(0->2)|'], ), B1.gen_by_name.r12,
         gen_by_name.x0),

        #### next one might be basic choice
        (gen_by_name.x3, (B2.gen_by_name['|(4->6)|'], ), B1.gen_by_name.r6,
         gen_by_name.r),
        (gen_by_name.x2, (B2.gen_by_name['|(3->6)|'], ), B1.gen_by_name.r56,
         gen_by_name.r),
        (gen_by_name.x0, (B2.gen_by_name['|(2->3)|'],
                          B2.gen_by_name['|(5->6)|']), B1.gen_by_name.r3,
         gen_by_name.x1),
        (gen_by_name.x0, (B2.gen_by_name['|(2->3)|'], ), B1.gen_by_name.r34,
         gen_by_name.x2),
        (gen_by_name.x0, (B2.gen_by_name['|(0->3)|'],
                          B2.gen_by_name['|(5->6)|']), B1.gen_by_name.r123,
         gen_by_name.x1),
        (gen_by_name.x1, (B2.gen_by_name['|(1->3)|'],
                          B2.gen_by_name['|(5->6)|']), B1.gen_by_name.r23,
         gen_by_name.x1),
        (gen_by_name.x1, (B2.gen_by_name['|(1->3)|'], ), B1.gen_by_name.r234,
         gen_by_name.x2),
        (gen_by_name.x0, (B2.gen_by_name['|(2->4)|'], ), B1.gen_by_name.r345,
         gen_by_name.x3),
        (gen_by_name.x0, (B2.gen_by_name['|(2->7)|'], ), B1.gen_by_name.r34567,
         gen_by_name.x3),
        (gen_by_name.x0, (B2.gen_by_name['|(2->6)|'], ), B1.gen_by_name.r3456,
         gen_by_name.r),
        (gen_by_name.x0, (B2.gen_by_name['|(2->5)|'], ), B1.gen_by_name.r3456,
         gen_by_name.x2),
        (gen_by_name.x1, (B2.gen_by_name['|(1->4)|'], ), B1.gen_by_name.r2345,
         gen_by_name.x3),
        (gen_by_name.x1, (B2.gen_by_name['|(1->7)|'], ),
         B1.gen_by_name.r234567, gen_by_name.x3),
        (gen_by_name.x0, (B2.gen_by_name['|(0->7)|'], ),
         B1.gen_by_name.r1234567, gen_by_name.x3),
        (gen_by_name.x0, (B2.gen_by_name['|(0->3)|'], ), B1.gen_by_name.r1234,
         gen_by_name.x2),
        (gen_by_name.x0, (B2.gen_by_name['|(0->5)|'], ),
         B1.gen_by_name.r123456, gen_by_name.x2),
        (gen_by_name.x0, (B2.gen_by_name['|(0->4)|'], ), B1.gen_by_name.r12345,
         gen_by_name.x3),
        (gen_by_name.x0, (B2.gen_by_name['|(0->6)|'], ),
         B1.gen_by_name.r123456, gen_by_name.r),
        (gen_by_name.x1, (B2.gen_by_name['|(1->6)|'], ), B1.gen_by_name.r23456,
         gen_by_name.r),
        (gen_by_name.x1, (B2.gen_by_name['|(1->5)|'], ), B1.gen_by_name.r23456,
         gen_by_name.x2),
    ])

    return DA_bimodule(gen_by_name, arrows, B1, B2, name="N(η)")