def to_gh(g, quiet=True):
    """Turns every red node into a green node by changing regular edges into hadamard edges"""
    ty = g.types()
    for v in g.vertices():
        if ty[v] == 2:
            g.set_type(v, 1)
            for e in g.incident_edges(v):
                et = g.edge_type(e)
                if et == 2:
                    g.set_edge_type(e, 1)
                elif et == 1:
                    g.set_edge_type(e, 2)
