Skip to main content

quantrs2_sim/automatic_parallelization/
autoparallelengine_estimate_gate_cost_group.rs

1//! # AutoParallelEngine - estimate_gate_cost_group Methods
2//!
3//! This module contains method implementations for `AutoParallelEngine`.
4//!
5//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
6
7use super::autoparallelengine_type::AutoParallelEngine;
8use quantrs2_core::gate::GateOp;
9
10impl AutoParallelEngine {
11    /// Estimate execution cost for a gate
12    pub(super) fn estimate_gate_cost(gate: &dyn GateOp) -> f64 {
13        match gate.num_qubits() {
14            1 => 1.0,
15            2 => 4.0,
16            3 => 8.0,
17            n => (2.0_f64).powi(n as i32),
18        }
19    }
20}