Skip to main content

quantrs2_ml/torchquantum/layer/
tqefficientsu2layer_traits.rs

1//! # TQEfficientSU2Layer - Trait Implementations
2//!
3//! This module contains trait implementations for `TQEfficientSU2Layer`.
4//!
5//! ## Implemented Traits
6//!
7//! - `TQModule`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use crate::error::{MLError, Result};
12use crate::torchquantum::{TQDevice, TQModule, TQOperator, TQParameter};
13
14use super::functions::{create_single_qubit_gate, create_two_qubit_gate};
15use super::types::TQEfficientSU2Layer;
16
17impl TQModule for TQEfficientSU2Layer {
18    fn forward(&mut self, qdev: &mut TQDevice) -> Result<()> {
19        self.inner.forward(qdev)
20    }
21    fn parameters(&self) -> Vec<TQParameter> {
22        self.inner.parameters()
23    }
24    fn n_wires(&self) -> Option<usize> {
25        self.inner.n_wires()
26    }
27    fn set_n_wires(&mut self, n_wires: usize) {
28        self.inner.set_n_wires(n_wires);
29    }
30    fn is_static_mode(&self) -> bool {
31        self.inner.is_static_mode()
32    }
33    fn static_on(&mut self) {
34        self.inner.static_on();
35    }
36    fn static_off(&mut self) {
37        self.inner.static_off();
38    }
39    fn name(&self) -> &str {
40        "EfficientSU2Layer"
41    }
42    fn zero_grad(&mut self) {
43        self.inner.zero_grad();
44    }
45}