StatMech
Loading...
Searching...
No Matches
HilbertSpace.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Headers/mytypes.hpp"
4#include "Headers/mydebug.hpp"
9#include "Eigen/SparseCore"
10#include <iostream>
11#include <vector>
12#include <complex>
13#include <cerrno>
14
15#ifdef GPU
17 #include <thrust/host_vector.h>
18 #include <thrust/device_vector.h>
19 #include <thrust/execution_policy.h>
20#endif
21
22template<class T>
24
25template<class Derived = int>
26class HilbertSpace;
31template<class Derived>
33 public:
34 __host__ __device__ int dim() const {
35 return static_cast<Derived const*>(this)->dim_impl();
36 };
37
39 /* @{ */
40 __host__ __device__ bool operator==(HilbertSpace const& other) const {
41 return this->dim() == other.dim();
42 }
43 /* @} */
44};
45
46template<>
47class HilbertSpace<int> {
48 private:
49 int m_dim = 0;
50
51 public:
57 __host__ __device__ HilbertSpace(int dim) : m_dim{dim} { debug_constructor_printf(1); }
62 __host__ __device__ HilbertSpace() = default;
68 __host__ __device__ HilbertSpace(HilbertSpace const& other) = default;
74 __host__ __device__ HilbertSpace(HilbertSpace&& other) = default;
79 __host__ __device__ ~HilbertSpace() = default;
80
82 /* @{ */
89 __host__ __device__ HilbertSpace& operator=(HilbertSpace const& other) = default;
96 __host__ __device__ HilbertSpace& operator=(HilbertSpace&& other) = default;
103 __host__ __device__ bool operator==(HilbertSpace const& other) const {
104 return this->dim() == other.dim();
105 }
106 /* @} */
107
108 __host__ __device__ int dim() const { return m_dim; };
109};
110
111#ifdef GPU
112// Forward declarelation for class ManyBodySpaceBase
113template<typename Derived>
115template<typename Derived>
117template<typename Derived>
118__global__ void copyTransEqClass_kernel(ManyBodySpaceBase<Derived>* obj, int* srcTransEqClassRep,
119 int* srcTransPeriod);
120#endif
129template<class Derived>
130class ManyBodySpaceBase : public HilbertSpace<Derived> {
131 private:
133#ifdef GPU
134 mutable struct cudaFuncAttributes attr;
135 mutable bool gotKernelAttribute = false;
136#endif
137
138 protected:
139 using Vector_t = Eigen::VectorX<int>;
140
141 int m_systemSize = 0; // Number of local Hilbert spaces
143 mutable int m_transEqDim = -1;
148
149 public:
157 __host__ __device__ ManyBodySpaceBase(int systemSize, LocSpace_t const& locSpace)
158 : m_systemSize{systemSize}, m_locSpace{locSpace} {
159 debug_constructor_printf(1);
160 debug_printf("\tlocSpace.dim() = %d\n\n", locSpace.dim());
161 }
169 __host__ __device__ ManyBodySpaceBase(int systemSize, LocSpace_t&& locSpace)
170 : m_systemSize{systemSize}, m_locSpace{std::move(locSpace)} {
171 debug_constructor_printf(2);
172 debug_printf("\tlocSpace.dim() = %d\n\n", locSpace.dim());
173 }
174
182 template<typename... Args>
183 __host__ __device__ ManyBodySpaceBase(int systemSize, Args... args)
184 : ManyBodySpaceBase(systemSize, LocSpace_t(args...)) {
185 debug_constructor_printf(3);
186 }
191 __host__ __device__ ManyBodySpaceBase() = default;
197 __host__ __device__ ManyBodySpaceBase(ManyBodySpaceBase const& other)
198 : HilbertSpace<Derived>(other),
200 m_locSpace(other.m_locSpace),
205 debug_constructor_printf((Copy));
206 }
212 __host__ __device__ ManyBodySpaceBase(ManyBodySpaceBase&& other)
213 : HilbertSpace<Derived>(other),
215 m_locSpace(other.m_locSpace),
217 m_transEqClassRep{std::move(other.m_transEqClassRep)},
218 m_transPeriod{std::move(other.m_transPeriod)},
220 debug_constructor_printf((Move));
221 }
226 __host__ __device__ ~ManyBodySpaceBase() = default;
227
229 /* @{ */
236 __host__ __device__ ManyBodySpaceBase& operator=(ManyBodySpaceBase const& other) = delete;
243 __host__ __device__ Derived& operator=(ManyBodySpaceBase&& other) {
244 debug_printf("%s:\n\tMove assignment operator.\n\n", __PRETTY_FUNCTION__);
245 m_systemSize = other.m_systemSize;
246 m_locSpace = other.m_locSpace;
247 m_transEqDim = other.m_transEqDim;
248 m_transEqClassRep = std::move(other.m_transEqClassRep);
249 m_transPeriod = std::move(other.m_transPeriod);
250 m_stateToTransEqClass = std::move(other.m_stateToTransEqClass);
251 return *static_cast<Derived*>(this);
252 }
259 __host__ __device__ bool operator==(ManyBodySpaceBase const& other) const {
260 return m_locSpace == other.locSpace() && m_systemSize == other.sysSize();
261 }
262 /* @} */
263
264 __host__ __device__ LocSpace_t const& locSpace() const { return m_locSpace; }
265 __host__ __device__ int sysSize() const { return m_systemSize; }
266 __host__ __device__ int dimLoc() const { return m_locSpace.dim(); }
267 __host__ __device__ int locState(int state, int pos) const {
268 return static_cast<Derived const*>(this)->locState_impl(state, pos);
269 }
270
277 __host__ Derived const& printInString(int basisNum) const {
278 Eigen::RowVectorXi config = this->ordinalToConfig(basisNum);
279 for(int l = 0; l != this->sysSize(); ++l) std::cout << " " << config(l);
280 std::cout << std::endl;
281 return static_cast<Derived const&>(*this);
282 }
283 __host__ __device__ Eigen::RowVectorXi ordinalToConfig(int basisNum) const {
284 return static_cast<Derived const*>(this)->ordinalToConfig_impl(basisNum);
285 }
286 template<class EigenDerived>
287 __host__ __device__ int configToOrdinal(Eigen::DenseBase<EigenDerived>& config) const {
288 return static_cast<Derived const*>(this)->configToOrdinal_impl(config);
289 }
290
292 /* @{ */
300 __host__ __device__ int translate(int state, int trans) const {
301 return static_cast<Derived const*>(this)->translate_impl(state, trans);
302 }
303 template<class EigenDerived>
304 __host__ __device__ int translate(int state, int trans,
305 Eigen::DenseBase<EigenDerived>& work) const {
306 return static_cast<Derived const*>(this)->translate_impl(state, trans, work);
307 }
308
309 __host__ __device__ int transEqDim() const { return m_transEqDim; }
310
311 __host__ __device__ Vector_t const& transEqClassRep() const { return m_transEqClassRep; }
312 __host__ __device__ int transEqClassRep(int id) const { return m_transEqClassRep[id]; }
313 __host__ __device__ int transEqClassRep(int id, int trans) const {
314 return this->translate(m_transEqClassRep[id], trans);
315 }
316
317 __host__ __device__ Vector_t const& transPeriod() const { return m_transPeriod; }
318 __host__ __device__ int transPeriod(int id) const { return m_transPeriod[id]; }
319
320 __host__ __device__ Vector_t const& stateToTransEqClass() const {
322 }
323 __host__ __device__ int stateToTransEqClass(int state) const {
324 return m_stateToTransEqClass[state];
325 };
326 __host__ __device__ int stateToTransPeriod(int state) const {
327 auto eqClass = this->stateToTransEqClass(state);
328 return this->transPeriod(eqClass);
329 };
330
331 __host__ __device__ void computeTransEqClass() const;
332#ifdef GPU
333 friend void setTransEqDim_kernel<Derived>(ManyBodySpaceBase*, int);
334 friend void copyTransEqClass_kernel<Derived>(ManyBodySpaceBase*, int*, int*);
335#endif
336 /* @} */
337
339 /* @{ */
347 __host__ __device__ int reverse(int state) const {
348 return static_cast<Derived const*>(this)->reverse_impl(state);
349 }
350 __host__ __device__ Vector_t const& parityPair() const { return m_parityPair; }
351 __host__ __device__ int parityPair(int state) const { return m_parityPair[state]; }
352 __host__ __device__ void computeParityPair() const;
353 /* @} */
354};
355
356template<class Derived>
358 debug_printf("%s:\n\tComputing trans equivalent class... (this->dim()=%d, m_transEqDim=%d)\n",
359 __PRETTY_FUNCTION__, this->dim(), m_transEqDim);
360 if(m_transEqDim != -1) {
361 debug_printf("%s:\tTrans equivalent class is already computed. m_transEqDim=%d\n", __func__,
362 m_transEqDim);
363 return;
364 }
365 if(this->dim() <= 0) {
366 debug_printf("%s:\tDimension of the space is ZERO (this->dim() = %d)\n", __func__,
367 this->dim());
368 return;
369 }
370 int translated;
371 int period = 0;
372 Eigen::ArrayX<bool> calculated = Eigen::ArrayX<bool>::Zero(this->dim());
373 m_transEqDim = 0;
374 for(int basis = 0; basis < this->dim(); ++basis) {
375 if(calculated(basis)) continue;
376 calculated(basis) = true;
377 for(period = 1; period < this->sysSize(); ++period) {
378 translated = this->translate(basis, period);
379 if(basis == translated) break;
380 calculated(translated) = true;
381 }
382 m_transEqDim += 1;
383 }
384
385 m_transEqClassRep.resize(m_transEqDim);
386 m_transPeriod.resize(m_transEqDim);
387 m_stateToTransEqClass.resize(this->dim());
388 int num = 0;
389 calculated = Eigen::ArrayX<bool>::Zero(this->dim());
390 for(int basis = 0; basis < this->dim(); ++basis) {
391 if(calculated(basis)) continue;
392 calculated(basis) = true;
393 m_stateToTransEqClass(basis) = num;
394
395 for(period = 1; period < this->sysSize(); ++period) {
396 translated = this->translate(basis, period);
397 if(basis == translated) break;
398 calculated(translated) = true;
399 m_stateToTransEqClass(translated) = num;
400 }
401 m_transEqClassRep(num) = basis;
402 m_transPeriod(num) = period;
403 num += 1;
404 }
405 debug_printf("\t(END) Computed trans equivalent classes (m_transEqDim=%d)\n\n", m_transEqDim);
406}
407
408template<class Derived>
409__host__ __device__ void ManyBodySpaceBase<Derived>::computeParityPair() const {
410 m_parityPair.resize(this->dim());
411 for(auto j = 0; j != this->dim(); ++j) {
412 auto reversed = this->reverse(j);
413 m_parityPair(j) = reversed;
414 m_parityPair(reversed) = j;
415 }
416}
417
419template<>
422};
423class ManyBodySpinSpace : public ManyBodySpaceBase<ManyBodySpinSpace> {
424 private:
426
427 public:
437 __host__ __device__ ManyBodySpinSpace(int systemSize, LocalSpace const& locSpace)
438 : Base(systemSize, locSpace), m_bConv(locSpace.dim(), systemSize) {
439 debug_constructor_printf(1);
440 }
448 __host__ __device__ ManyBodySpinSpace(int systemSize, LocalSpace&& locSpace)
449 : Base(systemSize, std::move(locSpace)), m_bConv(locSpace.dim(), systemSize) {
450 debug_constructor_printf(2);
451 }
459 __host__ __device__ ManyBodySpinSpace(int systemSize = 0, int dimLoc = 0)
460 : Base(systemSize, LocalSpace(dimLoc)), m_bConv(dimLoc, systemSize) {
461 debug_constructor_printf((Default));
462 }
463
464 private:
466 __host__ __device__ int dim_impl() const { return m_bConv.maxVal(); }
467
469 __host__ __device__ int locState_impl(int state, int pos) const {
470 return m_bConv.digit(state, pos);
471 }
472
473 __host__ __device__ Eigen::RowVectorXi ordinalToConfig_impl(int basisNum) const {
474 Eigen::RowVectorXi res;
475 m_bConv.printInDigits(res, basisNum);
476 return res;
477 }
478 template<class EigenDerived>
479 __host__ __device__ int configToOrdinal_impl(Eigen::DenseBase<EigenDerived>& config) const {
480 return m_bConv.digitsToNumber(config);
481 }
482
483 __host__ __device__ int translate_impl(int state, int trans) const {
484 return m_bConv.shiftDigits(state, trans);
485 }
486 template<class EigenDerived>
487 __host__ __device__ int translate_impl(int state, int trans,
488 Eigen::DenseBase<EigenDerived>&) const {
489 return this->translate_impl(state, trans);
490 }
491
492 __host__ __device__ int reverse_impl(int state) const {
493 int res = 0, base = 1;
494 for(int pos = 0; pos != this->sysSize(); ++pos, base *= this->dimLoc()) {
495 res += base * this->locState(state, this->sysSize() - 1 - pos);
496 }
497 return res;
498 }
499};
500
502template<>
505};
506class ManyBodyBosonSpace : public ManyBodySpaceBase<ManyBodyBosonSpace> {
507 private:
509
510 public:
520 __host__ __device__ ManyBodyBosonSpace(int systemSize = 0, int nBosons = 0)
521 : Base(systemSize, LocalSpace(nBosons + 1)), m_iComp(nBosons, systemSize, nBosons) {
522 debug_constructor_printf((Default));
523 }
524 __host__ __device__ ManyBodyBosonSpace(int systemSize, int nBosons, int max)
525 : Base(systemSize, LocalSpace(max + 1)), m_iComp(nBosons, systemSize, max) {
526 debug_constructor_printf(1);
527 }
528
529 private:
531 __host__ __device__ int dim_impl() const { return m_iComp.dim(); }
532
534 __host__ __device__ int locState_impl(int state, int pos) const {
535 return m_iComp.locNumber(state, pos);
536 }
537
538 __host__ __device__ Eigen::RowVectorXi ordinalToConfig_impl(int basisNum) const {
539 Eigen::RowVectorXi res;
540 m_iComp.ordinalToPart(res, basisNum);
541 return res;
542 }
543 template<class EigenDerived>
544 __host__ __device__ int configToOrdinal_impl(Eigen::DenseBase<EigenDerived>& config) const {
545 return m_iComp.partToOrdinal(config);
546 }
547
548 __host__ __device__ int translate_impl(int state, int trans) const {
549 return m_iComp.translate(state, trans);
550 }
551 template<class EigenDerived>
552 __host__ __device__ int translate_impl(int state, int trans,
553 Eigen::DenseBase<EigenDerived>&) const {
554 return this->translate_impl(state, trans);
555 }
556
557 __host__ __device__ int reverse_impl(int state) const {
558 Eigen::ArrayXi config1(this->sysSize());
559 m_iComp.ordinalToPart(config1, state);
560 Eigen::ArrayXi config2(this->sysSize());
561 for(int pos = 0; pos != this->sysSize(); ++pos)
562 config2[pos] = config1[this->sysSize() - 1 - pos];
563 return m_iComp.partToOrdinal(config2);
564 }
565};
566
567template<class TotalSpace_, typename ScalarType_ = Complex_t<Real_t>>
568class SubSpace : public HilbertSpace< SubSpace<TotalSpace_, ScalarType_> > {
569 public:
570 using TotalSpace = TotalSpace_;
571 using Scalar = ScalarType_;
572 using Real = typename Eigen::NumTraits<ScalarType_>::Real;
573
574 protected:
575#ifdef __CUDA_ARCH__
577#else
578 using Matrix_t = Eigen::SparseMatrix<Scalar>; // default is column major
579#endif
582
583 public:
590 __host__ __device__ SubSpace(TotalSpace const& totalSpace)
592 debug_constructor_printf(1);
593 }
600 __host__ __device__ SubSpace(TotalSpace&& totalSpace)
601 : m_totalSpace{std::move(totalSpace)}, m_basisStates(totalSpace.dim(), 0) {
602 debug_constructor_printf(2);
603 }
608 __host__ __device__ SubSpace() = default;
613 __host__ __device__ SubSpace(SubSpace const& other) = default;
614 template<typename Scalar_>
615 __host__ __device__ SubSpace(SubSpace<TotalSpace_, Scalar_> const& other)
616 : m_totalSpace{other.totalSpace()},
617 m_basisStates{other.basis().template cast<Scalar>()} {};
624 __host__ __device__ SubSpace(SubSpace&& other) = default;
629 __host__ __device__ ~SubSpace() = default;
630
632 /* @{ */
639 __host__ __device__ SubSpace& operator=(SubSpace const& other) {
640 debug_printf("%s:\n\tCopy assignment operator.\n\n", __PRETTY_FUNCTION__);
643 return *this;
644 }
651 __host__ __device__ SubSpace& operator=(SubSpace&& other) {
652 debug_printf("%s:\n\tMove assignment operator.\n\n", __PRETTY_FUNCTION__);
653 m_totalSpace = std::move(other.m_totalSpace);
654 m_basisStates = std::move(other.m_basisStates);
655 return *this;
656 }
663 __host__ __device__ bool operator==(SubSpace const& other) const {
664 return m_totalSpace == other.totalSpace() && m_basisStates == other.basis();
665 }
666 /* @} */
667
668 __host__ __device__ Matrix_t& basis() { return m_basisStates; }
669 __host__ __device__ Matrix_t const& basis() const { return m_basisStates; }
670
671 __host__ __device__ TotalSpace const& totalSpace() const { return m_totalSpace; }
672 __host__ __device__ int dimTot() const { return m_totalSpace.dim(); }
673
674 private:
676 __host__ __device__ int dim_impl() const { return m_basisStates.cols(); }
677};
__global__ void setTransEqDim_kernel(ManyBodySpaceBase< Derived > *obj, int transEqDim)
Definition ManyBodySpaceBase.cuh:68
__global__ void copyTransEqClass_kernel(ManyBodySpaceBase< Derived > *obj, int *srcTransEqClassRep, int *srcTransPeriod)
Definition ManyBodySpaceBase.cuh:76
Provides utilities for converting an integer to the corresponding expression in the positional notati...
Definition BaseNnumber.hpp:19
__host__ __device__ Integer digit(Integer const num, Integer const pos, Integer const base, Integer const length) const
Returns the (pos)-th digit of the input (num) in given base and length.
Definition BaseNnumber.hpp:113
__host__ __device__ Integer maxVal() const
Definition BaseNnumber.hpp:57
__host__ __device__ Integer shiftDigits(Integer const num, Integer const trans, Integer const base, Integer const length) const
Shifts a number (num) to right by (trans) in terms of the positional notation with given base and len...
Definition BaseNnumber.hpp:139
__host__ __device__ Integer digitsToNumber(Input const &digits, Integer const base, Integer const length) const
Converts an array of integers to the corresponding integer in terms of the positional notation with g...
Definition BaseNnumber.hpp:166
__host__ __device__ auto printInDigits(Output &output, Integer const num, Integer const base, Integer const length) const -> typename std::enable_if< std::is_integral< Output >::value==false, BaseConverter const & >::type
Expresses an integer (num) in the positional notation with given (base) and (length)
Definition BaseNnumber.hpp:191
Definition HilbertSpace.hpp:47
__host__ __device__ HilbertSpace()=default
Default constructor.
__host__ __device__ int dim() const
Definition HilbertSpace.hpp:108
__host__ __device__ HilbertSpace & operator=(HilbertSpace &&other)=default
Move assignment operator.
__host__ __device__ HilbertSpace & operator=(HilbertSpace const &other)=default
Copy assignment operator.
__host__ __device__ HilbertSpace(HilbertSpace &&other)=default
Move constructor.
__host__ __device__ bool operator==(HilbertSpace const &other) const
Equality operator.
Definition HilbertSpace.hpp:103
__host__ __device__ ~HilbertSpace()=default
Destructor.
__host__ __device__ HilbertSpace(HilbertSpace const &other)=default
Copy constructor.
__host__ __device__ HilbertSpace(int dim)
Constructor.
Definition HilbertSpace.hpp:57
Definition HilbertSpace.hpp:32
__host__ __device__ bool operator==(HilbertSpace const &other) const
Definition HilbertSpace.hpp:40
__host__ __device__ int dim() const
Definition HilbertSpace.hpp:34
Lists a weak composition of an integer N up to length L with a constraint that each summand does not ...
Definition IntegerComposition.hpp:57
__host__ __device__ int locNumber(Index_ const num, Index_ const pos) const
Definition IntegerComposition.hpp:253
__host__ __device__ Index_t dim() const
Definition IntegerComposition.hpp:90
__host__ __device__ void ordinalToPart(Vector_t &vec, Index_t const num) const
Converts an ordinal number of a composition of the integer N to a vector form.
Definition IntegerComposition.hpp:225
__host__ __device__ Index_t translate(Index_t const num, int trans, Vector_t &workSpace) const
Definition IntegerComposition.hpp:283
__host__ __device__ Index_t partToOrdinal(Vector_t const &vec) const
Converts an composition of the integer N from a vector form to an ordinal number.
Definition IntegerComposition.hpp:209
Definition HilbertSpace.hpp:506
__host__ __device__ int reverse_impl(int state) const
Definition HilbertSpace.hpp:557
__host__ __device__ int locState_impl(int state, int pos) const
Definition HilbertSpace.hpp:534
__host__ __device__ int configToOrdinal_impl(Eigen::DenseBase< EigenDerived > &config) const
Definition HilbertSpace.hpp:544
__host__ __device__ int translate_impl(int state, int trans, Eigen::DenseBase< EigenDerived > &) const
Definition HilbertSpace.hpp:552
typename HilbertSpaceTraits< ManyBodyBosonSpace >::LocalSpace LocalSpace
Definition HilbertSpace.hpp:512
__host__ __device__ ManyBodyBosonSpace(int systemSize, int nBosons, int max)
Definition HilbertSpace.hpp:524
__host__ __device__ int dim_impl() const
Definition HilbertSpace.hpp:531
__host__ __device__ ManyBodyBosonSpace(int systemSize=0, int nBosons=0)
Default constructor.
Definition HilbertSpace.hpp:520
__host__ __device__ Eigen::RowVectorXi ordinalToConfig_impl(int basisNum) const
Definition HilbertSpace.hpp:538
IntegerComposition m_iComp
Definition HilbertSpace.hpp:508
__host__ __device__ int translate_impl(int state, int trans) const
Definition HilbertSpace.hpp:548
ManyBodySpinSpace defined by , where.
Definition HilbertSpace.hpp:130
__host__ __device__ ManyBodySpaceBase()=default
Default constructor.
__host__ __device__ LocSpace_t const & locSpace() const
Definition HilbertSpace.hpp:264
int m_systemSize
Definition HilbertSpace.hpp:141
bool gotKernelAttribute
Definition HilbertSpace.hpp:135
Eigen::VectorX< int > Vector_t
Definition HilbertSpace.hpp:139
Vector_t m_parityPair
Definition HilbertSpace.hpp:147
__host__ __device__ int translate(int state, int trans) const
Translate the input state to the left by one.
Definition HilbertSpace.hpp:300
__host__ __device__ ManyBodySpaceBase(int systemSize, LocSpace_t &&locSpace)
Constructor2.
Definition HilbertSpace.hpp:169
__host__ __device__ ~ManyBodySpaceBase()=default
Destructor.
__host__ __device__ Vector_t const & parityPair() const
Definition HilbertSpace.hpp:350
__host__ __device__ Vector_t const & stateToTransEqClass() const
Definition HilbertSpace.hpp:320
__host__ __device__ int dimLoc() const
Definition HilbertSpace.hpp:266
int m_transEqDim
Definition HilbertSpace.hpp:143
__host__ __device__ Vector_t const & transPeriod() const
Definition HilbertSpace.hpp:317
__host__ __device__ ManyBodySpaceBase(int systemSize, Args... args)
Constructor3.
Definition HilbertSpace.hpp:183
__host__ __device__ bool operator==(ManyBodySpaceBase const &other) const
Equality operator.
Definition HilbertSpace.hpp:259
__host__ __device__ int transPeriod(int id) const
Definition HilbertSpace.hpp:318
__host__ __device__ int transEqDim() const
Definition HilbertSpace.hpp:309
__host__ __device__ int configToOrdinal(Eigen::DenseBase< EigenDerived > &config) const
Definition HilbertSpace.hpp:287
__host__ __device__ int parityPair(int state) const
Definition HilbertSpace.hpp:351
__host__ __device__ int stateToTransEqClass(int state) const
Definition HilbertSpace.hpp:323
__host__ __device__ ManyBodySpaceBase(ManyBodySpaceBase &&other)
Move constructor.
Definition HilbertSpace.hpp:212
__host__ Derived const & printInString(int basisNum) const
Print a basis state specified by the input (basisNum) in a string of integers.
Definition HilbertSpace.hpp:277
typename HilbertSpaceTraits< Derived >::LocalSpace LocSpace_t
Definition HilbertSpace.hpp:132
__host__ __device__ ManyBodySpaceBase & operator=(ManyBodySpaceBase const &other)=delete
Copy assignment operator (deleted)
__host__ __device__ int translate(int state, int trans, Eigen::DenseBase< EigenDerived > &work) const
Definition HilbertSpace.hpp:304
__host__ __device__ void computeTransEqClass() const
Definition HilbertSpace.hpp:357
__host__ __device__ ManyBodySpaceBase(int systemSize, LocSpace_t const &locSpace)
Constructor1.
Definition HilbertSpace.hpp:157
__host__ __device__ int stateToTransPeriod(int state) const
Definition HilbertSpace.hpp:326
__host__ __device__ Eigen::RowVectorXi ordinalToConfig(int basisNum) const
Definition HilbertSpace.hpp:283
Vector_t m_transPeriod
Definition HilbertSpace.hpp:145
__host__ __device__ void computeParityPair() const
Definition HilbertSpace.hpp:409
Vector_t m_stateToTransEqClass
Definition HilbertSpace.hpp:146
LocSpace_t m_locSpace
Definition HilbertSpace.hpp:142
__host__ __device__ ManyBodySpaceBase(ManyBodySpaceBase const &other)
Copy constructor.
Definition HilbertSpace.hpp:197
__host__ __device__ Derived & operator=(ManyBodySpaceBase &&other)
Move assignment operator.
Definition HilbertSpace.hpp:243
struct cudaFuncAttributes attr
Definition HilbertSpace.hpp:134
__host__ __device__ int transEqClassRep(int id, int trans) const
Definition HilbertSpace.hpp:313
__host__ __device__ int reverse(int state) const
Reverse the input state.
Definition HilbertSpace.hpp:347
Vector_t m_transEqClassRep
Definition HilbertSpace.hpp:144
__host__ __device__ int transEqClassRep(int id) const
Definition HilbertSpace.hpp:312
__host__ __device__ int locState(int state, int pos) const
Definition HilbertSpace.hpp:267
__host__ __device__ int sysSize() const
Definition HilbertSpace.hpp:265
__host__ __device__ Vector_t const & transEqClassRep() const
Definition HilbertSpace.hpp:311
Definition HilbertSpace.hpp:423
__host__ __device__ Eigen::RowVectorXi ordinalToConfig_impl(int basisNum) const
Definition HilbertSpace.hpp:473
__host__ __device__ int configToOrdinal_impl(Eigen::DenseBase< EigenDerived > &config) const
Definition HilbertSpace.hpp:479
__host__ __device__ int locState_impl(int state, int pos) const
Definition HilbertSpace.hpp:469
BaseConverter< int > m_bConv
Definition HilbertSpace.hpp:425
__host__ __device__ int reverse_impl(int state) const
Definition HilbertSpace.hpp:492
__host__ __device__ int dim_impl() const
Definition HilbertSpace.hpp:466
typename HilbertSpaceTraits< ManyBodySpinSpace >::LocalSpace LocalSpace
Definition HilbertSpace.hpp:429
__host__ __device__ ManyBodySpinSpace(int systemSize, LocalSpace const &locSpace)
Constructor1.
Definition HilbertSpace.hpp:437
__host__ __device__ ManyBodySpinSpace(int systemSize, LocalSpace &&locSpace)
Constructor2.
Definition HilbertSpace.hpp:448
__host__ __device__ int translate_impl(int state, int trans, Eigen::DenseBase< EigenDerived > &) const
Definition HilbertSpace.hpp:487
__host__ __device__ ManyBodySpinSpace(int systemSize=0, int dimLoc=0)
Default constructor.
Definition HilbertSpace.hpp:459
__host__ __device__ int translate_impl(int state, int trans) const
Definition HilbertSpace.hpp:483
__host__ __device__ int & cols()
Definition MatrixUtils.cuh:403
Definition HilbertSpace.hpp:568
__host__ __device__ SubSpace(TotalSpace const &totalSpace)
Construct a SubSpace object by copying totalSpace to its member variable (m_totalSpace)
Definition HilbertSpace.hpp:590
Matrix_t m_basisStates
Definition HilbertSpace.hpp:581
typename Eigen::NumTraits< ScalarType_ >::Real Real
Definition HilbertSpace.hpp:572
__host__ __device__ Matrix_t & basis()
Definition HilbertSpace.hpp:668
__host__ __device__ int dimTot() const
Definition HilbertSpace.hpp:672
__host__ __device__ SubSpace(SubSpace< TotalSpace_, Scalar_ > const &other)
Definition HilbertSpace.hpp:615
__host__ __device__ Matrix_t const & basis() const
Definition HilbertSpace.hpp:669
ScalarType_ Scalar
Definition HilbertSpace.hpp:571
__host__ __device__ SubSpace & operator=(SubSpace &&other)
Move assignment operator.
Definition HilbertSpace.hpp:651
__host__ __device__ TotalSpace const & totalSpace() const
Definition HilbertSpace.hpp:671
__host__ __device__ SubSpace(SubSpace const &other)=default
Copy constructor.
__host__ __device__ SubSpace & operator=(SubSpace const &other)
Copy assignment operator.
Definition HilbertSpace.hpp:639
__host__ __device__ int dim_impl() const
Definition HilbertSpace.hpp:676
TotalSpace_ TotalSpace
Definition HilbertSpace.hpp:570
TotalSpace m_totalSpace
Definition HilbertSpace.hpp:580
__host__ __device__ SubSpace()=default
Default constructor.
__host__ __device__ bool operator==(SubSpace const &other) const
Equality operator.
Definition HilbertSpace.hpp:663
__host__ __device__ SubSpace(SubSpace &&other)=default
Move constructor.
__host__ __device__ ~SubSpace()=default
Destructor.
__host__ __device__ SubSpace(TotalSpace &&totalSpace)
Construct a SubSpace object by moving totalSpace to its member variable (m_totalSpace)
Definition HilbertSpace.hpp:600
Definition HilbertSpace.hpp:23