#[non_exhaustive]pub enum DmrgSweepError {
LengthMismatch {
mps: usize,
mpo: usize,
envs: usize,
},
TooFewSites {
n_sites: usize,
},
InvalidParams {
detail: &'static str,
},
MpsNotRightCanonical {
found: CanonicalForm,
},
Step {
sweep: usize,
direction: SweepDirection,
site: usize,
source: DmrgHeffError,
},
Env {
sweep: usize,
direction: SweepDirection,
site: usize,
source: DmrgEnvError,
},
Scale {
sweep: usize,
direction: SweepDirection,
site: usize,
source: LinalgError,
},
}Expand description
Errors raised by the 2-site DMRG sweep driver sweep_2site.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LengthMismatch
MPS, MPO, and DmrgEnvs disagree on n_sites.
Fields
TooFewSites
n_sites < 2. 2-site sweeps require at least 2 sites.
InvalidParams
DmrgSweepParams failed entry-point validation. detail
names the constraint that fired.
MpsNotRightCanonical
MPS canonical form was not Right or Mixed { center: 0 }.
Unknown is also rejected — see the module-level docs for
the rationale.
Fields
found: CanonicalFormThe canonical form actually found.
Step
The per-step driver (dmrg_2site_step or
dmrg_2site_step_block_sparse) returned an error. Source
preserved.
Fields
direction: SweepDirectionHalf-sweep direction at the failure.
source: DmrgHeffErrorThe underlying per-step error.
Env
DmrgEnvs::advance_left/right returned an error during a
post-step env update. Surfaced separately from Step so
the caller can distinguish “local solve failed” from “env
state became inconsistent”. Defense-in-depth — under the
driver’s own advance ordering, this branch should never
fire from the public API.
Fields
direction: SweepDirectionHalf-sweep direction at the failure.
source: DmrgEnvErrorThe underlying environment-advance error.
Scale
The post-step S-absorb (ariadnetor_linalg::diagonal_scale, which
dispatches over layout for both Dense and BlockSparse) failed.
Carries the same (sweep, direction, site)
breadcrumbs as Step / Env so the caller can pin down
where the failure occurred without having to walk the
DmrgResult::sweeps history manually.
Fields
direction: SweepDirectionHalf-sweep direction at the failure.
source: LinalgErrorThe underlying diagonal-scale (linalg) error.
Trait Implementations§
Source§impl Debug for DmrgSweepError
impl Debug for DmrgSweepError
Source§impl Display for DmrgSweepError
impl Display for DmrgSweepError
Source§impl Error for DmrgSweepError
impl Error for DmrgSweepError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<DmrgSweepError> for DmrgError
impl From<DmrgSweepError> for DmrgError
Source§fn from(source: DmrgSweepError) -> Self
fn from(source: DmrgSweepError) -> Self
Auto Trait Implementations§
impl Freeze for DmrgSweepError
impl RefUnwindSafe for DmrgSweepError
impl Send for DmrgSweepError
impl Sync for DmrgSweepError
impl Unpin for DmrgSweepError
impl UnsafeUnpin for DmrgSweepError
impl UnwindSafe for DmrgSweepError
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more