![]() |
QMCPACK
|
a class that defines a supercell in D-dimensional Euclean space. More...
Public Types | |
enum | { DIM = D } |
enumeration for the dimension of the lattice More... | |
using | Base = LRBreakupParameters< T, D > |
alias to the base class More... | |
using | Scalar_t = T |
the type of scalar More... | |
using | SingleParticlePos = TinyVector< T, D > |
the type of a D-dimensional position vector More... | |
using | SingleParticleIndex = TinyVector< int, D > |
the type of a D-dimensional index vector More... | |
using | Tensor_t = Tensor< T, D > |
the type of a D-dimensional Tensor More... | |
Public Member Functions | |
CrystalLattice () | |
default constructor, assign a huge supercell More... | |
SingleParticlePos | a (int i) const |
Provide interfaces familiar to fotran users. More... | |
SingleParticlePos | b (int i) const |
Provide interfaces familiar to fotran users. More... | |
template<class T1 > | |
SingleParticlePos | toUnit (const TinyVector< T1, D > &r) const |
Convert a cartesian vector to a unit vector. More... | |
template<class T1 > | |
SingleParticlePos | toUnit_floor (const TinyVector< T1, D > &r) const |
template<class T1 > | |
SingleParticlePos | toCart (const TinyVector< T1, D > &c) const |
Convert a unit vector to a cartesian vector. More... | |
bool | isValid (const TinyVector< T, D > &u) const |
return true if all the open direction of reduced coordinates u are in the range [0,1) More... | |
bool | outOfBound (const TinyVector< T, D > &u) const |
return true if any direction of reduced coordinates u goes larger than 0.5 More... | |
void | applyMinimumImage (TinyVector< T, D > &c) const |
T | Dot (const SingleParticlePos &ra, const SingleParticlePos &rb) const |
evaluate the cartesian distance More... | |
SingleParticlePos | k_cart (const SingleParticlePos &kin) const |
conversion of a reciprocal-vector More... | |
SingleParticlePos | k_unit (const SingleParticlePos &kin) const |
conversion of a caresian reciprocal-vector to unit k-vector More... | |
T | ksq (const SingleParticlePos &kin) const |
evaluate ![]() | |
template<typename T1 > | |
CrystalLattice< T, D > & | operator= (const CrystalLattice< T1, D > &rhs) |
assignment operator More... | |
CrystalLattice< T, D > & | operator*= (T sc) |
scale the lattice vectors by sc. More... | |
template<class TT > | |
void | set (const Tensor< TT, D > &lat) |
set the lattice vector from the command-line options More... | |
void | reset () |
Evaluate the reciprocal vectors, volume and metric tensor. More... | |
void | print (std::ostream &, int level=2) const |
Print out CrystalLattice Data. More... | |
Public Attributes | |
bool | DiagonalOnly |
true, if off-diagonal elements are zero so that other classes can take advantage of this More... | |
int | SuperCellEnum |
supercell enumeration More... | |
TinyVector< int, D > | BoxBConds |
The boundary condition in each direction. More... | |
T | VacuumScale |
The scale factor for adding vacuum. More... | |
SingleParticlePos | ABC |
bool | explicitly_defined |
true, the lattice is defined by the input instead of an artificial default More... | |
Scalar_t | Volume |
Physical properties of a supercell. More... | |
Scalar_t | WignerSeitzRadius |
Wigner-Seitz cell radius. More... | |
Scalar_t | SimulationCellRadius |
simulation cell radii More... | |
Scalar_t | CellRadiusSq |
SimulationCellRadius*SimulationCellRadius. More... | |
Scalar_t | WignerSeitzRadius_G |
Wigner-Seitz cell radius in reciprocal space. More... | |
Tensor_t | R |
Real-space unit vectors. R(i,j) i=vector and j=x,y,z. More... | |
Tensor_t | G |
Reciprocal unit vectors. G(j,i) i=vector and j=x,y,z. More... | |
Tensor_t | Gt |
Transpose of reciprocal unit vectors: More... | |
Tensor_t | M |
Metric tensor. More... | |
Tensor_t | Mg |
Metric tensor for G vectors. More... | |
SingleParticlePos | Length |
Length[idim] length of the idim-th lattice vector. More... | |
SingleParticlePos | OneOverLength |
OneOverLength[idim] 1/length of the idim-th lattice vector. More... | |
SingleParticlePos | Center |
Center of the cell sum(Rv[i])/2. More... | |
TinyVector< SingleParticlePos, D > | Rv |
Real-space unit vectors. More... | |
TinyVector< SingleParticlePos, D > | Gv |
Reciprocal unit vectors. More... | |
a class that defines a supercell in D-dimensional Euclean space.
CrystalLattice handles the physical properties of a supercell, such as lattice vectors, reciprocal vectors and metric tensors and provides interfaces to access the lattice properties and convert units of position vectors or a single-particle position from Cartesian to Lattice Unit vice versa.
Definition at line 55 of file CrystalLattice.h.
using Base = LRBreakupParameters<T, D> |
alias to the base class
Definition at line 58 of file CrystalLattice.h.
using Scalar_t = T |
the type of scalar
Definition at line 67 of file CrystalLattice.h.
using SingleParticleIndex = TinyVector<int, D> |
the type of a D-dimensional index vector
Definition at line 71 of file CrystalLattice.h.
using SingleParticlePos = TinyVector<T, D> |
the type of a D-dimensional position vector
Definition at line 69 of file CrystalLattice.h.
the type of a D-dimensional Tensor
Definition at line 73 of file CrystalLattice.h.
anonymous enum |
enumeration for the dimension of the lattice
Enumerator | |
---|---|
DIM |
Definition at line 61 of file CrystalLattice.h.
CrystalLattice | ( | ) |
default constructor, assign a huge supercell
Default constructor. Initialized to a 1x1x1
cubic supercell.
Definition at line 29 of file CrystalLattice.cpp.
|
inline |
Provide interfaces familiar to fotran users.
i | the index of the directional vector, ![]() |
Definition at line 137 of file CrystalLattice.h.
Referenced by DTD_BConds< T, 3, PPPG >::DTD_BConds(), DTD_BConds< T, 3, PPNG >::DTD_BConds(), DTD_BConds< T, 3, PPPG+SOA_OFFSET >::DTD_BConds(), and DTD_BConds< T, 3, PPNG+SOA_OFFSET >::DTD_BConds().
|
inline |
Definition at line 194 of file CrystalLattice.h.
|
inline |
Provide interfaces familiar to fotran users.
i | the index of the directional vector, ![]() |
Definition at line 143 of file CrystalLattice.h.
|
inline |
evaluate the cartesian distance
ra | a vector in the supercell unit |
rb | a vector in the supercell unit |
Definition at line 213 of file CrystalLattice.h.
|
inline |
return true if all the open direction of reduced coordinates u are in the range [0,1)
Definition at line 177 of file CrystalLattice.h.
Referenced by ParticleSet::makeMoveAllParticles(), ParticleSet::makeMoveAllParticlesWithDrift(), ParticleSet::makeMoveAndCheck(), and qmcplusplus::TEST_CASE().
|
inline |
conversion of a reciprocal-vector
kin | an input reciprocal vector in the Reciprocal-vector unit |
Definition at line 219 of file CrystalLattice.h.
Referenced by EinsplineSetBuilder::AnalyzeTwists2(), BsplineReader::check_twists(), Gvectors< ST, LT >::Gvectors(), BsplineReader::initialize_spo2band(), MomentumDistribution::MomentumDistribution(), MomentumEstimator::putSpecial(), PWBasis::readbasis(), and PWBasis::trimforecut().
|
inline |
conversion of a caresian reciprocal-vector to unit k-vector
kin | an input reciprocal vector in cartesian form |
Definition at line 225 of file CrystalLattice.h.
|
inline |
evaluate
kin | an input reciprocal vector in reciprocal-vector unit |
Definition at line 232 of file CrystalLattice.h.
CrystalLattice< T, D > & operator*= | ( | T | sc | ) |
scale the lattice vectors by sc.
Rescale this supercell by a scalar.
All the internal data are reset.
sc | the scaling value |
sc | A scaling factor. |
Definition at line 95 of file CrystalLattice.cpp.
|
inline |
assignment operator
Definition at line 236 of file CrystalLattice.h.
|
inline |
return true if any direction of reduced coordinates u goes larger than 0.5
Definition at line 186 of file CrystalLattice.h.
Referenced by ParticleSet::makeMoveAllParticles(), ParticleSet::makeMoveAllParticlesWithDrift(), ParticleSet::makeMoveAndCheck(), and qmcplusplus::TEST_CASE().
void print | ( | std::ostream & | os, |
int | level = 2 |
||
) | const |
Print out CrystalLattice Data.
Definition at line 103 of file CrystalLattice.cpp.
Referenced by SimulationCell::resetLRBox().
void reset | ( | ) |
Evaluate the reciprocal vectors, volume and metric tensor.
Definition at line 51 of file CrystalLattice.cpp.
Referenced by OneBodyDensityMatrices::OneBodyDensityMatrices(), CrystalLattice< ST, 3 >::operator=(), SimulationCell::resetLRBox(), and qmcplusplus::TEST_CASE().
void set | ( | const Tensor< TT, D > & | lat | ) |
set the lattice vector from the command-line options
lat | a tensor representing a supercell |
Definition at line 43 of file CrystalLattice.cpp.
Referenced by InitMolecularSystem::initWithVolume(), LatticeParser::put(), SpinDensity::put(), OrbitalImages::put(), EinsplineSetBuilder::ReadOrbitalInfo_ESHDF(), SpinDensityInput::readXML(), and EinsplineSetBuilder::set_metadata().
|
inline |
Convert a unit vector to a cartesian vector.
Boundary conditions are not applied.
Definition at line 171 of file CrystalLattice.h.
Referenced by MomentumDistribution::accumulate(), MomentumEstimator::evaluate(), OrbitalImages::evaluate(), OneBodyDensityMatrices::generateUniformGrid(), OneBodyDensityMatrices::generateUniformSamples(), and OneBodyDensityMatrices::normalizeBasis().
|
inline |
Convert a cartesian vector to a unit vector.
Boundary conditions are not applied.
Definition at line 149 of file CrystalLattice.h.
Referenced by SpinDensityNew::accumulate(), MagnetizationDensity::computeBin(), SplineR2R< ST >::convertPos(), SpinDensity::evaluate(), ParticleSet::makeMoveAllParticles(), ParticleSet::makeMoveAllParticlesWithDrift(), ParticleSet::makeMoveAndCheck(), SpinDensity::test_evaluate(), and CrystalLattice< ST, 3 >::toUnit_floor().
|
inline |
Definition at line 155 of file CrystalLattice.h.
Referenced by EinsplineSetBuilder::ReadOrbitalInfo_ESHDF().
Definition at line 126 of file CrystalLattice.h.
TinyVector<int, D> BoxBConds |
The boundary condition in each direction.
Definition at line 81 of file CrystalLattice.h.
Referenced by LatticeXMLWriter::get(), CrystalLattice< ST, 3 >::isValid(), CrystalLattice< ST, 3 >::operator=(), LatticeParser::put(), and qmcplusplus::TEST_CASE().
Scalar_t CellRadiusSq |
SimulationCellRadius*SimulationCellRadius.
Definition at line 93 of file CrystalLattice.h.
SingleParticlePos Center |
Center of the cell sum(Rv[i])/2.
Definition at line 111 of file CrystalLattice.h.
Referenced by MagnetizationDensity::MagnetizationDensity(), OneBodyDensityMatrices::OneBodyDensityMatrices(), SpinDensity::put(), OrbitalImages::put(), SpinDensity::report(), SpinDensityNew::report(), and OrbitalImages::report().
bool DiagonalOnly |
true, if off-diagonal elements are zero so that other classes can take advantage of this
Definition at line 77 of file CrystalLattice.h.
bool explicitly_defined |
true, the lattice is defined by the input instead of an artificial default
Definition at line 128 of file CrystalLattice.h.
Referenced by ParticleSet::createSK(), ParticleSet::makeMoveAllParticles(), ParticleSet::makeMoveAllParticlesWithDrift(), ParticleSet::makeMoveAndCheck(), CrystalLattice< ST, 3 >::operator=(), EstimatorManagerNew::put(), SpinDensityNew::SpinDensityNew(), and qmcplusplus::TEST_CASE().
Tensor_t G |
Reciprocal unit vectors. G(j,i) i=vector and j=x,y,z.
Definition at line 99 of file CrystalLattice.h.
Referenced by CrystalLattice< ST, 3 >::applyMinimumImage(), SplineR2R< ST >::create_spline(), DTD_BConds< T, 3, PPNG >::DTD_BConds(), DTD_BConds< T, 3, PPNG+SOA_OFFSET >::DTD_BConds(), SplineC2COMPTarget< ST >::finalizeConstruction(), SplineC2ROMPTarget< ST >::finalizeConstruction(), CrystalLattice< ST, 3 >::k_cart(), EinsplineSetBuilder::set_metadata(), and CrystalLattice< ST, 3 >::toUnit().
Tensor_t Gt |
Transpose of reciprocal unit vectors:
Definition at line 101 of file CrystalLattice.h.
TinyVector<SingleParticlePos, D> Gv |
Reciprocal unit vectors.
Introduced to efficiently return one vector at a time. Gv[i] is D-dim vector of the ith direction.
Definition at line 123 of file CrystalLattice.h.
Referenced by CrystalLattice< ST, 3 >::b(), and MomentumDistribution::MomentumDistribution().
SingleParticlePos Length |
Length[idim] length of the idim-th lattice vector.
Definition at line 107 of file CrystalLattice.h.
Tensor_t M |
Metric tensor.
Definition at line 103 of file CrystalLattice.h.
Referenced by CrystalLattice< ST, 3 >::Dot().
Tensor_t Mg |
Metric tensor for G vectors.
Definition at line 105 of file CrystalLattice.h.
Referenced by CrystalLattice< ST, 3 >::ksq().
SingleParticlePos OneOverLength |
OneOverLength[idim] 1/length of the idim-th lattice vector.
Definition at line 109 of file CrystalLattice.h.
Tensor_t R |
Real-space unit vectors. R(i,j) i=vector and j=x,y,z.
Definition at line 97 of file CrystalLattice.h.
Referenced by CrystalLattice< ST, 3 >::applyMinimumImage(), LatticeXMLWriter::createNode(), LatticeXMLWriter::get(), CrystalLattice< ST, 3 >::k_unit(), CrystalLattice< ST, 3 >::operator=(), qmcplusplus::operator==(), SimulationCell::resetLRBox(), qmcplusplus::TEST_CASE(), and CrystalLattice< ST, 3 >::toCart().
TinyVector<SingleParticlePos, D> Rv |
Real-space unit vectors.
Introduced to efficiently return one vector at a time. Rv[i] is D-dim vector of the ith direction.
Definition at line 117 of file CrystalLattice.h.
Referenced by CrystalLattice< ST, 3 >::a(), SpinDensity::put(), SpinDensity::report(), SpinDensityNew::report(), OrbitalImages::report(), SimulationCell::resetLRBox(), qmcplusplus::TEST_CASE(), and OrbitalImages::write_orbital_xsf().
Scalar_t SimulationCellRadius |
simulation cell radii
Definition at line 91 of file CrystalLattice.h.
Referenced by LatticeParser::put().
int SuperCellEnum |
supercell enumeration
Definition at line 79 of file CrystalLattice.h.
Referenced by CrystalLattice< ST, 3 >::applyMinimumImage(), ParticleSet::createSK(), OneBodyDensityMatrices::OneBodyDensityMatrices(), LatticeParser::put(), SimulationCell::resetLRBox(), and qmcplusplus::TEST_CASE().
T VacuumScale |
The scale factor for adding vacuum.
Definition at line 83 of file CrystalLattice.h.
Referenced by CrystalLattice< ST, 3 >::operator=(), LatticeParser::put(), SimulationCell::resetLRBox(), and qmcplusplus::TEST_CASE().
Scalar_t Volume |
Physical properties of a supercell.
Volume of a supercell
Definition at line 87 of file CrystalLattice.h.
Referenced by LPQHIBasis::Dminus(), LPQHISRCoulombBasis::Dminus(), LPQHISRCoulombBasis::Dminus_dG(), LPQHIBasis::Dplus(), LPQHISRCoulombBasis::Dplus(), LPQHISRCoulombBasis::Dplus_dG(), LRBasis::get_CellVolume(), MomentumDistribution::MomentumDistribution(), OneBodyDensityMatrices::OneBodyDensityMatrices(), and qmcplusplus::TEST_CASE().
Scalar_t WignerSeitzRadius |
Wigner-Seitz cell radius.
Definition at line 89 of file CrystalLattice.h.
Referenced by LatticeParser::put().
Scalar_t WignerSeitzRadius_G |
Wigner-Seitz cell radius in reciprocal space.
Definition at line 95 of file CrystalLattice.h.
Referenced by MomentumDistribution::MomentumDistribution().