def dual_neighbours(p, displace=1):
    """All the dual neighbours of primal vertex p in the RHG lattice.

    A helper function for RHG_graph. Given a primal vertex p, returns
    the coordinates of all the dual neighbours. Assumes each neighbour
    is 1 unit away by default.

    Args:
        p (tuple): the coordinates of the primal vertex.
        displace (float): how much to displace the neighbour by. Useful
            to change when creating maronodes.

    Returns:
        List[Tuple]: the coordinates of the four neighbours.
    """
    x, y, z = p[0], p[1], p[2]
    top = (x, y + displace, z)
    bottom = (x, y - displace, z)
    left = (x - displace, y, z)
    right = (x + displace, y, z)
    if z % 2:
        front = (x, y, z + displace)
        back = (x, y, z - displace)
        if x % 2:
            return [back, left, front, right]
        return [back, top, front, bottom]
    return [bottom, left, top, right]