Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
q3::KPointNeighborShells Class Reference

#include <kpoint_neighbor_shells.hpp>

Public Member Functions

 KPointNeighborShells ()=default
 
void compute (const Matrix3x3 &reciprocal_lattice_vectors, int grid_dimension_x, int grid_dimension_y, int grid_dimension_z, int search_range=3, int maximum_shell_count=12, Real shell_relative_tolerance=1e-6, Real singular_value_tolerance=1e-10, Real completeness_tolerance=1e-10)
 
const std::vector< KPointNeighborDirection > & neighbor_directions () const
 
int number_of_shells () const
 

Static Public Member Functions

static int neighbor_kpoint_index (int starting_kpoint_index, const IntegerVector3D &grid_step, const std::array< int, 3 > &grid_dimensions)
 
static ResolvedKPointNeighbor resolve_neighbor (int starting_kpoint_index, const IntegerVector3D &grid_step, const std::array< int, 3 > &grid_dimensions, const std::vector< KPoint > &physical_kpoints)
 

Detailed Description

Definition at line 69 of file kpoint_neighbor_shells.hpp.

Constructor & Destructor Documentation

◆ KPointNeighborShells()

q3::KPointNeighborShells::KPointNeighborShells ( )
default

Member Function Documentation

◆ compute()

void q3::KPointNeighborShells::compute ( const Matrix3x3 &  reciprocal_lattice_vectors,
int  grid_dimension_x,
int  grid_dimension_y,
int  grid_dimension_z,
int  search_range = 3,
int  maximum_shell_count = 12,
Real  shell_relative_tolerance = 1e-6,
Real  singular_value_tolerance = 1e-10,
Real  completeness_tolerance = 1e-10 
)
inline

Find the b-vector shells and weights for a Monkhorst-Pack grid with the given dimensions, in the reciprocal lattice described by reciprocal_lattice_vectors (rows = b1, b2, b3, in any consistent Cartesian unit system – the completeness condition is scale covariant, so the computed weights come out in the inverse square of whatever units the caller passes in).

search_range bounds the cube of candidate integer grid steps searched for shells (each component ranges over [-search_range, search_range]); maximum_shell_count bounds how many shells may be accepted before giving up.

Throws std::runtime_error if no set of shells within those bounds satisfies the completeness condition to completeness_tolerance, or if a solved weight comes out negative beyond numerical noise – both signal a lattice/grid combination this search range cannot handle.

6 independent components of a symmetric 3x3 tensor, in the fixed order xx, yy, zz, xy, xz, yz.

This shell added no new independent direction to the completeness system – it is redundant with the shells already accepted. Reject it and keep searching.

Definition at line 91 of file kpoint_neighbor_shells.hpp.

◆ neighbor_directions()

const std::vector< KPointNeighborDirection > & q3::KPointNeighborShells::neighbor_directions ( ) const
inline

Definition at line 153 of file kpoint_neighbor_shells.hpp.

◆ neighbor_kpoint_index()

static int q3::KPointNeighborShells::neighbor_kpoint_index ( int  starting_kpoint_index,
const IntegerVector3D &  grid_step,
const std::array< int, 3 > &  grid_dimensions 
)
inlinestatic

Which physical k-point k + b lands on, from the grid shape alone.

Separate from resolve_neighbor() because a consumer that already trusts the k-point list – the stencil, walking a record's own neighbour table – needs the index and not the periodic-image shift, and must get it from exactly this arithmetic rather than a second copy of it. The enumeration order is the one KPointsGrid produces: first index slowest, third fastest.

Definition at line 171 of file kpoint_neighbor_shells.hpp.

References q3::IntegerVector3D::x, q3::IntegerVector3D::y, and q3::IntegerVector3D::z.

Referenced by resolve_neighbor(), and q3::KPointStencil::two_point_axis_direction().

◆ number_of_shells()

int q3::KPointNeighborShells::number_of_shells ( ) const
inline

Definition at line 157 of file kpoint_neighbor_shells.hpp.

◆ resolve_neighbor()

static ResolvedKPointNeighbor q3::KPointNeighborShells::resolve_neighbor ( int  starting_kpoint_index,
const IntegerVector3D &  grid_step,
const std::array< int, 3 > &  grid_dimensions,
const std::vector< KPoint > &  physical_kpoints 
)
inlinestatic

Resolve the physical k-point index and periodic-image (reciprocal lattice vector) shift that grid_step leads to, starting from starting_kpoint_index on a full, unreduced Monkhorst-Pack grid of grid_dimensions. physical_kpoints must be that grid's coordinate list, enumerated in the same (x-major, y, z-minor) nested order as KPointsGrid::generate() – the neighbor's flat index is recovered by exact integer arithmetic on that ordering, not by searching coordinates.

Definition at line 198 of file kpoint_neighbor_shells.hpp.

References q3::ResolvedKPointNeighbor::neighbor_kpoint_index, neighbor_kpoint_index(), and q3::ResolvedKPointNeighbor::periodic_image_shift.

Referenced by q3::Wannier90FormatWriter::write_neighbor_list(), and q3::Wannier90FormatWriter::write_overlaps().


The documentation for this class was generated from the following file: