<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _vertex_different_colors_qubo(G, x_vars):
 """For each vertex, it should not have the same color as any of its neighbors. Generates the QUBO to enforce this constraint. Notes ----- Does not enforce each node having a single color. Ground energy is 0, infeasible gap is 1. """

    Q = {}
    for u, v in G.edges:
        if u not in x_vars or v not in x_vars:
            continue
        for color in x_vars[u]:
            if color in x_vars[v]:
                Q[(x_vars[u][color], x_vars[v][color])] = 1.
    return Q