pub struct QuantumLayerConfig {
pub circuit: Circuit,
pub observables: Vec<Observable>,
pub initial: Vec<f64>,
pub limits: ResourceLimits,
}Expand description
Serializable Burn configuration, stored alongside the layer’s weight record.
Fields§
§circuit: CircuitValidated circuit structure.
observables: Vec<Observable>Ordered Hermitian readouts. May be empty for state/probability losses.
initial: Vec<f64>Explicit initialization values, one per circuit parameter.
limits: ResourceLimitsSimulator allocation budgets.
Implementations§
Source§impl QuantumLayerConfig
impl QuantumLayerConfig
Sourcepub fn new(
circuit: Circuit,
observables: Vec<Observable>,
initial: Vec<f64>,
) -> Self
pub fn new( circuit: Circuit, observables: Vec<Observable>, initial: Vec<f64>, ) -> Self
Create a new instance of the config.
§Arguments
§Required Arguments
§circuit
Validated circuit structure.
§observables
Ordered Hermitian readouts. May be empty for state/probability losses.
§initial
Explicit initialization values, one per circuit parameter.
§Default Arguments
§limits
Simulator allocation budgets.
- Defaults to
"ResourceLimits::default()"
Source§impl QuantumLayerConfig
impl QuantumLayerConfig
Sourcepub fn with_limits(self, limits: ResourceLimits) -> Self
pub fn with_limits(self, limits: ResourceLimits) -> Self
Sets the value for the field limits.
Simulator allocation budgets.
- Defaults to
"ResourceLimits::default()"
Source§impl QuantumLayerConfig
impl QuantumLayerConfig
Sourcepub fn init(&self, device: &Device) -> QuantumResult<QuantumLayer>
pub fn init(&self, device: &Device) -> QuantumResult<QuantumLayer>
Initialize native Burn parameters on the chosen device.
Trait Implementations§
Source§impl Clone for QuantumLayerConfig
impl Clone for QuantumLayerConfig
Source§impl Config for QuantumLayerConfig
impl Config for QuantumLayerConfig
Source§fn load<P>(file: P) -> Result<Self, ConfigError>
fn load<P>(file: P) -> Result<Self, ConfigError>
Loads the configuration from a file. Read more
Source§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
Source§impl Debug for QuantumLayerConfig
impl Debug for QuantumLayerConfig
Source§impl<'de> Deserialize<'de> for QuantumLayerConfig
impl<'de> Deserialize<'de> for QuantumLayerConfig
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for QuantumLayerConfig
impl Display for QuantumLayerConfig
Auto Trait Implementations§
impl Forget for QuantumLayerConfig
impl Freeze for QuantumLayerConfig
impl RefUnwindSafe for QuantumLayerConfig
impl Send for QuantumLayerConfig
impl Sync for QuantumLayerConfig
impl Unpin for QuantumLayerConfig
impl UnsafeUnpin for QuantumLayerConfig
impl UnwindSafe for QuantumLayerConfig
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.