def validate_supercell_matrix(value, _):
    """Validate the `validate_supercell_matrix` input."""
    if not len(value) == 3:
        return "need exactly 3 diagonal elements or 3x3 arrays."

    for row in value:
        if isinstance(row, list):
            if not len(row):
                return "supercell matrix need to have 3x1 or 3x3 shape."
            for element in row:
                if not isinstance(row, int):
                    return (
                        f"type `{type(element)}` of {element} is not an accepted "
                        "type in supercell matrix; only `int` is valid."
                    )
        else:
            if not isinstance(row, int):
                return (
                    f"type `{type(row)}` of {row} is not an accepted type in" "supercell matrix; only `int` is valid."
                )