Implementing Abundance counts as a sparse matrix would save memory, computation, remove the need to reindex the similarity matrix, and simplify species_ordering handling.
Sketch of the implementation:
Take species_ordering from similarity matrix.
Pivot counts, but before constructing the abundance matrix, sort the species indices in the same order as species_ordering.
Construct sparse abundance matrix from sorted pivot rows.
Clean up old code: remove unused species_subset arguments (but keep in make_metacommunity)
Implementing Abundance counts as a sparse matrix would save memory, computation, remove the need to reindex the similarity matrix, and simplify species_ordering handling.
Sketch of the implementation: