Consider some symbols piplus, piminus, eta. Let us assume that they appear as conjugated, e.g., Conjugate[piplus]. Could you please tell me whether it is possible to define a rule which would automatically replace Conjugate[piplus] with piminus, and Conjugate[piminus] with piplus, and Conjugate[eta] with eta?

Say, I may use

rule := {Conjugate[piplus] :> piminus, Conjugate[piminus] -> piplus}
Conjugate[piplus] + Conjugate[piminus] /. Evaluate[rule]

But I do not want to always add /. Evaluate[rule] in the given notebook.

  • 2
    $\begingroup$ Use multiple TagSetDelayed definitions, such as: piminus /: Conjugate[piminus] := piplus $\endgroup$
    – MarcoB
    Jul 27, 2023 at 13:11

1 Answer 1


Apply the rules once and globally using multiple TagSetDelayed definitions:

piminus /: Conjugate[piminus] := piplus
piplus /: Conjugate[piplus] := piminus
eta /: Conjugate[eta] := eta

Conjugate[piplus] + 2 Conjugate[piminus] + Conjugate[eta]

(* Out: eta + piminus + 2 piplus *)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.