I have the following problem at hand.
1.) I have a list of definitions like
L[{0},z]=H[{0},z]+H[{0},zp]
L[{1},z]=H[{1},z]+H[{1},zp]
L[{0,0},z]=H[{0,0},z]+H[{0,0},zp]+H[{0},z]H[{0},zp]
...
and many more of this and similar kind. Note that there is NO common pattern.
2.) Now I have a sum of terms like
g=1/2*H[{0},z]+1/2*H[{0},zp]+...
3.) Here comes the question:
How can I tell Mathematica to replace the terms in g by the (actually long list) definitions of 1.), e.g.
g=1/2L[{0},z]+...
I want to do this in an automated fashion just by somehow throwing all definitions of 1.) to 2.), i.e. I don't want to write a replace command by hand for all definitons of 1.)
Some more info: I am given the function g defined through the H's (which are polylogs). These polylogs can used to define a basis of another type of polylogs called L (denoted in 1.)). Now, my goal is to reexpress the function g given in the H-basis in the L-basis through the definitions in 1.).
Edit: z, and zp are the complex variable z and its conjugate.
To give an example: I have an expression like this:
-(1/16) (H[{0}, z] + H[{0}, zp])^2 + 1/4 (1/2 H[{0}, z] + 1/2 H[{0}, zp] + H[{1}, z] + H[{1}, zp])^2
which is equivalent to (just using the definitions from above)
-(1/16) (L[{0},z])^2 + 1/4 (1/2 L[{0}, z] + L[{1}, z])^2
Using FullSimplify on this would shadow the nice structure since the definitions of point 1 are already obvious here.
Probably very unelegant, my attempt (I have to put in the number of definitons of L by hand. Here = 14).
rules = Table[Expand[a_.*DownValues[L][[i]][[2]]] -> a*DownValues[L][[i]][[1]], {i, 1, 14}]
It does what I want though :)