GQCP
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
GQCP::OrbitalSpace Class Reference

#include <OrbitalSpace.hpp>

Collaboration diagram for GQCP::OrbitalSpace:
Collaboration graph

Public Member Functions

 OrbitalSpace (const std::vector< size_t > &occupied_indices, const std::vector< size_t > &active_indices, const std::vector< size_t > &virtual_indices)
 
 OrbitalSpace (const std::vector< size_t > &occupied_indices, const std::vector< size_t > &virtual_indices)
 
template<typename Scalar >
ImplicitMatrixSlice< Scalar > createRepresentableObjectFor (const OccupationType row_type, const OccupationType column_type, const MatrixX< Scalar > &M) const
 
template<typename Scalar >
ImplicitRankFourTensorSlice< Scalar > createRepresentableObjectFor (const OccupationType axis1_type, const OccupationType axis2_type, const OccupationType axis3_type, const OccupationType axis4_type, const Tensor< Scalar, 4 > &T) const
 
std::string description () const
 
const std::vector< size_t > & indices () const
 
const std::vector< size_t > & indices (const OccupationType type) const
 
template<typename Scalar >
ImplicitMatrixSlice< Scalar > initializeRepresentableObjectFor (const OccupationType row_type, const OccupationType column_type) const
 
template<typename Scalar >
ImplicitRankFourTensorSlice< Scalar > initializeRepresentableObjectFor (const OccupationType axis1_type, const OccupationType axis2_type, const OccupationType axis3_type, const OccupationType axis4_type) const
 
bool isIndex (const OccupationType type, const size_t p) const
 
size_t numberOfExcitations (const OccupationType from, const OccupationType to) const
 
size_t numberOfOrbitals () const
 
size_t numberOfOrbitals (const OccupationType type) const
 

Static Public Member Functions

static OrbitalSpace Implicit (const std::map< OccupationType, size_t > &occupation_type_numbers)
 

Detailed Description

A class that encapsulates occupied, active and virtual orbital indices.

Note
The union of these three sets of indices is supposed to be the full set of orbital indices.
This class is intended to be used in conjunction with restricted spin-orbital bases (RSpinOrbitalBasis) or general spinor bases (GSpinorBasis).

Constructor & Destructor Documentation

◆ OrbitalSpace() [1/2]

GQCP::OrbitalSpace::OrbitalSpace ( const std::vector< size_t > &  occupied_indices,
const std::vector< size_t > &  active_indices,
const std::vector< size_t > &  virtual_indices 
)

Construct an orbital space from occupied, active and virtual indices.

Parameters
occupied_indicesthe indices of the orbitals that are considered occupied by the electrons
active_indicesthe indices of the orbitals that are considered 'active', i.e. those spinor indices that are occupied in some set of configurations but not in others
virtual_indicesthe indices of the orbitals that are considered virtual (i.e. unoccupied) by the electrons

◆ OrbitalSpace() [2/2]

GQCP::OrbitalSpace::OrbitalSpace ( const std::vector< size_t > &  occupied_indices,
const std::vector< size_t > &  virtual_indices 
)

Construct an orbital space only from occupied and virtual indices.

Parameters
occupied_indicesthe indices of the orbitals that are considered occupied by the electrons
virtual_indicesthe indices of the orbitals that are considered virtual (i.e. unoccupied) by the electrons
Note
This constructor assumes that there are no active orbital indices

Construct an orbital space from occupied and virtual indices.

Parameters
occupied_indicesthe indices of the orbitals that are considered occupied by the electrons
virtual_indicesthe indices of the orbitals that are considered virtual (i.e. unoccupied) by the electrons

Member Function Documentation

◆ createRepresentableObjectFor() [1/2]

template<typename Scalar >
ImplicitRankFourTensorSlice< Scalar > GQCP::OrbitalSpace::createRepresentableObjectFor ( const OccupationType  axis1_type,
const OccupationType  axis2_type,
const OccupationType  axis3_type,
const OccupationType  axis4_type,
const Tensor< Scalar, 4 > &  T 
) const
inline

Create an implicit mathematical object that can serve as the representation of a object with the given occupation types, from the dense tensor representation of a slice.

Template Parameters
Scalarthe scalar type of the elements of the implicit tensor
Parameters
axis1_typethe spinor occupation type for the first tensor axis
axis2_typethe spinor occupation type for the second tensor axis
axis3_typethe spinor occupation type for the third tensor axis
axis4_typethe spinor occupation type for the fourth tensor axis
Tthe dense representation of the tensor slice
Returns
an implicit rank-four tensor slice, according to the given occupation types
Note
For the representation of an occupied-occupied-virtual-virtual object (for example the T2-coupled-cluster amplitudes t_{ij}^{ab}), the following method can be called orbital_space.createRepresentableObjectFor(OccupationType::k_occupied, OccupationType::k_occupied, OccupationType::k_virtual, OccupationType::k_virtual, T), where T is supposed to be the dense tensor representation of the T2-amplitudes.

◆ createRepresentableObjectFor() [2/2]

template<typename Scalar >
ImplicitMatrixSlice< Scalar > GQCP::OrbitalSpace::createRepresentableObjectFor ( const OccupationType  row_type,
const OccupationType  column_type,
const MatrixX< Scalar > &  M 
) const
inline

Create an implicit mathematical object that can serve as the representation of a object with the given occupation types, from the dense representation of the matrix slice.

Template Parameters
Scalarthe scalar type of the elements of the implicit matrix
Parameters
row_typethe spinor occupation type for the rows
column_typethe spinor occupation type for the columns
Mthe dense representation of the matrix slice
Returns
an implicit matrix slice, according to the given occupation types
Note
For the representation of an occupied-virtual object (for example the T1-coupled-cluster amplitudes t_i^a), the following method can be called orbital_space.createRepresentableObjectFor(OccupationType::k_occupied, OccupationType::k_virtual, M), where M is supposed to be the dense matrix representation of the T1 amplitudes.

◆ description()

std::string GQCP::OrbitalSpace::description ( ) const
Returns
a textual description of this orbital space

◆ Implicit()

OrbitalSpace GQCP::OrbitalSpace::Implicit ( const std::map< OccupationType, size_t > &  occupation_type_numbers)
static

Create an implicit orbital space with the given dimensions.

Parameters
occupation_type_numbersa map that links an occupation type (k_occupied, k_active, k_virtual) with the number of orbitals that are to be found in that orbital space
Note
An 'implicit' orbital space is one where all indices are sorted by increasing value, and the occupied indices are lower than the active indices, which are in turn lower than the virtual indices.

◆ indices() [1/2]

const std::vector< size_t > & GQCP::OrbitalSpace::indices ( ) const
inline
Returns
all the indices of the spinors

◆ indices() [2/2]

const std::vector< size_t > & GQCP::OrbitalSpace::indices ( const OccupationType  type) const
Parameters
typethe occupation type that the indices should belong to
Returns
the indices that belong to the given occupation type

◆ initializeRepresentableObjectFor() [1/2]

template<typename Scalar >
ImplicitRankFourTensorSlice< Scalar > GQCP::OrbitalSpace::initializeRepresentableObjectFor ( const OccupationType  axis1_type,
const OccupationType  axis2_type,
const OccupationType  axis3_type,
const OccupationType  axis4_type 
) const
inline

Create an implicit, zero-initialized, mathematical object that can serve as the representation of a object with the given occupation types, from the dense tensor representation of a slice.

Template Parameters
Scalarthe scalar type of the elements of the implicit tensor
Parameters
axis1_typethe spinor occupation type for the first tensor axis
axis2_typethe spinor occupation type for the second tensor axis
axis3_typethe spinor occupation type for the third tensor axis
axis4_typethe spinor occupation type for the fourth tensor axis
Returns
a zero-initialized implicit rank-four tensor slice, according to the given occupation types
Note
For the representation of an occupied-occupied-virtual-virtual object (for example the T2-coupled-cluster amplitudes t_{ij}^{ab}), the following method can be called orbital_space.createRepresentableObjectFor(OccupationType::k_occupied, OccupationType::k_occupied, OccupationType::k_virtual, OccupationType::k_virtual)

◆ initializeRepresentableObjectFor() [2/2]

template<typename Scalar >
ImplicitMatrixSlice< Scalar > GQCP::OrbitalSpace::initializeRepresentableObjectFor ( const OccupationType  row_type,
const OccupationType  column_type 
) const
inline

Create an implicit, zero-initialized, mathematical object that can serve as the representation of a object with the given occupation types.

Template Parameters
Scalarthe scalar type of the elements of the implicit matrix
Parameters
row_typethe spinor occupation type for the rows
column_typethe spinor occupation type for the columns
Returns
a zero-initialized implicit matrix slice, according to the given occupation types
Note
For the representation of an occupied-virtual object (for example the T1-coupled-cluster amplitudes t_i^a), the following method can be called orbital_space.initializeRepresentableObjectFor(OccupationType::k_occupied, OccupationType::k_virtual)

◆ isIndex()

bool GQCP::OrbitalSpace::isIndex ( const OccupationType  type,
const size_t  p 
) const
Parameters
typean occupation type (k_occupied, k_active, k_virtual)
pan orbital index
Returns
if the orbital at the given index is in the given orbital set

◆ numberOfExcitations()

size_t GQCP::OrbitalSpace::numberOfExcitations ( const OccupationType  from,
const OccupationType  to 
) const
Parameters
fromthe type of orbitals that should be excited from
tothe type of orbitals that should be excited to
Returns
the number of possible excitations between the two orbital sets

◆ numberOfOrbitals() [1/2]

size_t GQCP::OrbitalSpace::numberOfOrbitals ( ) const
inline
Returns
the total number of orbitals (i.e. spatial orbitals or spinors, depending on the context) in this orbital space

◆ numberOfOrbitals() [2/2]

size_t GQCP::OrbitalSpace::numberOfOrbitals ( const OccupationType  type) const
inline
Parameters
typean occupation type (k_occupied, k_active, k_virtual)
Returns
the number of orbitals (i.e. spatial orbitals or spinors, depending on the context) that belong to the given occupation type

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