Adding zero to an expression and avoiding simplification
Hi, I have an expression of the form
pol_y = chi_yyyy*Ey*Ey*Ey + (chi_yyxx + chi_yxyx + chi_yxxy)*Ey*Ex*Ex - (chi_yyxx + chi_yxyx + chi_yxxy)*Ey*Ex*Ex + (chi_yyxx + chi_yxyx + chi_yxxy)*Ey*Ex*Ex
Now the last two terms add 0 to the expression. The goal is to substitute complicated expressions for Ey, Ex (complex quantities) and compare the results of two different reformulations (with and without the 0 terms). So for my work, I need the last two terms to be there but sagemath is simplifying this expression automatically. How do I avoid this?
But after a substitution those two terms are always going to add to zero, right?
Yes as they should. But when expressions are of the form Ex=12(E−xe(ikx)+E+xe(−ikx))e(iωt)+12(¯E+xe(ikx)+¯E−xe(−ikx))e(−iωt) and Ey=12(E−ye(ikx)+E+ye(−ikx))e(iωt)+12(¯E+ye(ikx)+¯E−ye(−ikx))e(−iωt). This can yield to two different expressions for pol_y that might seem different at first but are equivalent.