mpqc::SlaterDeterminantSet< StringRange, HashMap > Class Template Reference
Documentation
template<typename StringRange, template< typename... > class HashMap>
class mpqc::SlaterDeterminantSet< StringRange, HashMap >
A (sparse) set of Slater determinants.
- Template Parameters
-
StringRange range of strings
Public Types | |
using | string_range_type = StringRange |
using | ordinal_type = std::int64_t |
using | string_iterator = typename StringRange::const_iterator |
using | String = typename StringRange::value_type |
using | SlaterDeterminant = ::mpqc::SlaterDeterminant< StringRange > |
using | SDContainer = HashMap< SlaterDeterminant, ordinal_type, typename SlaterDeterminant::hash, typename SlaterDeterminant::equal_to > |
using | const_iterator = typename SDContainer::const_iterator |
Public Member Functions | |
SlaterDeterminantSet (const StringRange &astrings, const StringRange &bstrings, bool full=false) | |
SlaterDeterminantSet (std::shared_ptr< const StringRange > astrings, std::shared_ptr< const StringRange > bstrings, bool full=false) | |
SlaterDeterminantSet (const SlaterDeterminantSet &)=default | |
SlaterDeterminantSet (SlaterDeterminantSet &&) noexcept=default | |
SlaterDeterminantSet & | operator= (const SlaterDeterminantSet &)=default |
SlaterDeterminantSet & | operator= (SlaterDeterminantSet &&) noexcept=default |
~SlaterDeterminantSet ()=default | |
std::size_t | size () const |
size_t | bucket_count () const |
const StringRange & | strings (SpinCase1 s) const |
const_iterator | insert (string_iterator astr, string_iterator bstr, ordinal_type ord=-1) |
const_iterator | safe_insert (string_iterator astr, string_iterator bstr, ordinal_type ord=-1) |
const_iterator | find (string_iterator astr, string_iterator bstr) const |
const_iterator | find (std::size_t astr_hash_value, std::size_t bstr_hash_value) const |
std::optional< const_iterator > | safe_find (string_iterator astr, string_iterator bstr) const |
std::optional< const_iterator > | safe_find (std::size_t astr_hash_value, std::size_t bstr_hash_value) const |
ordinal_type | find_ordinal (string_iterator astr, string_iterator bstr) const |
std::optional< ordinal_type > | safe_find_ordinal (string_iterator astr, string_iterator bstr) const |
std::tuple< ordinal_type, bool > | find_or_insert (string_iterator astr, string_iterator bstr) |
SlaterDeterminant | operator[] (ordinal_type i) const |
SlaterDeterminantSet | make_product (const SlaterDeterminantSet &other, std::function< void(const const_iterator &, const const_iterator &, const const_iterator &)> op={}) const |
constructs tensor product with another SlaterDeterminantSet More... | |
bool | operator== (const SlaterDeterminantSet &other) const |
Iterator accessors | |
| |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
Static Public Attributes | |
static constexpr bool | string_range_is_random_access |
Member Typedef Documentation
◆ const_iterator
template<typename StringRange , template< typename... > class HashMap>
using mpqc::SlaterDeterminantSet< StringRange, HashMap >::const_iterator = typename SDContainer::const_iterator |
◆ ordinal_type
template<typename StringRange , template< typename... > class HashMap>
using mpqc::SlaterDeterminantSet< StringRange, HashMap >::ordinal_type = std::int64_t |
◆ SDContainer
template<typename StringRange , template< typename... > class HashMap>
using mpqc::SlaterDeterminantSet< StringRange, HashMap >::SDContainer = HashMap<SlaterDeterminant, ordinal_type, typename SlaterDeterminant::hash, typename SlaterDeterminant::equal_to> |
◆ SlaterDeterminant
template<typename StringRange , template< typename... > class HashMap>
using mpqc::SlaterDeterminantSet< StringRange, HashMap >::SlaterDeterminant = ::mpqc::SlaterDeterminant<StringRange> |
◆ String
template<typename StringRange , template< typename... > class HashMap>
using mpqc::SlaterDeterminantSet< StringRange, HashMap >::String = typename StringRange::value_type |
◆ string_iterator
template<typename StringRange , template< typename... > class HashMap>
using mpqc::SlaterDeterminantSet< StringRange, HashMap >::string_iterator = typename StringRange::const_iterator |
◆ string_range_type
template<typename StringRange , template< typename... > class HashMap>
using mpqc::SlaterDeterminantSet< StringRange, HashMap >::string_range_type = StringRange |
Constructor & Destructor Documentation
◆ SlaterDeterminantSet() [1/4]
template<typename StringRange , template< typename... > class HashMap>
|
inline |
- Parameters
-
[in] astrings the spin-up string range [in] bstrings the spin-down string range [in] full if true, construct the set of all possible determinants else construct an empty set; if StringRange
is a random access range then searching a full set can be significantly optimized
- Warning
- SlaterDeterminantSet will not manage the lifetime of
astrings
andbstrings
◆ SlaterDeterminantSet() [2/4]
template<typename StringRange , template< typename... > class HashMap>
|
inline |
- Parameters
-
[in] astrings shared_ptr
to the spin-up string range[in] bstrings shared_ptr
to the spin-down string range[in] full if true, construct the set of all possible determinants else construct an empty set; if StringRange
is a random access range then searching a full set can be significantly optimized
- Note
- SlaterDeterminantSet will manage the lifetime of
astrings
andbstrings
◆ SlaterDeterminantSet() [3/4]
template<typename StringRange , template< typename... > class HashMap>
|
default |
◆ SlaterDeterminantSet() [4/4]
template<typename StringRange , template< typename... > class HashMap>
|
defaultnoexcept |
◆ ~SlaterDeterminantSet()
template<typename StringRange , template< typename... > class HashMap>
|
default |
Member Function Documentation
◆ begin()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ bucket_count()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
- Returns
- the number of buckets holding the determinants
◆ cbegin()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ cend()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ end()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ find() [1/2]
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ find() [2/2]
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ find_or_insert()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
Looks for the determinant, and inserts it if not found
- Parameters
-
[in] astr spin-up string [in] bstr spin-down string
- Returns
{ordinal
,inserted} whereis
the ordinal index andinserted
is true if the determinant was inserted
◆ find_ordinal()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ insert()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
insert determinant defined by 2 strings, with optionally-specified ordinal value
- Parameters
-
[in] astr spin-up string iterator [in] bstr spin-down string iterator [in] ord ordinal value to assign to this determinant; if not given use this->size()
- Returns
- the iterator to the inserted determinant
◆ make_product()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
constructs tensor product with another SlaterDeterminantSet
- Parameters
-
other another SlaterDeterminantSet object op this callable will be called, if nonnull, for each product determinant with the iterators pointing to the determinant from *this
andother
sets used to construct the product, as well as the iterator to the product determinant in the result
- Returns
- the tensor product of this with
other
- Postcondition
◆ operator=() [1/2]
template<typename StringRange , template< typename... > class HashMap>
|
default |
◆ operator=() [2/2]
template<typename StringRange , template< typename... > class HashMap>
|
defaultnoexcept |
◆ operator==()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
comparison operator
- Parameters
-
[in] other a set of Slater determinants to be compared to *this
- Returns
- true if
*this
andother
contain same determinants (not necessarily in the same order)
- Note
- comparison of the underlying string sets is shallow (i.e., must point to the same objects)
◆ operator[]()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ safe_find() [1/2]
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ safe_find() [2/2]
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ safe_find_ordinal()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
◆ safe_insert()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
insert determinant defined by 2 strings, with optionally-specified ordinal value
- Parameters
-
[in] astr spin-up string iterator [in] bstr spin-down string iterator [in] ord ordinal value to assign to this determinant; if not given use this->size()
- Returns
- the iterator to the inserted determinant
◆ size()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
- Returns
- the number of determinants in the set
◆ strings()
template<typename StringRange , template< typename... > class HashMap>
|
inline |
- Parameters
-
[in] s spin case
- Returns
- const reference to the set of strings of spin case
s
Member Data Documentation
◆ string_range_is_random_access
template<typename StringRange , template< typename... > class HashMap>
|
staticconstexpr |
Initial value:
= std::is_same_v<
typename std::iterator_traits<string_iterator>::iterator_category,
std::random_access_iterator_tag>
The documentation for this class was generated from the following files:
constexpr SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
Definition: spin.cpp:61