Documentation
A block-"sparse" nullable string represents occupancies of an arbitrarily-large set of states as a set of alternating unoccupied/occupied blocks. The null string is distinct from a string in space of 0 states.
Classes | |
struct | Block |
represents a continuous block of states of same occupancy More... | |
Public Types | |
using | state_index_type = orbital_index_type |
typedef std::set< Block > | Blocks |
using | vectorofbool_t = boost::container::small_vector< bool, 128 > |
Member Typedef Documentation
◆ Blocks
typedef std::set<Block> mpqc::FermionOccupationBlockString::Blocks |
◆ state_index_type
◆ vectorofbool_t
using mpqc::FermionOccupationBlockString::vectorofbool_t = boost::container::small_vector<bool, 128> |
Constructor & Destructor Documentation
◆ FermionOccupationBlockString() [1/8]
|
default |
constructs a null string
◆ FermionOccupationBlockString() [2/8]
|
inline |
copy ctor
- Note
- does not copy memoized part of state
◆ FermionOccupationBlockString() [3/8]
|
default |
move ctor
◆ ~FermionOccupationBlockString()
|
default |
◆ FermionOccupationBlockString() [4/8]
|
inlineexplicit |
Constructs a set of Ns states
- Parameters
-
Ns number of states [in] default_to_occupied if true, will make all states occupied
◆ FermionOccupationBlockString() [5/8]
|
inlineexplicit |
Constructs a string of N
states using bits encoded by an unsigned long
- Parameters
-
[in] Ns number of states represented by this string, asserted to be less than or equal to Ns
[in] ulong_bitset an unsigned long encoding the string
◆ FermionOccupationBlockString() [6/8]
|
inline |
Constructs FermionOccupationBlockString using a (possibly-empty) set of indices of occupied states
- Template Parameters
-
IntegralRange a range of integers
- Parameters
-
[in] Ns number of states represented by this string occupied_states the sequence of occupied states
◆ FermionOccupationBlockString() [7/8]
|
inline |
Constructs FermionOccupationBlockString using a (possibly-empty) set of indices of occupied states
- Template Parameters
-
Integer an integral type
- Parameters
-
[in] Ns number of states represented by this string occupied_states the sequence of occupied states
◆ FermionOccupationBlockString() [8/8]
|
inlineexplicit |
Constructs FermionOccupationBlockString using a (possibly-empty) set of indices of occupied states
- Parameters
-
occupied_states
Member Function Documentation
◆ add()
|
inline |
Adds a particle to state to_.
- Parameters
-
to the state to_which the particle will be added.
- Returns
- reference to this string, for chaining operations (e.g. a.remove(0).remove(7).add(13) etc.)
- Note
- if this object is null, this is noop
◆ append()
|
inline |
appends other to the end of this
- Parameters
-
other the string to be appended
- Returns
- *this
- Note
- asserts that this and
other
other is nonnull
◆ count() [1/2]
|
inline |
Reports the number of occupied states
- Returns
- the number of occupied states
- Note
- asserts that this is nonnull
◆ count() [2/2]
|
inline |
counts the number of bits in (pos1,pos2) (assumes pos2 >= pos1)
- Parameters
-
pos1 integer in [-1,Ns), set to -1 to count bits in [0,pos2) pos2 integer in [0,Ns)
- Returns
- the number of bits in (pos1,pos2)
- Note
- asserts that this is nonnull
◆ empty()
|
inline |
are all states empty?
- Returns
- true if all states are empty
- Note
- asserts that this is nonnull
◆ hash_value()
|
inline |
◆ occupied_states()
|
inline |
Reports the states that are occupied in this string
- Returns
- a range with the indices of all occupied states (in increasing order)
- Note
- asserts that this is nonnull
◆ operator bool()
|
inlineexplicit |
◆ operator!=()
|
inline |
- Parameters
-
[in] other another string
- Returns
- true if
(*this)==other is false
◆ operator=() [1/2]
|
inline |
copy assignment
- Note
- does not copy memoized part of state
◆ operator=() [2/2]
|
default |
move assignment
◆ operator==()
|
inline |
- Parameters
-
[in] other another string
- Returns
- true if both are null or are equal
◆ operator[]()
|
inline |
Returns the occupancy of state i
- Parameters
-
i the state
- Returns
- true is the state is occupied
- Note
- asserts that this is nonnull
◆ operator^()
|
inline |
XORs two strings
- Parameters
-
[in] other another string with which this will be XORed
- Note
- asserts that this and
other
other is nonnull
◆ populated_states()
|
inline |
Reports the states in the order of their occupancy (occupied first, unoccupied second)
- Returns
- a const reference to (memoized) PopulatedSparseOrbitalRange object, with occupied orbitals preceding occupied orbitals
- Note
- asserts that this is nonnull
◆ remove()
|
inline |
Removes a particle from_ state from_.
- Parameters
-
from_ the state from_ which the particle will be removed.
- Returns
- reference to this string, for chaining operations (e.g. a.remove(0).remove(7).add(13) etc.)
- Note
- if this object is null, this is noop
◆ reset()
|
inline |
empties all states
◆ size()
|
inline |
Reports the total number of states
- Returns
- the total number states
- Note
- asserts that this is nonnull
◆ to_bitset()
|
inline |
converts to bitset
- Returns
- return bitset
- Note
- asserts that this is nonnull
◆ to_ulong()
|
inline |
converts to unsigned long
- Returns
- unsigned long representation of this string
- Note
- asserts that this is nonnull
◆ to_vectorofbool()
|
inline |
converts to the vector-of-bool representation of this string
- Returns
- vector-of-bool representation of this string
- Note
- asserts that this is nonnull
◆ unoccupied_states()
|
inline |
Reports the states that are unoccupied in this string
- Returns
- a range with the indices of all unoccupied states (in increasing order)
- Note
- asserts that this is nonnull
The documentation for this class was generated from the following file:
- mpqc/math/fock/string.h