pub struct BlochLattice {
pub(super) dim: usize,
pub(super) direct: [[f64; 3]; 3],
pub(super) reciprocal: [[f64; 3]; 3],
pub(super) kpar: [f64; 3],
pub(super) measure: f64,
pub(super) direct_reduction: Option<Reduction>,
pub(super) reciprocal_reduction: Option<Reduction>,
}Expand description
Row lattice vectors, a real Bloch vector kpar and their reduced bases in one, two or
three dimensions.
They are bundled because their derivatives share one jet; treams passes the lattice
vectors a and the Bloch vector kpar separately.
The lattice vectors and the Bloch vector are given in the lattice frame: Cartesian components along the lattice’s axes, which are z for one-dimensional spherical sums, x for one-dimensional cylindrical sums, the xy plane in two dimensions and xyz in three. They are not fractional coordinates. Lattice-vector and Bloch derivatives use the same frame.
The constructor also reduces the direct and the reciprocal rows (reduce_basis),
over which the Ewald parts sum. A reduction is stored as None where the given rows
are already reduced, and then the parts sum over the given rows.
Fields§
§dim: usize§direct: [[f64; 3]; 3]Row vectors in lattice coordinates, zero outside the leading dim block.
reciprocal: [[f64; 3]; 3]Reciprocal rows with a_i · b_j = 2π δ_ij in the leading block.
kpar: [f64; 3]Bloch vector in the lattice frame, zero beyond the leading dim entries.
measure: f64§direct_reduction: Option<Reduction>Reduced basis of the direct rows for the real-space sum; None where the given
rows are already reduced (or need coefficients beyond 2^20), so the sum uses
them as they are.
reciprocal_reduction: Option<Reduction>Independently reduced basis of the reciprocal rows for the reciprocal sum; None
as for direct_reduction.
Implementations§
Source§impl BlochLattice
impl BlochLattice
Sourcepub fn new(vectors: &[Vec<f64>], kpar: &[f64]) -> Result<Self>
pub fn new(vectors: &[Vec<f64>], kpar: &[f64]) -> Result<Self>
Validate and precompute the reciprocal lattice. Rows are primitive vectors.
Sourcepub fn from_array(
vectors: [[f64; 3]; 3],
kpar: [f64; 3],
dim: usize,
) -> Result<Self>
pub fn from_array( vectors: [[f64; 3]; 3], kpar: [f64; 3], dim: usize, ) -> Result<Self>
Construct from fixed storage without allocating intermediate row vectors.
Only the leading dim block of vectors and the leading dim entries of kpar
count; the rest is stored as zero, so callers need not pad.
Source§impl BlochLattice
impl BlochLattice
Sourcepub(crate) const STATE_SIZE: usize = 474
pub(crate) const STATE_SIZE: usize = 474
Fixed geometry size; absent reductions occupy zero-filled slots.
pub(crate) fn write_state(&self, writer: &mut Writer)
pub(crate) fn read_state(reader: &mut Reader<'_>) -> Result<Self>
Trait Implementations§
Source§impl Clone for BlochLattice
impl Clone for BlochLattice
Source§fn clone(&self) -> BlochLattice
fn clone(&self) -> BlochLattice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BlochLattice
impl RefUnwindSafe for BlochLattice
impl Send for BlochLattice
impl Sync for BlochLattice
impl Unpin for BlochLattice
impl UnwindSafe for BlochLattice
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,
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§impl<T> Pointable for T
impl<T> Pointable for T
§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.