# "Literal replace" in SymPy

Is there a way to perform a "literal replacing" in SymPy, which matches exactly the pattern? For example, for the expression exp(I*theta)+exp(-I*theta), I would like to replace only exp(It) to zero without replacing exp(-It) A minimal example would be from sympy import * f=exp(I*t)+exp(-I*t) Clearly, subs will not work f.subs((exp(I*t),0)) because it also replaces exp(-I*t)… Read More "Literal replace" in SymPy