# Meld function

+1 vote

Hello!

I've tryed to use meld function after it's upgrade and it looks very strange

minimal example with first brackets:

{a,b,c,d,e,f,g,h,i,j,k,l,m,n,q,r,s,u,v,w,z#}::Indices(full,values={t,x,y}, position=independent);
\partial{#}::PartialDerivative.
\nabla{#}::Derivative.
{\nabla{#},\partial{#}}::Commuting.
h_{m? n?}::Metric.
h^{m? n?}::InverseMetric.
h_{m? n?}::Symmetric.
h^{m? n?}::Symmetric.
X_{m? n?}::Depends(\nabla{#}, \partial{#}).
h_{m n}::Depends(\partial{#}).
h^{m n}::Depends(\partial{#}).
deth::Depends(\partial{#}).
K::Depends(\nabla{#}, \partial{#}).
KX::Depends(\nabla{#}, \partial{#}).
delh_{m n}::Depends(\nabla{#}, \partial{#}).
delh^{m n}::Depends(\nabla{#}, \partial{#}).
delpi::Depends(\nabla{#}, \partial{#}).
p::LaTeXForm("\pi").
KX::LaTeXForm("K_{X}").
delh^{m? n?}::LaTeXForm("\delta h^{", m? n?, "}").
\Dh::LaTeXForm("\sqrt{-h}").

ex:= \Dh delh^{a b} ( -  1/2 h_{a b} K \Box(p) + KX X_{a b} \Box(p)-K \nabla_{a}(\nabla_{b}(p))-2\nabla_{a}(K) \nabla_{b}(p));
meld(ex);


Dom is looking into this.

+1 vote

This has been fixed in 2.3.6.4.

There are still some bugs left. I applied the meld function to my expression and it clearly changed.

I unloaded it before and after using the meld function, and the expressions were not equal, this can be seen at least by the fourth term in the upper expression and the last term in the lower expression.

Below is the code with the upper and lower expression and their comparison:

    {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q,r,s,u,v,w,x,y,z#}::Indices(full,values={t,x,y}, position=independent).
\partial{#}::PartialDerivative.
\nabla{#}::Derivative.
{\nabla{#},\partial{#}}::Commuting.
h_{m? n?}::Metric.
h^{m? n?}::InverseMetric.
h_{m? n?}::Symmetric.
h^{m? n?}::Symmetric.
F_{m? n?}::AntiSymmetric.
\Gamma^{m}_{n q}::TableauSymmetry(shape={2}, indices={1,2}).
p::LaTeXForm("\pi").
G4p::LaTeXForm("G_{4\pi}").
G4X::LaTeXForm("G_{4X}").
G4XX::LaTeXForm("G_{4XX}").
G4Xp::LaTeXForm("G_{4\pi X}").
pi2::LaTeXForm("\pi^{m n}\pi_{m n}").
boxpi4::LaTeXForm("\Box^{(4)}{\pi}").
delboxpi4::LaTeXForm("\delta\Box^{(4)}{\pi}").
pi24::LaTeXForm("\pi^{\mu \nu}\pi_{\mu \nu}").

mathcalG:= G4 R_{a b}-2G4 \nabla_{a}(\phi) \nabla_{b}(\phi) (\phi)**(-1)-\nabla_{a}(\nabla_{b}(G4)) + \nabla_{c}(\nabla_{d}(G4)) h^{c d} h_{a b} -  1/2 F_{a c} F_{b d} G4 (\phi)**2 h^{c d}-2\nabla_{a}(G4X \nabla_{b}(p) boxpi4) + \nabla_{c}(G4X \nabla_{d}(p) boxpi4) h_{a b} h^{c d} + \nabla_{c}(G4X \nabla_{d}(\nabla_{a}(p)) \nabla_{b}(p)) h^{c d} + \nabla_{c}(G4X \nabla_{a}(\nabla_{d}(p)) \nabla_{b}(p)) h^{c d}-\nabla_{c}(G4X \nabla_{a}(\nabla_{b}(p)) \nabla_{d}(p)) h^{c d} + G4X ( -  1/2 (boxpi4)**2 h_{a b} +  1/2 h_{a b} pi24-2\nabla_{a}(\nabla_{c}(p)) \nabla_{b}(\nabla_{d}(p)) h^{c d} -  1/2 F_{a c} F_{b d} \nabla_{e}(p) \nabla_{f}(p) (\phi)**2 h^{c e} h^{d f}-2\nabla_{a}(\phi) \nabla_{c}(\phi) \nabla_{b}(p) \nabla_{d}(p) (\phi)**(-2) h^{c d} + F_{a c} F_{d e} \nabla_{b}(p) \nabla_{f}(p) (\phi)**2 h^{c d} h^{e f}) + G4XX ( -  1/2 \nabla_{a}(p) \nabla_{b}(p) (boxpi4)**2 +  1/2 \nabla_{a}(p) \nabla_{b}(p) pi24) + G4X boxpi4 (2\nabla_{a}(\nabla_{b}(p)) + 2\nabla_{a}(\phi) \nabla_{b}(p) (\phi)**(-1)) + R ( -  1/2 G4 h_{a b} -  1/2 G4X \nabla_{a}(p) \nabla_{b}(p));
mathcalG2 := G4 R_{a b}-2G4 \nabla_{a}(\phi) \nabla_{b}(\phi) (\phi)**(-1)-\nabla_{a}(\nabla_{b}(G4)) -  1/2 F_{a c} F_{b d} G4 (\phi)**2 h^{c d}-2\nabla_{a}(G4X \nabla_{b}(p) boxpi4) + \nabla_{c}(G4X \nabla_{d}(\nabla_{a}(p)) \nabla_{b}(p)) h^{c d} + G4X (-2\nabla_{a}(\nabla_{c}(p)) \nabla_{b}(\nabla_{d}(p)) h^{c d} -  1/2 F_{a c} F_{b d} \nabla_{e}(p) \nabla_{f}(p) (\phi)**2 h^{c e} h^{d f}-2\nabla_{a}(\phi) \nabla_{c}(\phi) \nabla_{b}(p) \nabla_{d}(p) (\phi)**(-2) h^{c d} + F_{a c} F_{d e} \nabla_{b}(p) \nabla_{f}(p) (\phi)**2 h^{c d} h^{e f} + ( -  1/2 (boxpi4)**2 +  1/2 pi24) h_{a b}) + G4XX ( -  1/2 (boxpi4)**2 +  1/2 pi24) \nabla_{a}(p) \nabla_{b}(p) + G4X boxpi4 (2\nabla_{a}(\nabla_{b}(p)) + 2\nabla_{a}(\phi) \nabla_{b}(p) (\phi)**(-1)) + R ( -  1/2 G4 h_{a b} -  1/2 G4X \nabla_{a}(p) \nabla_{b}(p)) + 2\nabla_{c}(\nabla_{d}(G4)) h^{c d} h_{a b};
test := @[mathcalG] - @[mathcalG2];
distribute(test);
canonicalise(test);
rename_dummies(test);
sort_product(test);


Can you reduce this to a minimal example please (e.g. 2 terms which get mangled by meld), with code which contains the full logic, not copy-pasted expressions?