nonperiodic_safe_cell

jaxrens.utils.cell.nonperiodic_safe_cell(cell, box=1000.0)[source]

Substitute a large cubic dummy box when cell is degenerate.

Non-periodic systems pass cell == 0; backends that always build a periodic image geometry need some finite cell, so they get a box-sized cube in which the system is an isolated cluster.

The test is on the determinant, not the trace: a valid periodic cell can have a zero diagonal (e.g. the fcc primitive [[0,a,a],[a,0,a],[a,a,0]] and its diagonal supercells), and a trace test would silently evaluate such crystals as clusters in vacuum. The threshold matches wrap_positions().

Parameters:
  • cell (Array)

  • box (float)

Return type:

Array