quantrs2_sim/automatic_parallelization/
autoparallelengine_gates_have_dependency_group.rs1use super::types::DependencyGraph;
8
9use super::autoparallelengine_type::AutoParallelEngine;
10
11impl AutoParallelEngine {
12 pub(super) fn gates_have_dependency(idx1: usize, idx2: usize, graph: &DependencyGraph) -> bool {
14 if let Some(deps) = graph.reverse_edges.get(&idx2) {
15 if deps.contains(&idx1) {
16 return true;
17 }
18 }
19 if let Some(deps) = graph.reverse_edges.get(&idx1) {
20 if deps.contains(&idx2) {
21 return true;
22 }
23 }
24 false
25 }
26}