Skip to main content

quantrs2_sim/automatic_parallelization/
autoparallelengine_generate_gate_dependency_uuid_group.rs

1//! # AutoParallelEngine - generate_gate_dependency_uuid_group Methods
2//!
3//! This module contains method implementations for `AutoParallelEngine`.
4//!
5//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
6
7use uuid::Uuid;
8
9use super::autoparallelengine_type::AutoParallelEngine;
10
11impl AutoParallelEngine {
12    /// Generate a deterministic UUID for a gate index to track dependencies
13    pub(super) fn generate_gate_dependency_uuid(gate_index: usize) -> Uuid {
14        let namespace =
15            Uuid::parse_str("6ba7b810-9dad-11d1-80b4-00c04fd430c8").unwrap_or_else(|_| Uuid::nil());
16        let mut bytes = [0u8; 16];
17        let index_bytes = gate_index.to_le_bytes();
18        bytes[0..8].copy_from_slice(&index_bytes);
19        Uuid::from_bytes(bytes)
20    }
21}