0
$\begingroup$

Is there a function in Mathematica that generates a list of all plane partitions of a certain dimension $n$? This paper describes the algorithm, but I still find it a bit tricky to do it myself.

$\endgroup$

1 Answer 1

3
$\begingroup$

It looks like the Wolfram MathWorld Plane Partition page has the algorithm implemented (select "Download Wolfram Notebook"):

<< Combinatorica`

coversQ[parent_, child_] :=
   And [ Length[parent] >= Length[child] ,
      Min[Take[ parent, Length@child] - child] >= 0]

planepartitionQ[par_] := 
   MatchQ[par, {{___Integer} ..}] && 
      If[Length[par] > 1, 
   And @@ MapThread[coversQ, {Drop[par, -1], Rest[par]}],
          True]

PlanePartitions[n_Integer] := Module[{l1, l2, l3, l4},
  l1 = z @@@ Partitions[n] ;
  l2 = l1 /. k_Integer /; (k > 1) :> w @@ Partitions[k];
  l3 = l2 /. z[x_w, y : (1 ...)] :> Thread[z[x, y], w] /. 
                  z[x__w] :> Outer[z, x] /. 
               z[x__w, y : (1 ...)] :> 
                  Outer[z, x, Sequence @@ ({y} /. 1 -> w[1])] /. 
    w -> Sequence;
  l4 = l3 /. 
     z[x___List, y : (1 ..)] :> z[x, Sequence @@ Transpose[{{y}}]] /. 
            z -> List;
  Cases[Union[l4], _?planepartitionQ]]

Can't speak to its validity or if it's precisely what you're looking for, and it relies on the outdated Combinatorica package, but it should be a great starting point for what you're after.

$\endgroup$
2
  • $\begingroup$ I ran a few tests, and it looks like Combinatorica is not required if you replace Partitions[...] with IntegerPartitions[...]. $\endgroup$ Feb 1, 2018 at 3:52
  • $\begingroup$ That sounds right. Most of the functionality from the package has a built in replacement nowadays. $\endgroup$
    – ktm
    Feb 1, 2018 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.