deltakit.core.decoding_graphs.change_graph_error_probabilities#
- deltakit.core.decoding_graphs.change_graph_error_probabilities(graph: NXDecodingGraph, new_p_errors: Sequence[float]) NXDecodingGraph#
Make a new graph from the given graph where the error probabilities on the edges are changed to the new error probabilities. The sequence of new error probabilities should correspond to the sequence of edges in the given graph.
- Parameters:
graph (NXDecodingGraph) – The graph to use to with the old error probabilities.
new_p_errors (Sequence[float]) – The new error probabilities to apply to the graph.
- Returns:
A new graph instance with the same vertices, edges and boundaries as the input graph but with an updated error proability on each edge.
- Return type:
- Raises:
ValueError – If the length of the new error probabilities and edges do not match.