def rotate_address(level, address, rotate_num):
    """Rotates the address with respect to rotational symmetries of SG

    Args:
        level: A nonnegative integer representing the level of SG we're 
            working with.
        address: np.array of size (level+1) representing the address 
            vector of a point in some SG graph.
        rotate_num: A number in {0, 1, 2} representing the type of 
            rotation we're making. 0 represent no rotation, 1 represent
            counterclockwise 2*np.pi/3, 2 represent counterclockwise 
            4*np.pi/3.
    
    Returns:
        new_address: np.array of size (level+1) representing the address 
            vector of the rotated point in some SG graph.

    """
    new_address = []

    for i in range(level):
        new_address.append(int((address[i] + rotate_num) % 3))
    new_address.append(int(address[-1]))
    return new_address