a "dense" string represents occupancies of a set of Ns states by a bitstring
More...
#include <chemistry/qc/nbody/string.h>
|
|
typedef boost::dynamic_bitset | parent_type |
| |
|
typedef size_t | state_index_type |
| |
|
|
| FermionOccupationDBitString (size_t N) |
| | Constructs an empty set of N states.
|
| |
|
| FermionOccupationDBitString (boost::dynamic_bitset<> &&bs) |
| |
| | FermionOccupationDBitString (size_t N, const std::vector< state_index_type > &occupied_states) |
| | Constructs FermionOccupationDBitString using a (possibly-empty) set of indices of occupied states.
|
| |
| bool | empty () const |
| | are all states empty?
|
| |
|
void | reset () |
| | empties all states
|
| |
| size_t | count () const |
| | Reports the number of occupied states.
|
| |
| FermionOccupationDBitString & | remove (size_t from) |
| | Removes a particle from_ state from_.
|
| |
| FermionOccupationDBitString & | add (size_t to) |
| | Adds a particle to_ state to_.
|
| |
| size_t | count (size_t pos1, size_t pos2) const |
| | counts the number of bits in (pos1,pos2) (assumes pos2 >= pos1)
|
| |
|
size_t | hash_value () const |
| |
|
bool | operator== (const FermionOccupationDBitString &other) const |
| |
a "dense" string represents occupancies of a set of Ns states by a bitstring
- Template Parameters
-
◆ FermionOccupationDBitString()
| sc::FermionOccupationDBitString::FermionOccupationDBitString |
( |
size_t | N, |
|
|
const std::vector< state_index_type > & | occupied_states ) |
|
inlineexplicit |
◆ add()
Adds a particle to_ state to_.
Unsafe, but fast.
- Parameters
-
| to_ | the state to_ which the particle will be added. The current status of the state is not checked. |
- Returns
- reference to_ this string, for chaining operations (e.g. a.remove(0).remove(7).add(13) etc.)
◆ count() [1/2]
| size_t sc::FermionOccupationDBitString::count |
( |
| ) |
const |
|
inline |
Reports the number of occupied states.
- Returns
- the number of occupied states
Referenced by count().
◆ count() [2/2]
| size_t sc::FermionOccupationDBitString::count |
( |
size_t | pos1, |
|
|
size_t | pos2 ) const |
|
inline |
counts the number of bits in (pos1,pos2) (assumes pos2 >= pos1)
- Parameters
-
- Returns
References count().
◆ empty()
| bool sc::FermionOccupationDBitString::empty |
( |
| ) |
const |
|
inline |
are all states empty?
- Returns
- true if all states are empty
◆ remove()
Removes a particle from_ state from_.
Unsafe, but fast.
- Parameters
-
| from_ | the state from_ which the particle will be removed. The current status of the state is not checked. |
- Returns
- reference to_ this string, for chaining operations (e.g. a.remove(0).remove(7).add(13) etc.)
The documentation for this class was generated from the following file: