I know: I'm going to make a poor showing, but really I can't understand this:
a
is an expressione whose FullForm is
Power[Plus[Subscript[u,x],Times[Complex[0,-1],Subscript[u,y]],Times[Complex[0,1],Subscript[v,x]],Subscript[v,y]],2]
Why does the following code return True
, instead of the expected substitution ?
b = Replace[a, {Complex[a_, b_] -> a + H b}]
a == b
I have also tried
b = Replace[a, {Complex[a_, b_] -> a + H b},levSpec]
a == b
(even Infinity included) but without succeeding.
Thanks in advance !!
a
to look like after you've made the substitution? $\endgroup$ – Jason B. Feb 1 '16 at 13:27ReplaceAll[a, {Complex[0, 1] :> H, Complex[0, -1] :> -H}]
$\endgroup$ – egwene sedai Feb 1 '16 at 13:30b = Replace[a, Complex[a_, b_] :> a + H b ,Infinity]
$\endgroup$ – N.J.Evans Feb 1 '16 at 13:33tutorial/ApplyingTransformationRules
. $\endgroup$ – mitochondrial Feb 1 '16 at 14:54