def _color_by_committor(self, min1, min2, T=1.): print("coloring by the probability that a trajectory gets to minimum", min1._id, "before", min2._id) # get a list of transition states in the same cluster as min1 edges = nx.bfs_edges(self.graph, min1) transition_states = [ self.graph.get_edge_data(u, v)["ts"] for u, v in edges ] if not check_thermodynamic_info(transition_states): raise Exception( "The thermodynamic information is not yet computed. Use the main menu of the gui under 'Actions'" ) A = [min2] B = [min1] committors = compute_committors(transition_states, A, B, T=T) self._minima_color_value = committors def get_committor(m): try: return committors[m] except KeyError: return 1. self._minima_color_value = get_committor self.show_graph()
def _layout_by_committor(self, min1, min2, T=1.): print("coloring by the probability that a trajectory gets to minimum", min1._id, "before", min2._id) # get a list of transition states in the same cluster as min1 edges = nx.bfs_edges(self.graph, min1) transition_states = [ self.graph.get_edge_data(u, v)["ts"] for u, v in edges ] if not check_thermodynamic_info(transition_states): raise Exception( "The thermodynamic information is not yet computed") A = [min2] B = [min1] committors = compute_committors(transition_states, A, B, T=T) print("maximum committor", max(committors.values())) print("minimum committor", min(committors.values())) print("number of committors near 1", len([v for v in committors.values() if v > 1. - 1e-4])) print("number of committors equal to 1", len([v for v in committors.values() if v == 1.])) def get_committor(m): try: return committors[m] except KeyError: return 1. self.dg.get_value = get_committor self.dg._layout_x_axis(self.dg.tree_graph) self.dg.color_by_value(get_committor) self.redraw_disconnectivity_graph()
def _color_by_committor(self, min1, min2, T=1.): print "coloring by the probability that a trajectory gets to minimum", min1._id, "before", min2._id # get a list of transition states in the same cluster as min1 edges = nx.bfs_edges(self.graph, min1) transition_states = [ self.graph.get_edge_data(u, v)["ts"] for u, v in edges ] if not check_thermodynamic_info(transition_states): raise Exception("The thermodynamic information is not yet computed") A = [min2] B = [min1] committors = compute_committors(transition_states, A, B, T=T) def get_committor(m): try: return committors[m] except KeyError: return 1. self.dg.color_by_value(get_committor) self.redraw_disconnectivity_graph()
def _color_by_committor(self, min1, min2, T=1.): print("coloring by the probability that a trajectory gets to minimum", min1._id, "before", min2._id) # get a list of transition states in the same cluster as min1 edges = nx.bfs_edges(self.graph, min1) transition_states = [ self.graph.get_edge_data(u, v)["ts"] for u, v in edges ] if not check_thermodynamic_info(transition_states): raise Exception("The thermodynamic information is not yet computed. Use the main menu of the gui under 'Actions'") A = [min2] B = [min1] committors = compute_committors(transition_states, A, B, T=T) self._minima_color_value = committors def get_committor(m): try: return committors[m] except KeyError: return 1. self._minima_color_value = get_committor self.show_graph()
def _color_by_committor(self, min1, min2, T=1.): print "coloring by the probability that a trajectory gets to minimum", min1._id, "before", min2._id # get a list of transition states in the same cluster as min1 edges = nx.bfs_edges(self.graph, min1) transition_states = [ self.graph.get_edge_data(u, v)["ts"] for u, v in edges ] if not check_thermodynamic_info(transition_states): raise Exception( "The thermodynamic information is not yet computed") A = [min2] B = [min1] committors = compute_committors(transition_states, A, B, T=T) def get_committor(m): try: return committors[m] except KeyError: return 1. self.dg.color_by_value(get_committor) self.redraw_disconnectivity_graph()
def _layout_by_committor(self, min1, min2, T=1.): print "coloring by the probability that a trajectory gets to minimum", min1._id, "before", min2._id # get a list of transition states in the same cluster as min1 edges = nx.bfs_edges(self.graph, min1) transition_states = [ self.graph.get_edge_data(u, v)["ts"] for u, v in edges ] if not check_thermodynamic_info(transition_states): raise Exception("The thermodynamic information is not yet computed") A = [min2] B = [min1] committors = compute_committors(transition_states, A, B, T=T) print "maximum committor", max(committors.values()) print "minimum committor", min(committors.values()) print "number of committors near 1", len([v for v in committors.values() if v > 1.-1e-4]) print "number of committors equal to 1", len([v for v in committors.values() if v == 1.]) def get_committor(m): try: return committors[m] except KeyError: return 1. self.dg.get_value = get_committor self.dg._layout_x_axis(self.dg.tree_graph) self.dg.color_by_value(get_committor) self.redraw_disconnectivity_graph()