(dimension=5)
return numpy.array([shift(base, i) for i in range(-1, dimension - 1)])
Return the matrix corresponding to a system of beads on a string.

    Arguments:
        dimension: the number of beads, at least 4

    Returns:
        A dimension-by-dimension numpy matrix representing the linear system.
Return the matrix corresponding to a system of beads on a string.
Return the matrix corresponding to a system of beads on a string .
def bead_matrix(dimension=5):
    """Return the matrix corresponding to a system of beads on a string.

    Arguments:
        dimension: the number of beads, at least 4

    Returns:
        A dimension-by-dimension numpy matrix representing the linear system.
    """
    if dimension < 4:
        raise ValueError("dimension must be at least 4")
    base = [1, -2, 1] + [0] * (dimension - 3)
    return numpy.array([shift(base, i) for i in range(-1, dimension - 1)])
def bead_matrix ( dimension = 5 ) : if dimension < 4 : raise ValueError ( "dimension must be at least 4" ) base = [ 1 , - 2 , 1 ] + [ 0 ] * ( dimension - 3 ) return numpy . array ( [ shift ( base , i ) for i in range ( - 1 , dimension - 1 ) ] )