code: def _matching_qubo(G, edge_mapping, magnitude=1.):
      
      Q = {}
  
      # We wish to enforce the behavior that no node has two colored edges
      for node in G:
  
          # for each pair of edges that contain node
          for edge0, edge1 in itertools.combinations(G.edges(node), 2):
  
              v0 = edge_mapping[edge0]
              v1 = edge_mapping[edge1]
  
              # penalize both being True
              Q[(v0, v1)] = magnitude
  
      return Q
docs: Generates a QUBO that induces a matching on the given graph G.
      The variables in the QUBO are the edges, as given my edge_mapping.
  
      ground_energy = 0
      infeasible_gap = magnitude