When building a register using Register.max_connectivity, we first check that minimal distance is greater than 0 before taking actions if spacing is None or checking the validity of spacing with the minimal distance.
Error: Due to this, Register.max_connectivity(3, device=MockDevice, spacing=4) raises an error because the minimal distance is 0, whereas the code is perfectly able to run and propose a result.
Proposition: Do in this order:
if spacing is None -> replace it by min_atom_distance
otherwise check that it is strictly greater than the min_atom_distance
if spacing is 0 -> raise an Error (as you say it does not make sense)
When building a register using
Register.max_connectivity
, we first check that minimal distance is greater than 0 before taking actions if spacing is None or checking the validity of spacing with the minimal distance.Error: Due to this,
Register.max_connectivity(3, device=MockDevice, spacing=4)
raises an error because the minimal distance is 0, whereas the code is perfectly able to run and propose a result.Proposition: Do in this order: