import – Convert GiNaC harmonic polylogarithms to HPL packages’ notation in mathematica

A general out put from GiNaC( of harmonic polylogarithms is


We want to convert it to mathematica version (


Note: we need “a general string expression” for the “a,b,c…” in
H(a,b,c...,x) as we have to dealing with a lot of H‘s like:

converting H(2,2,x),H(2,1,x),H(2,1,2,x),H(1,2,3,4,x),H(1,2,3,4,5,x),etc

to HPL({2,2},x),HPL({1,2},x),HPL({1,2,3},x),HPL({1,2,3,4},x),HPL({1,2,3,4,5},x)