Skip to main content

PackedOperatorModel

Struct PackedOperatorModel 

Source
pub struct PackedOperatorModel { /* private fields */ }
Expand description

Runtime-owned finite operator family independent of any local-basis representation.

This is the language-neutral model for operators supplied directly as dense or sparse matrices. A fixed part may be combined with named parameterized components, and every frontend operation evaluates the same family before applying, materializing, or solving it. Basis-aware local term assembly remains in PackedEdModel.

Implementations§

Source§

impl PackedOperatorModel

Source

pub fn new(static_part: Operator) -> Result<Self>

Construct a fixed square operator model.

Source

pub fn with_components( static_part: Operator, components: impl IntoIterator<Item = QuantumComponent>, ) -> Result<Self>

Construct a named operator family with an explicit fixed part.

Source

pub fn parameterized( components: impl IntoIterator<Item = QuantumComponent>, format: MatrixFormat, ) -> Result<Self>

Construct a purely parameterized operator family.

Source

pub fn dimension(&self) -> usize

Source

pub fn component_names(&self) -> impl Iterator<Item = &str>

Source

pub fn component_operator( &self, name: &str, format: MatrixFormat, ) -> Result<Operator>

Return one named component without evaluating the fixed part.

Source

pub fn component_archive( &self, formats: &HashMap<String, MatrixFormat>, ) -> Result<OperatorArchive>

Export the named part of this family as a storage-preserving archive.

Component formats may be selected independently. Names omitted from formats retain their current representation. Unknown names are rejected so a frontend typo cannot silently produce a different archive layout.

Source

pub fn from_component_archive( archive: OperatorArchive, static_format: MatrixFormat, ) -> Result<Self>

Reconstruct a basis-independent parameterized family from an archive.

Archived component formats are retained. The fixed part is the exact zero operator because OperatorArchive represents named families; fixed-plus-parameterized snapshots use a separate model archive contract.

Source

pub fn projected_by(&self, projector: &Operator) -> Result<Self>

Project the fixed part and every named component through the same rectangular map, preserving component names and default coefficients.

Source

pub fn from_blocks( blocks: impl IntoIterator<Item = Self>, format: MatrixFormat, ) -> Result<Self>

Assemble the direct sum of independent fixed or parameterized models.

Named components are combined by name and retain one shared coefficient contract, so the result can be evaluated, evolved, or exponentiated through the ordinary persistent-model API.

Source

pub fn from_projected_blocks( blocks: impl IntoIterator<Item = (Self, Operator)>, tolerance: f64, format: MatrixFormat, ) -> Result<Self>

Assemble a shared parent-space family from independently reduced sector models and their embedding projectors.

The result preserves the fixed part and the union of named components. Components with the same name are lifted from every sector into one parent-space operator; a sector which does not define that name contributes an exact zero block. Defaults for a shared name must agree, because one parameter value controls that physical component across all sectors.

Source

pub fn materialize( &self, parameters: &HashMap<String, Complex64>, format: MatrixFormat, ) -> Result<Operator>

Source

pub fn apply_batch( &self, parameters: &HashMap<String, Complex64>, inputs: &[Vec<Complex64>], action: OperatorAction, ) -> Result<Vec<Vec<Complex64>>>

Source

pub fn apply( &self, parameters: &HashMap<String, Complex64>, input: &[Complex64], output: &mut [Complex64], ) -> Result<()>

Apply one evaluated family member directly, without assembling its weighted sparse sum.

Source

pub fn apply_coefficients( &self, coefficients: &[Complex64], input: &[Complex64], output: &mut [Complex64], ) -> Result<()>

Apply ordered component coefficients directly. The order is exactly Self::component_names.

Source

pub fn time_operator<F>(&self, coefficients_at: F) -> Result<TimeOperator>
where F: Fn(f64, &mut [Complex64]) -> Result<()> + Send + Sync + 'static,

Construct a matrix-free time operator whose callback fills coefficients in the stable component order.

Source

pub fn time_operator_scaled<F>( &self, operator_scale: Complex64, coefficients_at: F, ) -> Result<TimeOperator>
where F: Fn(f64, &mut [Complex64]) -> Result<()> + Send + Sync + 'static,

Construct a scaled matrix-free time operator. The scale applies to the complete fixed-plus-parameterized family.

Source

pub fn evolve_time_dependent_batch<F>( &self, initial_columns: &[Vec<Complex64>], initial_time: f64, options: EvolutionOptions, coefficients_at: F, ) -> Result<StateBatchTrajectory>
where F: Fn(f64, &mut [Complex64]) -> Result<()> + Send + Sync + 'static,

Evolve a batch while evaluating named component coefficients at the integrator’s internal physical times.

Source

pub fn evolve_time_dependent_batch_scaled<F>( &self, initial_columns: &[Vec<Complex64>], initial_time: f64, options: EvolutionOptions, operator_scale: Complex64, coefficients_at: F, ) -> Result<StateBatchTrajectory>
where F: Fn(f64, &mut [Complex64]) -> Result<()> + Send + Sync + 'static,

Source

pub fn eigh( &self, parameters: &HashMap<String, Complex64>, options: EighOptions, ) -> Result<Eigensystem>

Source

pub fn eigsh( &self, parameters: &HashMap<String, Complex64>, format: MatrixFormat, options: EigshOptions, ) -> Result<Eigensystem>

Source

pub fn eigsh_with_initial( &self, parameters: &HashMap<String, Complex64>, format: MatrixFormat, options: EigshOptions, initial: &[Complex64], ) -> Result<Eigensystem>

Source

pub fn evolve_batch( &self, parameters: &HashMap<String, Complex64>, initial_columns: &[Vec<Complex64>], options: EvolutionOptions, ) -> Result<StateBatchTrajectory>

Trait Implementations§

Source§

impl Clone for PackedOperatorModel

Source§

fn clone(&self) -> PackedOperatorModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PackedOperatorModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,