MPQC
3.0.0-alpha
|
a "dense" string represents occupancies of a set of Ns states by a fixed-width bitstring More...
#include <chemistry/qc/nbody/string.h>
Public Types | |
typedef std::bitset< Ns > | parent_type |
typedef size_t | state_index_type |
Public Member Functions | |
FermionOccupationNBitString (size_t nstates=Ns) | |
Constructs an empty set of states. | |
FermionOccupationNBitString (size_t nstates, const std::vector< state_index_type > &occupied_states) | |
Constructs FermionOccupationNBitString using a (possibly-empty) set of indices of occupied states. More... | |
bool | empty () const |
are all states empty? More... | |
void | reset () |
empties all states | |
size_t | size () const |
Reports the total number of states. More... | |
size_t | count () const |
Reports the number of occupied states. More... | |
FermionOccupationNBitString & | remove (size_t from) |
Removes a particle from_ state from_. More... | |
FermionOccupationNBitString & | add (size_t to) |
Adds a particle to_ state to_. More... | |
size_t | count (size_t pos1, size_t pos2) const |
counts the number of bits in (pos1,pos2) (assumes pos2 >= pos1) More... | |
size_t | hash_value () const |
template<size_t M> | |
bool | operator== (const FermionOccupationNBitString< M > &other) const |
FermionOccupationNBitString | operator+ (const FermionOccupationNBitString &other) |
a "dense" string represents occupancies of a set of Ns states by a fixed-width bitstring
Ns | the number of states |
|
inlineexplicit |
Constructs FermionOccupationNBitString using a (possibly-empty) set of indices of occupied states.
occupied_states |
|
inline |
Adds a particle to_ state to_.
Unsafe, but fast.
to_ | the state to_ which the particle will be added. The current status of the state is not checked. |
|
inline |
Reports the number of occupied states.
Referenced by sc::FermionOccupationNBitString< Ns >::count().
|
inline |
counts the number of bits in (pos1,pos2) (assumes pos2 >= pos1)
pos1 | |
pos2 |
References sc::FermionOccupationNBitString< Ns >::count().
|
inline |
are all states empty?
|
inline |
Removes a particle from_ state from_.
Unsafe, but fast.
from_ | the state from_ which the particle will be removed. The current status of the state is not checked. |
|
inline |
Reports the total number of states.