#[non_exhaustive]pub enum DmrgHeffError {
InvalidSite {
site: usize,
n_sites: usize,
},
StaleEnv {
side: &'static str,
index: usize,
},
LengthMismatch {
mps: usize,
mpo: usize,
envs: usize,
},
InvalidEigensolverParams {
detail: &'static str,
},
ShapeMismatch {
site: usize,
field: &'static str,
expected: usize,
actual: usize,
},
QnMismatch {
site: usize,
field: &'static str,
detail: String,
},
OrderMismatch {
operand: &'static str,
detail: String,
},
Contract(LinalgError),
Lanczos(LanczosError),
}Expand description
Errors raised by the 2-site DMRG step entry points
(dmrg_2site_step for the Dense path, and
dmrg_2site_step_block_sparse for the
BlockSparse / U(1) path; both crate-internal). Most variants are
produced by both; the
DmrgHeffError::QnMismatch variant is BlockSparse-specific
and only surfaces from the BlockSparse entry point’s QN /
Direction / sector / per-site-flux pre-validation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidSite
site + 1 was not a valid two-site index for the chain.
Fields
StaleEnv
The env slot required for the two-site step (left(site) for
the left side, right(site + 2) for the right side) was
None. Indicates the caller has not built / advanced the
envs into a state where this site can be optimized.
Fields
LengthMismatch
MPS and MPO chain lengths disagree, or disagree with the envs the function was given.
Fields
InvalidEigensolverParams
The selected eigensolver’s params (Lanczos or, behind the
arpack feature, ARPACK) violated their preconditions.
Surfaced here so callers see a fallible Result instead of
the underlying solver panic / upstream error.
ShapeMismatch
A bond / physical dimension on one of the inputs to the
2-site step did not match the expectation derived from the
surrounding tensors. Surfaced before the matvec runs so
the operator’s .expect calls can stay infallible. field
names the constraint that failed (e.g.,
"left.bot_ket vs mps[i].left_bond").
Fields
QnMismatch
A QNIndex / Direction / sector / per-site-flux compatibility
check on a BlockSparse 2-site step’s inputs failed. Surfaced
up front by dmrg_2site_step_block_sparse so the matvec
body’s .expect calls cannot fire on user input. field
names the leg pair (or single leg for MPO well-formedness
checks), and detail carries a human-readable summary of
the offending (sector list, direction, flux-if-applicable)
data on each side.
Fields
OrderMismatch
The layout MemoryOrder of one of the BlockSparse 2-site
step’s four contracted operands diverged from the host
substrate’s preferred_order(). Surfaced by
EffectiveHamiltonian2SiteBlockSparse::new
before any contract runs so the apply body’s .expect
calls cannot fire on a mixed-order operand set. operand
names which of the four contracted operands ("left_env",
"w_i", "w_ip1", "right_env") carried a non-matching
layout order, and detail carries a human-readable summary
of the offending vs expected layout order. The MPS sites
passed to new are template-derivation-only and not asserted
here; the psi template they derive is built in host order, so
the matvec stays self-consistent. detail holds a rendered
MemoryOrder to keep that layout type off the public error
surface (it is workspace-internal).
Fields
Contract(LinalgError)
An underlying ariadnetor linalg call (currently the truncated
SVD) failed. The matvec body itself is shape-validated up
front and never reaches this branch.
Lanczos(LanczosError)
The native Lanczos local eigensolver produced a non-finite
result (NaN/Inf eigenpair). Forwarded without information loss
from crate::krylov::LanczosError. Always present, since
Lanczos is the default eigensolver and is not feature-gated.
Trait Implementations§
Source§impl Debug for DmrgHeffError
impl Debug for DmrgHeffError
Source§impl Display for DmrgHeffError
impl Display for DmrgHeffError
Source§impl Error for DmrgHeffError
impl Error for DmrgHeffError
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<LanczosError> for DmrgHeffError
impl From<LanczosError> for DmrgHeffError
Source§fn from(source: LanczosError) -> Self
fn from(source: LanczosError) -> Self
Source§impl From<LinalgError> for DmrgHeffError
impl From<LinalgError> for DmrgHeffError
Source§fn from(source: LinalgError) -> Self
fn from(source: LinalgError) -> Self
Auto Trait Implementations§
impl Freeze for DmrgHeffError
impl RefUnwindSafe for DmrgHeffError
impl Send for DmrgHeffError
impl Sync for DmrgHeffError
impl Unpin for DmrgHeffError
impl UnsafeUnpin for DmrgHeffError
impl UnwindSafe for DmrgHeffError
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