def test_external_edge_identical_particle_combinatorics( initial_state, final_state, final_state_groupings, result_graph_count): tbd_manager = StateTransitionManager(initial_state, final_state, [], formalism_type="helicity") tbd_manager.set_allowed_interaction_types([InteractionTypes.Strong]) for x in final_state_groupings: tbd_manager.add_final_state_grouping(x) tbd_manager.number_of_threads = 1 topology_graphs = tbd_manager.build_topologies() init_graphs = tbd_manager.create_seed_graphs(topology_graphs) match_external_edges(init_graphs) comb_graphs = [] for x in init_graphs: comb_graphs.extend( perform_external_edge_identical_particle_combinatorics(x)) assert len(comb_graphs) == result_graph_count ref_mapping_fs = create_edge_id_particle_mapping(comb_graphs[0], get_final_state_edges) ref_mapping_is = create_edge_id_particle_mapping(comb_graphs[0], get_initial_state_edges) for x in comb_graphs[1:]: assert ref_mapping_fs == create_edge_id_particle_mapping( x, get_final_state_edges) assert ref_mapping_is == create_edge_id_particle_mapping( x, get_initial_state_edges)
def test_external_edge_identical_particle_combinatorics(initial_state, final_state, final_state_groupings, result_graph_count): tbd_manager = StateTransitionManager(initial_state, final_state, [], formalism_type='helicity') tbd_manager.set_allowed_interaction_types([InteractionTypes.Strong]) for x in final_state_groupings: tbd_manager.add_final_state_grouping(x) tbd_manager.number_of_threads = 1 topology_graphs = tbd_manager.build_topologies() init_graphs = tbd_manager.create_seed_graphs(topology_graphs) match_external_edges(init_graphs) comb_graphs = [] for x in init_graphs: comb_graphs.extend( perform_external_edge_identical_particle_combinatorics(x)) assert len(comb_graphs) == result_graph_count ref_mapping_fs = create_edge_id_particle_mapping(comb_graphs[0], get_final_state_edges) ref_mapping_is = create_edge_id_particle_mapping(comb_graphs[0], get_initial_state_edges) for x in comb_graphs[1:]: assert ref_mapping_fs == create_edge_id_particle_mapping( x, get_final_state_edges) assert ref_mapping_is == create_edge_id_particle_mapping( x, get_initial_state_edges)
def test_match_external_edges(initial_state, final_state): tbd_manager = StateTransitionManager(initial_state, final_state, [], formalism_type='helicity') tbd_manager.set_allowed_interaction_types([InteractionTypes.Strong]) tbd_manager.number_of_threads = 1 topology_graphs = tbd_manager.build_topologies() init_graphs = tbd_manager.create_seed_graphs(topology_graphs) match_external_edges(init_graphs) ref_mapping_fs = create_edge_id_particle_mapping(init_graphs[0], get_final_state_edges) ref_mapping_is = create_edge_id_particle_mapping(init_graphs[0], get_initial_state_edges) for x in init_graphs[1:]: assert ref_mapping_fs == create_edge_id_particle_mapping( x, get_final_state_edges) assert ref_mapping_is == create_edge_id_particle_mapping( x, get_initial_state_edges)