Struct binary_state

Struct Documentation

struct binary_state

The struct binary_state is used to represent basis states in the Hilbert space.

Public Functions

inline binary_state()
inline binary_state(uint64_t _b)
inline binary_state(uint32_t L, uint32_t R)
inline binary_state(uint32_t R)
inline binary_state(const binary_state &bin)
inline size_t count()

returns the number of set bits

inline uint32_t left() const

returns the left part of the binary representation

inline uint32_t right() const

returns the right part of the binary representation

inline size_t double_occupancy()
inline int interphase(uint64_t i, uint64_t j)

returns -1 if an odd number of bits are set between positions defined by masks i and j.

otherwise returns 1.

int one_body(uint64_t b, uint64_t a)

shifts set bit in position i to position j returns the fermionic phase (+1 or -1) generated by the shift, or zero if the shift is impossible

Parameters:
  • i – bitmask of the source orbital (bit to shift from)

  • j – bitmask of the destination orbital (bit to shift to)

int pair_annihilate(uint64_t i, uint64_t j)

turn set bits at i and j into zero.

returns the phase (+1 or -1) generated by the operation, or zero if the operation is impossible

Parameters:
  • i – bitmask of the first orbital to annihilate

  • j – bitmask of the second orbital to annihilate

int pair_create(uint64_t i, uint64_t j)

turn set bits at i and j into zero.

returns the phase (+1 or -1) generated by the operation, or zero if the operation is impossible

Parameters:
  • i – bitmask of the first orbital to create

  • j – bitmask of the second orbital to create

Public Members

uint64_t b

Public Static Functions

static inline void flip_spin(uint64_t &x)
static inline uint64_t mask(size_t i, size_t _n)

Public Static Attributes

static uint64_t leftmask = binary_state::rightmask << 32
static uint64_t rightmask = ((1L << 32) - 1)

static members of the binary_state class