GQCP
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
GQCP::SpinResolvedBase< _Of, _Derived > Class Template Reference

#include <SpinResolvedBase.hpp>

Inheritance diagram for GQCP::SpinResolvedBase< _Of, _Derived >:
Inheritance graph
Collaboration diagram for GQCP::SpinResolvedBase< _Of, _Derived >:
Collaboration graph

Public Types

using Of = _Of
 
using Derived = _Derived
 
using Self = SpinResolvedBase< Of, Derived >
 

Public Member Functions

 SpinResolvedBase (const Of &alpha, const Of &beta)
 
 SpinResolvedBase (const std::vector< Of > &both)
 
 SpinResolvedBase (const std::array< Of, 2 > &both)
 
 SpinResolvedBase (const std::initializer_list< Of > &both)
 
const Ofalpha () const
 
Ofalpha ()
 
const Ofbeta () const
 
Ofbeta ()
 
const Ofcomponent (const Spin sigma) const
 
Ofcomponent (const Spin sigma)
 

Static Public Member Functions

static Derived FromEqual (const Of &equal)
 

Detailed Description

template<typename _Of, typename _Derived>
class GQCP::SpinResolvedBase< _Of, _Derived >

A utility type encapsulating an alpha- and beta-type. In contrast to SpinResolved, this type is to be used as a base class/interface for types that are spin-resolved.

Parameters
_OfThe type of the alpha- and beta-objects. The name 'Of' is chosen for a natural reading SpinResolvedBase<_Of, _Derived>.
_DerivedThe type that derives from this type, given as a template argument, enabling CRTP and compile-time polymorphism.

Member Typedef Documentation

◆ Derived

template<typename _Of , typename _Derived >
using GQCP::SpinResolvedBase< _Of, _Derived >::Derived = _Derived

◆ Of

template<typename _Of , typename _Derived >
using GQCP::SpinResolvedBase< _Of, _Derived >::Of = _Of

◆ Self

template<typename _Of , typename _Derived >
using GQCP::SpinResolvedBase< _Of, _Derived >::Self = SpinResolvedBase<Of, Derived>

Constructor & Destructor Documentation

◆ SpinResolvedBase() [1/4]

template<typename _Of , typename _Derived >
GQCP::SpinResolvedBase< _Of, _Derived >::SpinResolvedBase ( const Of alpha,
const Of beta 
)
inline

Construct a spin-resolved instance from its alpha and beta objects.

Parameters
alphaThe alpha-object.
betaThe beta-object.

◆ SpinResolvedBase() [2/4]

template<typename _Of , typename _Derived >
GQCP::SpinResolvedBase< _Of, _Derived >::SpinResolvedBase ( const std::vector< Of > &  both)
inline

Construct a spin-resolved instance from a vector containing its alpha and beta objects.

Parameters
bothA vector containing both alpha and beta objects (in that order).

◆ SpinResolvedBase() [3/4]

template<typename _Of , typename _Derived >
GQCP::SpinResolvedBase< _Of, _Derived >::SpinResolvedBase ( const std::array< Of, 2 > &  both)
inline

Construct a spin-resolved instance from an array containing its alpha and beta objects.

Parameters
bothAn array containing both alpha and beta objects (in that order).

◆ SpinResolvedBase() [4/4]

template<typename _Of , typename _Derived >
GQCP::SpinResolvedBase< _Of, _Derived >::SpinResolvedBase ( const std::initializer_list< Of > &  both)
inline

Construct a spin-resolved instance from an initializer list containing its alpha and beta objects.

Parameters
bothAn initializer list containing both alpha and beta objects (in that order).

Member Function Documentation

◆ alpha() [1/2]

template<typename _Of , typename _Derived >
Of & GQCP::SpinResolvedBase< _Of, _Derived >::alpha ( )
inline
Returns
A writable reference to the alpha object.

◆ alpha() [2/2]

template<typename _Of , typename _Derived >
const Of & GQCP::SpinResolvedBase< _Of, _Derived >::alpha ( ) const
inline
Returns
A read-only reference to the alpha object.

◆ beta() [1/2]

template<typename _Of , typename _Derived >
Of & GQCP::SpinResolvedBase< _Of, _Derived >::beta ( )
inline
Returns
A writable reference to the beta object.

◆ beta() [2/2]

template<typename _Of , typename _Derived >
const Of & GQCP::SpinResolvedBase< _Of, _Derived >::beta ( ) const
inline
Returns
A read-only reference to the beta object.

◆ component() [1/2]

template<typename _Of , typename _Derived >
Of & GQCP::SpinResolvedBase< _Of, _Derived >::component ( const Spin  sigma)
inline

Access the alpha or beta component of this spin-resolved type.

Parameters
sigmaAlpha or beta.
Returns
A writable reference to the alpha or beta object.

◆ component() [2/2]

template<typename _Of , typename _Derived >
const Of & GQCP::SpinResolvedBase< _Of, _Derived >::component ( const Spin  sigma) const
inline

Access the alpha or beta component of this spin-resolved instance.

Parameters
sigmaAlpha or beta.
Returns
A read-only reference to the alpha or beta object.

◆ FromEqual()

template<typename _Of , typename _Derived >
static Derived GQCP::SpinResolvedBase< _Of, _Derived >::FromEqual ( const Of equal)
inlinestatic

Create a derived (spin-resolved) instance, from equal alpha and beta representations.

Parameters
equalThe equal representation for both the alpha and beta objects.
Returns
The derived (spin-resolved) type.

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