StatMech
Loading...
Searching...
No Matches
SubSpace< TotalSpace_, ScalarType_ > Class Template Reference

#include <HilbertSpace.hpp>

Inheritance diagram for SubSpace< TotalSpace_, ScalarType_ >:
Inheritance graph
Collaboration diagram for SubSpace< TotalSpace_, ScalarType_ >:
Collaboration graph

Public Types

using TotalSpace = TotalSpace_
 
using Scalar = ScalarType_
 
using Real = typename Eigen::NumTraits< ScalarType_ >::Real
 

Public Member Functions

__host__ __device__ SubSpace (TotalSpace const &totalSpace)
 Construct a SubSpace object by copying totalSpace to its member variable (m_totalSpace)
 
__host__ __device__ SubSpace (TotalSpace &&totalSpace)
 Construct a SubSpace object by moving totalSpace to its member variable (m_totalSpace)
 
__host__ __device__ SubSpace ()=default
 Default constructor.
 
__host__ __device__ SubSpace (SubSpace const &other)=default
 Copy constructor.
 
template<typename Scalar_ >
__host__ __device__ SubSpace (SubSpace< TotalSpace_, Scalar_ > const &other)
 
__host__ __device__ SubSpace (SubSpace &&other)=default
 Move constructor.
 
__host__ __device__ ~SubSpace ()=default
 Destructor.
 
- Public Member Functions inherited from HilbertSpace< Derived >
__host__ __device__ int dim () const
 
__host__ __device__ bool operator== (HilbertSpace const &other) const
 

Protected Types

using Matrix_t = SparseCompressed< Scalar >
 
using Matrix_t = Eigen::SparseMatrix< Scalar >
 

Protected Attributes

TotalSpace m_totalSpace
 
Matrix_t m_basisStates
 

Operator overloads

friend HilbertSpace< SubSpace< TotalSpace, Scalar > >
 
__host__ __device__ SubSpaceoperator= (SubSpace const &other)
 Copy assignment operator.
 
__host__ __device__ SubSpaceoperator= (SubSpace &&other)
 Move assignment operator.
 
__host__ __device__ bool operator== (SubSpace const &other) const
 Equality operator.
 
__host__ __device__ Matrix_tbasis ()
 
__host__ __device__ Matrix_t const & basis () const
 
__host__ __device__ TotalSpace const & totalSpace () const
 
__host__ __device__ int dimTot () const
 
__host__ __device__ int dim_impl () const
 

Member Typedef Documentation

◆ Matrix_t [1/2]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
using SubSpace< TotalSpace_, ScalarType_ >::Matrix_t = SparseCompressed<Scalar>
protected

◆ Matrix_t [2/2]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
using SubSpace< TotalSpace_, ScalarType_ >::Matrix_t = Eigen::SparseMatrix<Scalar>
protected

◆ Real

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
using SubSpace< TotalSpace_, ScalarType_ >::Real = typename Eigen::NumTraits<ScalarType_>::Real

◆ Scalar

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
using SubSpace< TotalSpace_, ScalarType_ >::Scalar = ScalarType_

◆ TotalSpace

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
using SubSpace< TotalSpace_, ScalarType_ >::TotalSpace = TotalSpace_

Constructor & Destructor Documentation

◆ SubSpace() [1/6]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ SubSpace< TotalSpace_, ScalarType_ >::SubSpace ( TotalSpace const &  totalSpace)
inline

Construct a SubSpace object by copying totalSpace to its member variable (m_totalSpace)

Parameters
totalSpace
Returns
host
592 debug_constructor_printf(1);
593 }
Matrix_t m_basisStates
Definition HilbertSpace.hpp:581
__host__ __device__ TotalSpace const & totalSpace() const
Definition HilbertSpace.hpp:671
TotalSpace m_totalSpace
Definition HilbertSpace.hpp:580

◆ SubSpace() [2/6]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ SubSpace< TotalSpace_, ScalarType_ >::SubSpace ( TotalSpace &&  totalSpace)
inline

Construct a SubSpace object by moving totalSpace to its member variable (m_totalSpace)

Parameters
totalSpace
Returns
host
601 : m_totalSpace{std::move(totalSpace)}, m_basisStates(totalSpace.dim(), 0) {
602 debug_constructor_printf(2);
603 }

◆ SubSpace() [3/6]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ SubSpace< TotalSpace_, ScalarType_ >::SubSpace ( )
default

Default constructor.

◆ SubSpace() [4/6]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ SubSpace< TotalSpace_, ScalarType_ >::SubSpace ( SubSpace< TotalSpace_, ScalarType_ > const &  other)
default

Copy constructor.

◆ SubSpace() [5/6]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
template<typename Scalar_ >
__host__ __device__ SubSpace< TotalSpace_, ScalarType_ >::SubSpace ( SubSpace< TotalSpace_, Scalar_ > const &  other)
inline
616 : m_totalSpace{other.totalSpace()},
617 m_basisStates{other.basis().template cast<Scalar>()} {};
__host__ __device__ Matrix_t & basis()
Definition HilbertSpace.hpp:668

◆ SubSpace() [6/6]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ SubSpace< TotalSpace_, ScalarType_ >::SubSpace ( SubSpace< TotalSpace_, ScalarType_ > &&  other)
default

Move constructor.

Parameters
other
Returns
host

◆ ~SubSpace()

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ SubSpace< TotalSpace_, ScalarType_ >::~SubSpace ( )
default

Destructor.

Member Function Documentation

◆ basis() [1/2]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ Matrix_t & SubSpace< TotalSpace_, ScalarType_ >::basis ( )
inline
668{ return m_basisStates; }

◆ basis() [2/2]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ Matrix_t const & SubSpace< TotalSpace_, ScalarType_ >::basis ( ) const
inline
669{ return m_basisStates; }

◆ dim_impl()

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ int SubSpace< TotalSpace_, ScalarType_ >::dim_impl ( ) const
inlineprivate
676{ return m_basisStates.cols(); }
__host__ __device__ int & cols()
Definition MatrixUtils.cuh:403

◆ dimTot()

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ int SubSpace< TotalSpace_, ScalarType_ >::dimTot ( ) const
inline
672{ return m_totalSpace.dim(); }

◆ operator=() [1/2]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ SubSpace & SubSpace< TotalSpace_, ScalarType_ >::operator= ( SubSpace< TotalSpace_, ScalarType_ > &&  other)
inline

Move assignment operator.

Parameters
other
Returns
*this
651 {
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 }

◆ operator=() [2/2]

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ SubSpace & SubSpace< TotalSpace_, ScalarType_ >::operator= ( SubSpace< TotalSpace_, ScalarType_ > const &  other)
inline

Copy assignment operator.

Parameters
other
Returns
*this
639 {
640 debug_printf("%s:\n\tCopy assignment operator.\n\n", __PRETTY_FUNCTION__);
641 m_totalSpace = other.m_totalSpace;
642 m_basisStates = other.m_basisStates;
643 return *this;
644 }

◆ operator==()

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ bool SubSpace< TotalSpace_, ScalarType_ >::operator== ( SubSpace< TotalSpace_, ScalarType_ > const &  other) const
inline

Equality operator.

Parameters
other
Returns
bool
663 {
664 return m_totalSpace == other.totalSpace() && m_basisStates == other.basis();
665 }

◆ totalSpace()

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
__host__ __device__ TotalSpace const & SubSpace< TotalSpace_, ScalarType_ >::totalSpace ( ) const
inline
671{ return m_totalSpace; }

Member Data Documentation

◆ HilbertSpace< SubSpace< TotalSpace, Scalar > >

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
friend SubSpace< TotalSpace_, ScalarType_ >::HilbertSpace< SubSpace< TotalSpace, Scalar > >
private

◆ m_basisStates

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
Matrix_t SubSpace< TotalSpace_, ScalarType_ >::m_basisStates
protected

◆ m_totalSpace

template<class TotalSpace_ , typename ScalarType_ = Complex_t<Real_t>>
TotalSpace SubSpace< TotalSpace_, ScalarType_ >::m_totalSpace
protected

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