@emendes Here is new code that processes all 6 conditions. You'll see that I added a mechanism to make it easy to exclude conditions (3 is excluded here) and to specify their order (I used 1,2,5,4,6).

I also included to kludge to workaround the error that occurs immediately after **restart**.

OrbitPartition:= module()
option
`Conceptual author: emendes`,
`Maple code author: Carl Love <carl.j.love@gmail.com> 2020-May-7`
;
uses It= Iterator;
local
#Problem setup:
#==============
nIs:= 3, #number of distinct first indices
Is:= {$1..nIs}, #set of first indices
Pairs1:= combinat:-choose(Is,2),
#fundamental set of lists (indexed variables without a stem):
i, j, parms:= {seq(seq([i,j], j= 0..9), i= Is)},
permutations_by_index:= [
table([2= 3, 3= 2]), #permutations of 1st index
table([2= 3, 3= 2, 5= 6, 6= 5, 7= 9, 9= 7]) #... of 2nd index
],
#Exclusion conditions:
#---------------------
#Build a table of sets of the 2nd index grouped by their 1st index:
ClassifyI:= proc(S)
option cache;
(op~)~(2, ListTools:-Classify(x-> x[1], S))
end proc,
op2:= proc(S) option cache; op~(2,S) end proc,
TS_5t:= table([0=(), 1=1, 2=2, 3=3, 4=1, 5=(1,2), 6=(1,3), 7=2, 8=(2,3), 9=3]),
TS_5:= proc(j) option remember; TS_5t[j] end proc,
TS_6:= table([{1,2}={0,1,2}, {1,3}={0,1,3}, {2,3}={0,2,3}]),
Condition:= table([
1= proc(S) option cache; op~(1,S) = Is end proc,
2= (S-> max(op2(S)) >= 4),
3= (S-> nops({entries(ClassifyI(S))}) = nIs),
4= (S->
Condition[1](S) and
not ormap(k-> ClassifyI(S)[k] subset [{0,1,4}, {0,2,7}, {0,3,9}][k], Is)
),
5= (S-> TS_5~({op2(S)[]}) = Is),
6= (S->
Condition[1](S) and
not ormap(p-> `union`(map2(index, ClassifyI(S), p)[]) subset TS_6[p], Pairs1)
)
]),
Conditions:= [1,2,5,4,6], #The order is for efficiency.
#Decide whether a permutation's orbit is allowed to be represented:
AllowOrbit:= S-> andmap(k-> Condition[k](S), Conditions),
#=================
#End of setup code
#Set permutations to identity for unmentioned indices:
T:= proc(T::table, k) option remember; `if`(assigned(T[k]), T[k], k) end proc,
#Combine individual indices' permutations into a permutation function for lists:
conds:= S-> map(x-> T~(permutations_by_index, x), S),
#For any tuple of lists, compute its orbit under `conds`. Return a
#representative of the orbit.
Orbit:= proc(S)
local r:= S, R, ao;
do
if AllowOrbit(r) then R[r]:= () else return fi
until assigned(R[(r:= conds(r))]);
{indices(R, 'nolist')}[1] #Return lexicographic min as representative.
end proc,
Combos, #:=It:-Combination(nops(parms), tuple_size)
DoChunk:= (rn::[posint,posint])-> #starting rank and number of iterates
local
Combo_:= Object(Combos, 'rank'= rn[1]),
has:= ModuleIterator(Combo_)[1], C:= output(Combo_)
;
(to rn[2] while has() do Orbit(parms[[seq(C+~1)]]) od),
ModuleApply:= proc(tuple_size::posint, {sequential::truefalse:= false})
local it;
Combos:= It:-Combination(nops(parms), tuple_size);
for it to 2 do #kludge to workaround error on 1st run after restart
try
return
`if`(sequential, map, Threads:-Map['tasksize'= 1])(
DoChunk,
{It:-SplitRanks(Number(Combos))[]}
)
catch:
if it=1 then
printf(
"Error trapped, "
"so efficiency measures are invalid for this run.\n"
)
else
error
fi
end try
od
end proc
;
end module: