Generate the bit pattern of gates corresponding to a partition