I have two lists of lists, like:
list1 = {{2}, {4}, {3, 1}, {2, 2}, {6}, {5, 1}, {4, 2}, {4, 2}, {8}, {7, 1},
{6, 2}, {6, 2}, {5, 3}, {4, 4}}
list2={{2, 2}, {4, 2}, {6, 2}, {4, 4}}
Note that, in list1, the partitions {4,2} and {6,2} occur twice. In general, there could be more than 2 occurrences of a particular element of either list, and my partitions could have more than 2 parts.
I want to "subtract" the contents of list2 from list1 (i.e. count its occurrences negatively, and merge it with list1) so the final result is
list3= {{2}, {4}, {3, 1}, {6}, {5, 1}, {4, 2}, {8}, {7, 1}, {6, 2}, {5, 3}}
i.e. if a partition $(a_1,a_2,\ldots,a_k)$ occurs $p_1(a)$ times in list1 and $q_1(a)$ times in list2, the result should be a list where $(a_1,a_2,\ldots,a_k)$ occurs $p_1(a)-q_1(a)$ times.
"Complement" doesn't quite work here as it would eliminate {4,2} and {6,2} from list3. Any help would be appreciated.
For context this come up when using modification rules for non-standard representations, which here are represented by partitions. The modification rules produce partitions with negative coefficient which ``cancels out'' an appropriate number of like standard representations in some expansion: see for instance
King RC. Modification rules and products of irreducible representations of the unitary, orthogonal, and symplectic groups. Journal of Mathematical Physics. 1971 Aug;12(8):1588-98.
list3
should not contain{2,2}
, right? $\endgroup${4,4}
fromlist3
? $\endgroup$