**Next message:**Xing: "B1 and B11 do not reduce"**Previous message:**Vladyslav Shtabovenko: "Re: A BUG in The Calc Function"**In reply to:**Vladyslav Shtabovenko: "Re: A BUG in The Calc Function"**Messages sorted by:**[ date ] [ thread ] [ subject ] [ author ]**Mail actions:**[ respond to this message ] [ mail a new topic ]

The fix is now in the repository.

Essentially one can now supply Assumptions as an option to Calc

or PowerSimplify which will be then internally passed to PowerExpand

inside PowerSimplify.

Please check the Options section in

https://reference.wolfram.com/language/ref/PowerExpand.html#

on using Assumptions with PowerExpand.

The default value in FeynCalc is "True", which means that PowerExpand

will not make any possibly wrong expansions.

Therefore,

Calc[Sqrt[x - 1],Assumptions->{x>1}]

returns the correct result. Please note that here the assumptions must

be supplied this way, as PowerExpand doesn't use $Assumptions, e.g.

$Assumptions = {x < 0};

PowerExpand[Sqrt[x^2]]

still returns x, contrary to

PowerExpand[Sqrt[x^2], Assumptions -> x < 0]

that returns -x. This is standard Mathematica behavior.

Furthermore, I've also added an option to disable PowerExpand

altogether, via

Calc[Sqrt[x - 1], PowerExpand->False]

Cheers,

Vladyslav

Am 16.09.2015 um 00:44 schrieb Vladyslav Shtabovenko:

*> Dear all,
*

*>
*

*> sorry for the late reply, at the moment I'm a bit busy finishing one
*

*> important calculation.
*

*>
*

*> As Rolf wrote, Calc uses PowerSimplify which uses PowerExpand. The
*

*> latter can either assume that everything is real (default behaviour) or
*

*> use general expansion formulas if the arguments might be complex (which
*

*> we have now). Unfortunately, in this case PowerExpand doesn't take
*

*> $Assumptions into account.
*

*>
*

*> I think that the simplest solution would be to make Calc and
*

*> PowerSimplify accept the Assumptions option which will be then passed to
*

*> PowerExpand. Then it will be up to the user to specify the assumptions.
*

*>
*

*> As a workaround for now,
*

*>
*

*> Sqrt[x - 1] // Calc // Simplify
*

*>
*

*> returns the correct result, as Simplify always honors $Assumptions.
*

*>
*

*> I'll fix this soon.
*

*>
*

*> Cheers,
*

*> Vladyslav
*

*>
*

*>
*

*>
*

*> Am 14.09.2015 um 10:58 schrieb Rolf Mertig:
*

*>> This is due to me. Sorry.
*

*>>
*

*>> Somehwere internally PowerSimplify is used which assumes all variables are real. Maybe this assumption is not correct in general, of course. I mentioned this to Vladyslav and he will look into how to fix this. Sorry, but I have no time right now.
*

*>>
*

*>
*

**Next message:**Xing: "B1 and B11 do not reduce"**Previous message:**Vladyslav Shtabovenko: "Re: A BUG in The Calc Function"**In reply to:**Vladyslav Shtabovenko: "Re: A BUG in The Calc Function"**Messages sorted by:**[ date ] [ thread ] [ subject ] [ author ]**Mail actions:**[ respond to this message ] [ mail a new topic ]

*
This archive was generated by hypermail 2b29
: 03/25/17-12:40:12 AM Z CET
*