def validate_coords(coords):
    """Validate coords in the same way it happens in kwant.continuum."""
    coords = list(coords)
    if coords != sorted(coords):
        raise ValueError("The argument 'coords' must be sorted.")
    if any(c not in "xyz" for c in coords):
        raise ValueError("The argument 'coords' may only contain " "'x', 'y', or 'z'.")
    return coords