StatMech
Loading...
Searching...
No Matches
Ensemble.cuh File Reference

Classes

class  SubSpaceManager
 
class  Ensemble::internal::ScalableOperator< MatrixType >
 
class  HamiltonianEnsemble
 
class  ObservableEnsemble
 

Namespaces

namespace  Ensemble
 
namespace  Ensemble::internal
 

Typedefs

using RealScalar = Real_t
 
using Scalar = Complex_t< RealScalar >
 

Functions

template<class Derived1 , class Derived2 , class TotalSpace >
__global__ void ObservableEnsemble_sample_kernel (Eigen::MatrixBase< Derived1 > *resPtr, Eigen::MatrixBase< Derived2 > const *opTotPtr, SubSpace< TotalSpace, typename Derived1::Scalar > const *subSpacePtr)
 

Variables

int g_dimLoc = 2
 
int g_momentum = 0
 

Typedef Documentation

◆ RealScalar

using RealScalar = Real_t

◆ Scalar

Function Documentation

◆ ObservableEnsemble_sample_kernel()

template<class Derived1 , class Derived2 , class TotalSpace >
__global__ void ObservableEnsemble_sample_kernel ( Eigen::MatrixBase< Derived1 > *  resPtr,
Eigen::MatrixBase< Derived2 > const *  opTotPtr,
SubSpace< TotalSpace, typename Derived1::Scalar > const *  subSpacePtr 
)
216 {
217 int const idx = blockIdx.x * blockDim.x + threadIdx.x;
218 int const idy = blockIdx.y * blockDim.y + threadIdx.y;
219 auto& basis = subSpacePtr->basis();
220 if(idx >= resPtr->rows() || idy >= resPtr->cols()) return;
221 if(idx > idy) return;
222
223 (*resPtr)(idx, idy) = {0, 0};
224 int innerX, innerY;
225 for(auto valuePosX = basis.outerIndexPtr()[idx]; valuePosX != basis.outerIndexPtr()[idx + 1];
226 ++valuePosX) {
227 innerX = basis.innerIndexPtr()[valuePosX];
228 auto conjCoeffX = conj(basis.valuePtr()[valuePosX]);
229
230 for(auto valuePosY = basis.outerIndexPtr()[idy];
231 valuePosY != basis.outerIndexPtr()[idy + 1]; ++valuePosY) {
232 innerY = basis.innerIndexPtr()[valuePosY];
233 auto CoeffY = basis.valuePtr()[valuePosY];
234
235 (*resPtr)(idx, idy) += conjCoeffX * (*opTotPtr)(innerX, innerY) * CoeffY;
236 }
237 }
238
239 if(idx == idy) (*resPtr)(idy, idx) = real((*resPtr)(idy, idx));
240
241 (*resPtr)(idy, idx) = conj((*resPtr)(idx, idy));
242}
__host__ __device__ int * innerIndexPtr() const
Definition MatrixUtils.cuh:421
__host__ __device__ Matrix_t & basis()
Definition HilbertSpace.hpp:668

Variable Documentation

◆ g_dimLoc

int g_dimLoc = 2

◆ g_momentum

int g_momentum = 0