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
impl PackedOperatorModel
Sourcepub fn with_components(
static_part: Operator,
components: impl IntoIterator<Item = QuantumComponent>,
) -> Result<Self>
pub fn with_components( static_part: Operator, components: impl IntoIterator<Item = QuantumComponent>, ) -> Result<Self>
Construct a named operator family with an explicit fixed part.
Sourcepub fn parameterized(
components: impl IntoIterator<Item = QuantumComponent>,
format: MatrixFormat,
) -> Result<Self>
pub fn parameterized( components: impl IntoIterator<Item = QuantumComponent>, format: MatrixFormat, ) -> Result<Self>
Construct a purely parameterized operator family.
pub fn dimension(&self) -> usize
pub fn component_names(&self) -> impl Iterator<Item = &str>
Sourcepub fn component_operator(
&self,
name: &str,
format: MatrixFormat,
) -> Result<Operator>
pub fn component_operator( &self, name: &str, format: MatrixFormat, ) -> Result<Operator>
Return one named component without evaluating the fixed part.
Sourcepub fn component_archive(
&self,
formats: &HashMap<String, MatrixFormat>,
) -> Result<OperatorArchive>
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.
Sourcepub fn from_component_archive(
archive: OperatorArchive,
static_format: MatrixFormat,
) -> Result<Self>
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.
Sourcepub fn projected_by(&self, projector: &Operator) -> Result<Self>
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.
Sourcepub fn from_blocks(
blocks: impl IntoIterator<Item = Self>,
format: MatrixFormat,
) -> Result<Self>
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.
Sourcepub fn from_projected_blocks(
blocks: impl IntoIterator<Item = (Self, Operator)>,
tolerance: f64,
format: MatrixFormat,
) -> Result<Self>
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.
pub fn materialize( &self, parameters: &HashMap<String, Complex64>, format: MatrixFormat, ) -> Result<Operator>
pub fn apply_batch( &self, parameters: &HashMap<String, Complex64>, inputs: &[Vec<Complex64>], action: OperatorAction, ) -> Result<Vec<Vec<Complex64>>>
Sourcepub fn apply(
&self,
parameters: &HashMap<String, Complex64>,
input: &[Complex64],
output: &mut [Complex64],
) -> Result<()>
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.
Sourcepub fn apply_coefficients(
&self,
coefficients: &[Complex64],
input: &[Complex64],
output: &mut [Complex64],
) -> Result<()>
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.
Sourcepub fn time_operator<F>(&self, coefficients_at: F) -> Result<TimeOperator>
pub fn time_operator<F>(&self, coefficients_at: F) -> Result<TimeOperator>
Construct a matrix-free time operator whose callback fills coefficients in the stable component order.
Sourcepub fn time_operator_scaled<F>(
&self,
operator_scale: Complex64,
coefficients_at: F,
) -> Result<TimeOperator>
pub fn time_operator_scaled<F>( &self, operator_scale: Complex64, coefficients_at: F, ) -> Result<TimeOperator>
Construct a scaled matrix-free time operator. The scale applies to the complete fixed-plus-parameterized family.
Sourcepub fn evolve_time_dependent_batch<F>(
&self,
initial_columns: &[Vec<Complex64>],
initial_time: f64,
options: EvolutionOptions,
coefficients_at: F,
) -> Result<StateBatchTrajectory>
pub fn evolve_time_dependent_batch<F>( &self, initial_columns: &[Vec<Complex64>], initial_time: f64, options: EvolutionOptions, coefficients_at: F, ) -> Result<StateBatchTrajectory>
Evolve a batch while evaluating named component coefficients at the integrator’s internal physical times.
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>
pub fn eigh( &self, parameters: &HashMap<String, Complex64>, options: EighOptions, ) -> Result<Eigensystem>
pub fn eigsh( &self, parameters: &HashMap<String, Complex64>, format: MatrixFormat, options: EigshOptions, ) -> Result<Eigensystem>
pub fn eigsh_with_initial( &self, parameters: &HashMap<String, Complex64>, format: MatrixFormat, options: EigshOptions, initial: &[Complex64], ) -> Result<Eigensystem>
pub fn evolve_batch( &self, parameters: &HashMap<String, Complex64>, initial_columns: &[Vec<Complex64>], options: EvolutionOptions, ) -> Result<StateBatchTrajectory>
Trait Implementations§
Source§impl Clone for PackedOperatorModel
impl Clone for PackedOperatorModel
Source§fn clone(&self) -> PackedOperatorModel
fn clone(&self) -> PackedOperatorModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PackedOperatorModel
impl RefUnwindSafe for PackedOperatorModel
impl Send for PackedOperatorModel
impl Sync for PackedOperatorModel
impl Unpin for PackedOperatorModel
impl UnsafeUnpin for PackedOperatorModel
impl UnwindSafe for PackedOperatorModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.