pub struct SpecializedGpuKernels { /* private fields */ }Expand description
Enhanced GPU kernel manager for specialized gates
Implementations§
Source§impl SpecializedGpuKernels
impl SpecializedGpuKernels
Sourcepub fn new(config: OptimizationConfig) -> QuantRS2Result<Self>
pub fn new(config: OptimizationConfig) -> QuantRS2Result<Self>
Create a new specialized GPU kernel manager
Sourcepub fn apply_holonomic_gate(
&self,
state: &mut [Complex64],
holonomy_matrix: &[Complex64],
target_qubits: &[QubitId],
) -> QuantRS2Result<()>
pub fn apply_holonomic_gate( &self, state: &mut [Complex64], holonomy_matrix: &[Complex64], target_qubits: &[QubitId], ) -> QuantRS2Result<()>
Apply a holonomic (unitary) gate to the targeted qubits.
Dispatches to a GPU kernel when a specialized GPU context is available;
otherwise computes the result on the CPU. The CPU path is a real
matrix-vector application over the targeted-qubit subspace (it is not a
no-op). Because the specialized GPU gate kernels are still DEFERRED, the
GPU contexts are currently None, so this resolves to the CPU path —
which performs the genuine computation.
Sourcepub fn apply_post_quantum_hash_gate(
&self,
_state: &mut [Complex64],
_hash_circuit: &[Complex64],
compression_type: PostQuantumCompressionType,
) -> QuantRS2Result<()>
pub fn apply_post_quantum_hash_gate( &self, _state: &mut [Complex64], _hash_circuit: &[Complex64], compression_type: PostQuantumCompressionType, ) -> QuantRS2Result<()>
Apply a post-quantum cryptographic hash gate.
These compression schemes (quantum sponge / Merkle tree / Grover) are
implemented as GPU device kernels that are not yet authored, and they
have no defined CPU reference here. Rather than silently returning
success without touching state (the previous fabricated behavior), this
returns an honest error. DEFERRED until the real kernels exist.
Sourcepub fn apply_quantum_ml_attention(
&self,
_state: &mut [Complex64],
_query_params: &[Complex64],
_key_params: &[Complex64],
_value_params: &[Complex64],
_num_heads: usize,
) -> QuantRS2Result<()>
pub fn apply_quantum_ml_attention( &self, _state: &mut [Complex64], _query_params: &[Complex64], _key_params: &[Complex64], _value_params: &[Complex64], _num_heads: usize, ) -> QuantRS2Result<()>
Apply a quantum ML attention mechanism.
The specialized attention kernels (CUDA/WebGPU) are not yet authored and
there is no defined CPU reference for the previously no-op fallback.
Returns an honest error rather than silently returning success without
transforming state. DEFERRED until the real kernels exist.
Sourcepub fn apply_fused_gate_sequence(
&self,
state: &mut [Complex64],
gates: &[Box<dyn GateOp>],
) -> QuantRS2Result<()>
pub fn apply_fused_gate_sequence( &self, state: &mut [Complex64], gates: &[Box<dyn GateOp>], ) -> QuantRS2Result<()>
Apply a sequence of gates to the state vector.
Each gate is applied with a real matrix-vector update on the CPU via
[apply_single_gate_optimized]. Gate fusion (merging adjacent gates
into a single combined matrix for fewer passes) is DEFERRED:
[analyze_gate_fusion_opportunities] currently finds no chains, so this
reduces to honest per-gate application. The result is numerically
correct; only the fused-pass optimization is missing.
Sourcepub fn get_performance_report(&self) -> PerformanceReport
pub fn get_performance_report(&self) -> PerformanceReport
Get performance report
Auto Trait Implementations§
impl Freeze for SpecializedGpuKernels
impl RefUnwindSafe for SpecializedGpuKernels
impl Send for SpecializedGpuKernels
impl Sync for SpecializedGpuKernels
impl Unpin for SpecializedGpuKernels
impl UnsafeUnpin for SpecializedGpuKernels
impl UnwindSafe for SpecializedGpuKernels
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.