Supercell enumeration yields equivalent supercells for 2D systems

I'm using the generate_target_structure-feature for my AuPd FCC-111 surface slabs and have detected the following two issues:

  1. transferred to #470 (closed) First, generate_target_structure uses enumerate_supercells to create supercells that are multiples of the cluster_space-primitive. Since the cluster_space-primitive has to have periodic BCs in all directions even for 2D-systems, I end up with supercells that are stacked in z-direction (separated by vacuum). On that note, it would also be nice to have more control over the supercells than by max_size, e.g. I would like to be able to include 3x3x12 cells, but not 1x9x12. I currently use a workaround where I input a list of supercells to the generate_target_structure-function, which could be an optional argument.

  2. Second, if I do use the enumerate_supercells-function on a supercell with PBCs [True, True, False], I get supercells that are equivalent, e.g.:

from icet.tools import enumerate_supercells
from ase.build import fcc111

prim = fcc111('Au', (1,1, 12), a=4.0, vacuum=10.0)
prim.set_pbc([True, True, False])
for supercell in enumerate_supercells(prim, [3]):
	print(supercell)

yields two equivalent supercells with different lattice vectors, both with and without niggli reduction.

While I'm at it: There's a typo in the documentation for enumerate_supercells and enumerate_structures where niggli_reduction is used instead of niggli_reduce under Parameters.

Edited by Magnus Rahm