1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! DMRG (Density Matrix Renormalization Group) algorithm primitives.
//!
//! Exposes the environment-tensor data structure ([`DmrgEnvs`],
//! generic over a [`DmrgEnvOps`]-implementing layout type so the
//! same struct serves Dense and BlockSparse chains) and a single
//! layout-generic 2-site sweep driver [`sweep_2site`] dispatched
//! over [`DmrgOps`] so one call site covers both the Dense and
//! BlockSparse / U(1) paths. Internally the driver runs a local
//! 2-site update step in two parallel forms (Dense and BlockSparse /
//! U(1)) — effective Hamiltonian + local-eigensolver drive (Lanczos
//! by default, ARPACK behind the `arpack` feature; the BlockSparse
//! path reuses the Dense Krylov family through a flat-buffer adapter)
//! plus a truncated-SVD split — but these per-step primitives are
//! crate-internal, not part of the exposed surface. The driver shares
//! `DmrgSweepParams`, `DmrgSweepError`, `DmrgResult`,
//! `DmrgSweepRecord`, `DmrgStepRecord`, and `SweepDirection`.
//!
//! For non-expert callers, [`dmrg_2site`] wraps the low-level driver
//! with defensive `psi0.clone()`, automatic canonicalization to
//! `Mixed { center: 0 }`, and a fresh [`DmrgEnvs::build`], reporting
//! its own [`DmrgError`] that subsumes empty / length-mismatch input
//! and forwards underlying env / sweep failures.
pub use ;
pub use ;
pub use TwoSiteStepResult;
pub use TwoSiteStepResultBlockSparse;
pub use DmrgHeffError;
pub use LocalEigensolverParams;
pub use ;
pub use ;