Nestedsums library
harmonic_sum Class Reference

A harmonic sum is a special case of a Ssum. More...

#include <harmonic_sum.h>

Inheritance diagram for harmonic_sum:
Ssum harmonic_sum_to_Infinity

Public Member Functions

 harmonic_sum (const GiNaC::ex &nc)
 
 harmonic_sum (const GiNaC::ex &nc, const GiNaC::ex &llc)
 
void archive (GiNaC::archive_node &node) const override
 
void read_archive (const GiNaC::archive_node &node, GiNaC::lst &sym_lst) override
 
GiNaC::return_type_t return_type_tinfo () const override
 
void print (const GiNaC::print_context &c, unsigned level=0) const override
 
GiNaC::ex eval () const override
 
GiNaC::ex convert_to_Zsum_exvector (const GiNaC::exvector &Z0, const GiNaC::exvector &Z1) const override
 
GiNaC::ex shuffle_exvector (const GiNaC::exvector &Z0, const GiNaC::exvector &Z1, const GiNaC::exvector &Z2) const override
 
GiNaC::ex set_index (const GiNaC::ex &i) const override
 
GiNaC::ex shift_plus_one (void) const override
 
GiNaC::ex shift_minus_one (void) const override
 
GiNaC::ex adjust_upper_limit_downwards (const GiNaC::ex &i) const override
 
GiNaC::ex adjust_upper_limit_upwards (const GiNaC::ex &i) const override
 
GiNaC::ex adjust_upper_limit_plus_one (void) const override
 
GiNaC::ex remove_first_letter (void) const override
 
GiNaC::ex remove_first_letter (const GiNaC::ex &nc) const override
 
- Public Member Functions inherited from Ssum
 Ssum (const GiNaC::ex &nc)
 
 Ssum (const GiNaC::ex &nc, const GiNaC::ex &llc)
 
void archive (GiNaC::archive_node &node) const override
 
void read_archive (const GiNaC::archive_node &node, GiNaC::lst &sym_lst) override
 
unsigned return_type (void) const override
 
void print (const GiNaC::print_context &c, unsigned level=0) const override
 
unsigned precedence (void) const override
 
GiNaC::ex eval () const override
 
GiNaC::ex subs (const GiNaC::exmap &m, unsigned options=0) const override
 
virtual GiNaC::ex refine_exvector (unsigned q, const GiNaC::exvector &Z0, const GiNaC::exvector &Z1) const
 
virtual GiNaC::ex refine (unsigned q) const
 
virtual GiNaC::ex index_eq_one (void) const
 
virtual GiNaC::ex get_head (int k) const
 
virtual GiNaC::ex get_tail (int k) const
 
virtual int flag_remove_negative_degrees (void) const
 
virtual GiNaC::ex remove_negative_degrees (void) const
 
virtual GiNaC::ex expand_members (int level=0) const
 
virtual GiNaC::ex eval_explicit () const
 
virtual GiNaC::ex get_first_letter (void) const
 
virtual GiNaC::ex prepend_letter (const GiNaC::ex &lc) const
 
virtual GiNaC::ex prepend_letter (const GiNaC::ex &nc, const GiNaC::ex &lc) const
 
virtual GiNaC::ex append_letter (const GiNaC::ex &lc) const
 
virtual GiNaC::ex append_letter_list (const GiNaC::ex &lc) const
 
GiNaC::ex get_index (void) const
 
GiNaC::ex get_letter_list (void) const
 
unsigned get_depth (void) const
 
GiNaC::ex get_weight (void) const
 

Additional Inherited Members

- Protected Member Functions inherited from Ssum
GiNaC::ex eval_ncmul (const GiNaC::exvector &v) const override
 
GiNaC::ex derivative (const GiNaC::symbol &s) const override
 
unsigned calchash (void) const override
 
virtual GiNaC::ex cast_to_Zsum (void) const
 
virtual GiNaC::ex multiply_letter_with_last_letter (const GiNaC::ex &lc) const
 
virtual GiNaC::ex multiply_letter_with_first_letter (const GiNaC::ex &lc) const
 
virtual GiNaC::ex concat_two_sums (const GiNaC::ex &Z1, const GiNaC::ex &Z2) const
 
- Protected Attributes inherited from Ssum
GiNaC::ex n
 
GiNaC::ex letter_list
 

Detailed Description

A harmonic sum is a special case of a Ssum.

Harmonic sums are recursively defined by

\[
   S_{m_1,...,m_k}(n) = \sum\limits_{i=1}^n \frac{1}{i^{m_1}} S_{m_2,...,m_k}(i)
\]

with

\[
   S(n) = 1
\]

for $ n > 0 $.

Harmonic sums can be converted to Euler-Zagier sums (and vice versa).

Member Function Documentation

◆ adjust_upper_limit_downwards()

ex adjust_upper_limit_downwards ( const GiNaC::ex & i) const
overridevirtual

Adjusts the upper summation limit $n$ down to $i$, e.g.

\[
    S(n;m_1,...;1,...) = S(i;m_1,...;1,...) 
     + \sum\limits_{j=0}^{n-i-1} \frac{1}{(i+j+1)^{m_1}} S(i+j+1;m_2,...;1,...)
\]

with $n > i $.

For the empty sum we have

\[
    S(n) = S(i)
\]

This routine assumes $ i \ge 1 $.

Reimplemented from Ssum.

◆ adjust_upper_limit_plus_one()

ex adjust_upper_limit_plus_one ( void ) const
overridevirtual

Adjusts the upper summation limit $n$ to $n+1$, e.g.

\[
    S(n;m_1,...;1,...) = S(n+1;m_1,...;1,...) 
     \mbox{} - \frac{1}{(n+1)^{m_1}} S(n+1;m_2,...;1,...).
\]

Reimplemented from Ssum.

◆ adjust_upper_limit_upwards()

ex adjust_upper_limit_upwards ( const GiNaC::ex & i) const
overridevirtual

Adjusts the upper summation limit $n$ up to $i$, e.g.

\[
    S(n;m_1,...;1,...) = S(i;m_1,...;1,...) 
     \mbox{} - \sum\limits_{j=0}^{i-n-1} \frac{1}{(i-j)^{m_1}} S(i-j;m_2,...;1,...)
\]

with $n < i $.

For the empty sum we have

\[
    S(n) = S(i)
\]

This routine assumes $ n \ge 1 $.

This routine might give rise to poles for some values of $i$ and should be used with care.

Reimplemented from Ssum.

◆ convert_to_Zsum_exvector()

ex convert_to_Zsum_exvector ( const GiNaC::exvector & Z0,
const GiNaC::exvector & Z1 ) const
overridevirtual

A more efficient version for the conversion to Euler_Zagier_sums, based on exvector (e.g. std::vector<GiNaC::ex> ). Z0 contains the result. Z1 is reversed order, so that we can use pop_back.

Reimplemented from Ssum.

◆ eval()

ex eval ( ) const
override

The simplifications are done in the following order:

  • If the upper summation limit is equal to infinity, we have a harmonic_sum_to_Infinity.
  • If the upper summation index is an integer, perform the sum explicitly.

◆ remove_first_letter() [1/2]

GiNaC::ex remove_first_letter ( const GiNaC::ex & nc) const
overridevirtual

Reimplemented from Ssum.

◆ remove_first_letter() [2/2]

ex remove_first_letter ( void ) const
overridevirtual

Returns a harmonic_sum with the first letter removed from the letter_list.

Reimplemented from Ssum.

◆ set_index()

ex set_index ( const GiNaC::ex & i) const
overridevirtual

Sets the upper summation index to $i$

Reimplemented from Ssum.

◆ shift_minus_one()

ex shift_minus_one ( void ) const
overridevirtual

Returns $S(n-1,m_1,...,1,...)$

Reimplemented from Ssum.

◆ shift_plus_one()

ex shift_plus_one ( void ) const
overridevirtual

Returns $S(n+1,m_1,...,1,...)$

Reimplemented from Ssum.

◆ shuffle_exvector()

ex shuffle_exvector ( const GiNaC::exvector & Z0,
const GiNaC::exvector & Z1,
const GiNaC::exvector & Z2 ) const
overridevirtual

A more efficient version for the multiplication of harmonic_sums, based on exvector (e.g. std::vector<GiNaC::ex> ). Z0 contains the result. Z1 and Z2 are in reversed order, so that we can use pop_back.

Reimplemented from Ssum.


The documentation for this class was generated from the following files: