Skip to main content

ResolvedModel

Struct ResolvedModel 

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

A validated Hamiltonian together with the physical inputs that resolved it.

The operator representation is useful for matrix and local-energy work, while this wrapper keeps the model family, simulation basis, weighted pair identities, and site parameters available for provenance and inspection.

Implementations§

Source§

impl ResolvedModel

Source

pub const fn hamiltonian(&self) -> &Hamiltonian

Return the resolved operator Hamiltonian.

Source

pub const fn family(&self) -> &'static str

Return the stable model-family identifier.

Source

pub const fn basis(&self) -> SimulationBasis

Return the simulation basis used by the builder.

Source

pub fn interactions(&self) -> &[WeightedInteraction]

Return all resolved weighted interactions, including zero coefficients.

Source

pub fn with_physical_constant( self, constant: f64, ) -> Result<ResolvedModel, ModelError>

Return a copy of this model with the supplied real physical constant.

Model constructors use a zero constant because their named parameters describe non-identity terms. Durable configuration adapters can apply an explicitly serialized constant through this method without rebuilding or reinterpreting the operator terms.

Source

pub const fn specification(&self) -> &ModelSpecification

Return the original typed physical specification.

Methods from Deref<Target = Hamiltonian>§

Source

pub fn site_count(&self) -> SiteCount

Number of sites represented by the Hamiltonian.

Source

pub fn constant(&self) -> Complex<f64>

Return the physical scalar constant.

Source

pub fn terms(&self) -> &[(Complex<f64>, PauliString)]

Return deterministic coefficient/operator terms.

Source

pub fn apply( &self, state: &BasisState, ) -> Result<Vec<(BasisState, Complex<f64>)>, OperatorError>

Apply the Hamiltonian and combine duplicate connected states.

Source

pub fn local_energy( &self, state: &BasisState, amplitudes: &[(BasisState, Complex<f64>)], ) -> Result<Complex<f64>, OperatorError>

Evaluate sum_b H_ab psi_b / psi_a from an explicit amplitude table.

Trait Implementations§

Source§

impl Clone for ResolvedModel

Source§

fn clone(&self) -> ResolvedModel

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 ResolvedModel

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Deref for ResolvedModel

Source§

type Target = Hamiltonian

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<ResolvedModel as Deref>::Target

Dereferences the value.
Source§

impl PartialEq for ResolvedModel

Source§

fn eq(&self, other: &ResolvedModel) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResolvedModel

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
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V