def B(i,j,k):
    """
    Tensor B used in constructing ROMs. 

    Parameters
    ----------
    i : int
    j : int
    k : int
        Indices in the tensor.

    Returns
    -------
    int
        Tensor output.
    """
    if i == j + k:
        return -1
    elif j == i + k or k == i + j:
        return 1
    else:
        msg = "Possible Error: Indices ({},{},{})".format(i,j,k)
        print(msg)
        return 0