Pensieve header: Testing the associativity of compositions in GDO. Based on GenericDoPeGDO.nb in pensieve://Talks/DaNang-1905/.

(Subscript[𝕄, A_->B_])[ω1_,Q1_]//(Subscript[𝕄, B_->C_])[ω2_,Q2_]:=Module[{ζA,zC,E1,F1,G1,E2,F2,G2,I},
ζA=Table[(Subscript[ζ, i]),{i,A}]; zC=Table[(Subscript[z, i]),{i,C}]; I=IdentityMatrix@Length@B;
E1=Table[(∂_((Subscript[ζ, i]),(Subscript[z, j])))Q1,{i,A},{j,B}]; E2=Table[(∂_((Subscript[ζ, i]),(Subscript[z, j])))Q2,{i,B},{j,C}];
F1=Table[(∂_((Subscript[ζ, i]),(Subscript[ζ, j])))Q1,{i,A},{j,A}]; F2=Table[(∂_((Subscript[ζ, i]),(Subscript[ζ, j])))Q2,{i,B},{j,B}];
G1=Table[(∂_((Subscript[z, i]),(Subscript[z, j])))Q1,{i,B},{j,B}]; G2=Table[(∂_((Subscript[z, i]),(Subscript[z, j])))Q2,{i,C},{j,C}];
Expand/@(Subscript[𝕄, A->C])[ω1 ω2 ((Det[I-F2.G1])^(-1)), ζA.E1.Inverse[I-F2.G1].E2.zC
+(1/2)ζA.(F1+E1.F2.Inverse[I-G1.F2].(E1^\[Transpose])).ζA+(1/2)zC.(G2+(E2^\[Transpose]).G1.Inverse[I-F2.G1].E2).zC] ]

(Subscript[R𝕄, A_->B_]):=Module[{vs=Table[(Subscript[ζ, i]),{i,A}]⋃Table[(Subscript[z, i]),{i,B}]},
(Subscript[𝕄, A->B])[1,Sum[RandomInteger[{-3,3}]vi vj,{vi,vs},{vj,vs}]]];
{M1=(Subscript[R𝕄, {1,2}->{1,2,3}]),M2=(Subscript[R𝕄, {1,2,3}->{1,2,3}]),M3=(Subscript[R𝕄, {1,2,3}->{1,2}])}//Column

(M1//M2)//M3

((M1//M2)//M3)==(M1//(M2//M3))