The core of the new code will be algorithms for expressing Hypergeometric and Meijer G functions in terms of known special functions. This is fairly complicated, so let me use this blog post to order my thoughts on the Hypergeometric case. The Meijer G case is fairly similar, there are just more indices to keep track of and more possible transformations, I’ll describe this in a later post.

Most of this post is based on the paper by Kelly Roach.

So first of all the Hypergeometric function is initially defined as a series: , where and represent vectors of respectively and complex parameters, and . This converges in some disc if and none of the is a negative integer (it also converges in some other cases if one of the is a non-positive integer). Notice that the Hypergeometric function is symmetric in all numerator parameters (the ), and also in all denominator parameters (the ).

It turns out that there are certain differential operators that can change the and parameters by integers. If a sequence of such operators is known that converts the set of indices and into and , then we shall say the pair is *reachable* from . Our general strategy is thus as follows: given a set of parameters, try to look up an *origin* for which we know an expression, and then apply the sequence of differential operators to the known expression to find an expression for the Hypergeometric function we are interested in.

## Notation

In the following, the symbol will always denote a numerator parameter and the symbol will always denote a denominator parameter. The subscripts denote *vectors* of that length, so e.g. denotes a vector of numerator parameters. The subscripts and denote “running indices”, so they should usually be used in conjuction with a “for all “. E.g. for all . Uppercase subscripts and denote a chosen, fixed index. So for example is true if the inequality holds for the one index we are currently interested in.

## Incrementing and decrementing indices

Suppose . Set . It is then easy to show that , where is the i-th unit vector. Similarly for we set and find . Thus we can increment upper and decrement lower indices at will, as long as we don’t go through zero. The and are called *shift operators*.

It is also easy to show that , where is the vector and similarly for . Combining this with the shift operators, we arrive at one form of the Hypergeometric differential equation: . This holds if all shift operators are defined, i.e. if no and no . Clearing denominators and multiplying through by z we arrive at the following equation: . Even though our derivation does not show it, it can be checked that this equation holds whenever the is defined.

Notice that, under suitable conditions on , each of the operators , and can be expressed in terms of or . Our next aim is to write the Hypergeometric differential equation as follows: , for some operator to be determined. If , then we can write this as , and so undoes the shifting of , whence it will be called an *inverse-shift operator*.

Now exists if , and then . Observe also that all the operators , and commute. We have , so this gives us the first half of . The other half does not have such a nice expression. We find . Since the first half had no constant term, we infer .

This tells us under which conditions we can “un-shift” , namely when and . Substituting for then tells us under what conditions we can *decrement* the index . Doing a similar analysis for , we arrive at the following rules:

- An index can be decremented if and for all .
- An index can be incremented if and for all .

Combined with the conditions (stated above) for the existence of shift operators, we have thus established the rules of the game!

## Reduction of Order

Notice that, quite trivially, if , we have , where means with omitted, and similarly for . We call this reduction of order.

In fact, we can do even better. If , then it is easy to see that is actually a polynomial in . It is also easy to see that . Combining these two remarks we find:

- If , then there exists a polynomial (of degree ) such that and .

Thus any set of parameters is reachable from a set of parameters where implies . Such a set of parameters is called *suitable*. Our database of known formulae should only contain suitable origins. The reasons are twofold: firstly, working from suitable origins is easier, and secondly, a formula for a non-suitable origin can be deduced from a lower order formula, and we should put this one into the database instead.

## Moving Around in the Parameter Space

It remains to investigate the following question: suppose and are both suitable, and also , . When is reachable from ? It is clear that we can treat all parameters independently that are incongruent mod 1. So assume that and are congruent to mod 1, for all and . The same then follows for and .

If , then **any** such is reachable from **any** . To see this notice that there exist constants , congruent mod 1, such that for all and , and similarly . If then we first inverse-shift all the times up, and then similarly shift shift up all the times. If then we first inverse-shift down the and then shift down the . This reduces to the case . But evidently we can now shift or inverse-shift around the arbitrarily so long as we keep them less than , and similarly for the so long as we keep them bigger than . Thus is reachable from .

If then the problem is slightly more involved. WLOG no parameter is zero. We now have one additional complication: no parameter can ever move through zero. Hence is reachable from if and only if the number of equals the number of , and similarly for the and . But in a suitable set of parameters, all ! This is because the Hypergeometric function is undefined if one of the is a non-positive integer and all are smaller than the . Hence the number of is always zero.

We can thus associate to every suitable set of parameters , where no , the following invariants:

- For every the number of parameters , and similarly the number of parameters .
- The number of integers with .

The above reasoning shows that is reachable from if and only if the invariants all agree. Thus in particular “being reachable from” is a symmetric relation on suitable parameters without zeros.

## Applying the Operators

If all goes well then for a given set of parameters we find an origin in our database for which we have a nice formula. We now have to apply (potentially) many differential operators to it. If we do this blindly then the result will be very messy. This is because with Hypergeometric type functions, the derivative is usually expressed as a sum of two contiguous functions. Hence if we compute derivatives, then the answer will involve contiguous functions! This is clearly undesirable. In fact we know from the Hypergeometric differential equation that we need at most contiguous functions to express all derivatives.

Hence instead of differentiating blindly, we will work with a -module basis: for an origin we either store (for particularly pretty answers) or compute a set of functions (typically ) with the property that the derivative of any of them is a -linear combination of them. In formulae, we store a vector of functions, a matrix and a vector (the latter two with entries in ), with the following properties:

- .

Then we can compute as many derivatives as we want and we will always end up with -linear combination of at most special functions.

As hinted above, , and can either all be stored (for particularly pretty answers) or computed from a single formula.

I’m a little confused what you mean by and with capital subscripts as opposed to lowercase subscripts.

For whatever reason, 2N () is rendering as 3- () in the last paragraph (but the mouseover text says “2N”).

So did I read it right that everything has to differ by integers? In other words, if you have 3/4 in your result, then you only need to look for items in the table that are congruent to 3/4 mod 1 for that index?

This looks good. Very interesting. Now I’d like to read about how you plan to implement. Based on this, I’d say that just the MeijerG class should be non-trivial to implement (if it includes all these things as methods), so I’d like to see ideas how you plan to design it.

I think that latex thing is a WordPress bug. If I create a new post on my blog with the text from the first sentence and preview it, it says “For whatever reason, 2N (2N) is rendering as 3- (2N) in the last paragraph (but the mouseover text says “2N”).” Weird.

I already commented on this, but it must have gotten lost. I am unclear on the difference between and in your notation (how are the capital indices different?).

For some reason wordpress wants me to moderate every comment. Got to tweak the settings somehow…

I will write about implementation in the next post(s).

As for capitalised indices, there is not much of a difference. I’m mentally fixing the I and/or J, and then ask “can I increment index I on a”. I’ll try to make this clearer.

OK, that’s what I thought it was (lowercase implies for all), but it wasn’t clear.