Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
points_grid.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * Generic grid of 3D points with weights.
5 *
6 * Base abstraction for any set of weighted 3D points (k-points, q-points,
7 * angular quadrature points, etc.). Provides storage and iteration over
8 * point/weight pairs without encoding any physics.
9 */
10
11#include <vector>
12
14
15namespace q3 {
16
17/**
18 * A point in 3D space.
19 */
20struct [[nodiscard]] Point3D {
22};
23
24/**
25 * A point in 3D space with an associated integration weight.
26 */
27struct [[nodiscard]] WeightedPoint3D : Point3D {
28 Real weight{1.0};
29};
30
31/**
32 * Generic grid of weighted 3D points.
33 *
34 * Subclasses (e.g., KPointsGrid) extend this with domain-specific generation
35 * logic while inheriting the common storage and accessors.
36 */
38 public:
39 PointsGrid() = default;
40 virtual ~PointsGrid() = default;
41
42 [[nodiscard]] int number_of_points() const {
43 return static_cast<int>(points_.size());
44 }
45
46 [[nodiscard]] const std::vector<WeightedPoint3D>& points() const {
47 return points_;
48 }
49
50 [[nodiscard]] const WeightedPoint3D& point(int index) const {
51 return points_[index];
52 }
53
54 [[nodiscard]] bool empty() const {
55 return points_.empty();
56 }
57
58 protected:
59 std::vector<WeightedPoint3D> points_;
60};
61
62} // namespace q3
const std::vector< WeightedPoint3D > & points() const
int number_of_points() const
bool empty() const
virtual ~PointsGrid()=default
PointsGrid()=default
const WeightedPoint3D & point(int index) const
std::vector< WeightedPoint3D > points_
double Real
Vector3D coordinates