0
$\begingroup$

Example program

According to this simple example program, the assumptions evaluated only with the Simplify[] function call. However, I wouldn't like to use Simplify[] because it can be very slow with longer expressions.

I would like the Conjugate[c10] function call to give me the c10 output after the assumption is defined. Is there a way to do this?

ClearAll["Global`*"]

$Assumptions := True
Conjugate[c10]
Refine[Conjugate[c10]]
Simplify[Conjugate[c10]]
$Assumptions

$Assumptions := c10 \[Element] Reals
Conjugate[c10]
Refine[Conjugate[c10]]
Simplify[Conjugate[c10]]
$Assumptions

ClearAll["Global`*"]
$Assumptions
$\endgroup$
1
$\begingroup$

You could Unprotect Conjugate to get the behavior you want, although it will undoubtedly slow down computations involving Conjugate:

SetConjugateSimplification[bool_] := (
    Unprotect[Conjugate];
    If[TrueQ @ bool,
        Conjugate[e_] /; !TrueQ@$Flag := Block[{$Flag=True}, Simplify @ Conjugate[e]],

        DownValues[Conjugate] = {}
    ];
    Protect[Conjugate];
)

Then, turn on conjugate simplification:

SetConjugateSimplification[True]

Now, Conjugate will use assumptions specified with $Assumptions or Assuming:

$Assumptions = c10 ∈ Reals;
Conjugate[c10]

c10

Restore the usual Conjugate behavior:

SetConjugateSimplification[False]

Another possibility is to use UpValues:

c10 /: Conjugate[c10]:= c10

Then:

Conjugate[c10]
Conjugate[c10+x]
Conjugate[Exp[c10 x]]

c10

c10 + Conjugate[x]

E^(c10 Conjugate[x])

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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