Template Class QuantumNumberChange

Inheritance Relationships

Base Type

  • public container::svector< boost::numeric::interval< std::make_signed_t< std::int64_t > >, 8 >

Class Documentation

template<typename QNV = std::int64_t, typename Tag = default_qns_tag>
class QuantumNumberChange : public container::svector<boost::numeric::interval<std::make_signed_t<std::int64_t>>, 8>

Tracks changes in N quantum numbers.

Implements the concept of a quantum number change; this is useful for tracking the quantum numbers of a many-body operator, such as the number of particles, the number of quasiparticles, the number of ops (creators/annihilators) in each subspace, etc. For example, to operator products expressed in normal order with respect to physical vacuum it is sufficient to track the number of creators and annihilators; For the fermi vacuum case, the number of creators and annihilators in each subspace becomes important. the number of ops is tracked for each base space (determined by the IndexSpaceRegistry object in Context). The interval representation is necessary to dictate how many creators or annihilators could be in each subspace. This is pertinent when user defined hole_space or particle_space are NOT base spaces. Since the choice of space partitioning is up to the user, the base class must be a dynamic container.

Template Parameters:
  • Tag – a tag type to distinguish different instances of QuantumNumberChange<N>

  • QNV – the quantum number value type, defaults to std::int64_t

Public Types

using QNC = std::make_signed_t<QNV>
using interval_t = boost::numeric::interval<QNC>
using base_type = container::svector<boost::numeric::interval<std::make_signed_t<QNV>>, 8>
using this_type = QuantumNumberChange<QNV, Tag>

Public Functions

inline const std::size_t size() const
inline QuantumNumberChange()

initializes all values with zeroes

template<typename I, typename Range, typename = std::enable_if_t<meta::is_range_v<std::remove_reference_t<Range>> && std::is_convertible_v<I, interval_t>>>
inline explicit QuantumNumberChange(Range &&i)

constructs QuantumNumberChange from a sequence of elements convertible to QNV

Template Parameters:

I – the type of the initializer_list elements

Parameters:

i – the sequence of QNV-convertible elements

template<typename I, typename = std::enable_if_t<std::is_convertible_v<std::initializer_list<I>, interval_t>>>
inline explicit QuantumNumberChange(std::initializer_list<std::initializer_list<I>> i)

constructs QuantumNumberChange from a sequence of elements convertible to QNV

Template Parameters:

I – the type of the initializer_list elements

Parameters:

i – the sequence of QNV-convertible elements

inline QuantumNumberChange &operator+=(const QuantumNumberChange &other)
inline bool operator==(const this_type &b) const
inline bool operator!=(const this_type &b) const
inline interval_t ncre_particles()

determines the number of creators in the particle space defined in the current context

inline interval_t nann_particles()

determines the number of annihilators in the particle space defined in the current context

inline interval_t ncre_holes()

determines the number of creators in the hole space defined in the current context

inline interval_t nann_holes()

determines the number of annihilators in the hole space defined in the current context

template<typename I>
inline bool in(I i)

tests whether particular changes in quantum number change

Parameters:

i – an integer

Returns:

true if i is in *this[0]

template<typename I, typename = std::enable_if_t<std::is_integral_v<I>>>
inline bool in(std::initializer_list<I> i)
Parameters:

i – an integer

Returns:

true if i is in *this[0]

inline bool overlaps_with(base_type i)
Parameters:

i – an array of N intervals

Returns:

true if i[k] overlaps with *this[k] for all k

inline auto hash_value() const