**Next message:**Kasi Jaswin.: "How to have a specific spin in the amplitude."**Previous message:**Sun Qingfeng: "Re: A BUG in The Calc Function"**In reply to:**Sun Qingfeng: "Re: A BUG in The Calc Function"**Next in thread:**Sun Qingfeng: "Re: A BUG in The Calc Function"**Messages sorted by:**[ date ] [ thread ] [ subject ] [ author ]**Mail actions:**[ respond to this message ] [ mail a new topic ]

Hi,

thanks for reporting this issue.

The problem comes from PowerExpand that is used in FeynCalc's

PowerSimplify. When PowerExpand is used without any options, the

expansion of the square root is not always correct.

http://reference.wolfram.com/language/ref/PowerExpand.html

The correct and universal result can be obtained by adding the option

Assumptions->True. The bug is now fixed in the development version

<https://github.com/FeynCalc/feyncalc/commit/acfbf5ab3dfd251b182b700a9ae32aff6ba3dee4>

$Assumptions = {test > 1};

tmp = Sqrt[test - 1];

Calc[tmp (Pair[LorentzIndex[\[Beta]], LorentzIndex[\[Beta]1]]) (Pair[

LorentzIndex[\[Beta]], LorentzIndex[\[Beta]1]])]//Simplify

returns

4*Sqrt[-1 + test]

Apart from that, in many cases the Calc function is not the optimal way

to simplify an expression, since it tries to do a lot of things that

might not be needed at all. For example, for your expression, Contract

alone is sufficient:

Contract[tmp (Pair[LorentzIndex[\[Beta]], LorentzIndex[\[Beta]1]])

(Pair[LorentzIndex[\[Beta]], LorentzIndex[\[Beta]1]])]

P.S. Note that if you want to simplify expressions that contain a square

root of a negative real number, you have to be very careful with

Mathematica. For example,

Sqrt[-a] // PowerExpand[#, Assumptions -> True] & //

Simplify[#, Assumptions -> {a > 0}] &

returns I Sqrt[A], i.e. Mathematica assumes that Sqrt[-a] is

Sqrt[-a+ i eps]. If however, you actually meant it to be Sqrt[-a- i

eps], the result will be wrong. For this reason it is useful to add

a small imaginary part, to prevent Mathematica from making too many

assumptions. With

Sqrt[-a + I eta] //

Limit[#, eta -> 0, Direction -> -1, Assumptions -> {a > 0}] &

Sqrt[-a - I eta] //

Limit[#, eta -> 0, Direction -> -1, Assumptions -> {a > 0}] &

one can get the correct results for approaching the branch cut from

above or from below.

Cheers,

Vladyslav

On 09/12/14 11:21, Sun Qingfeng wrote:

*> I meant A BUG in The "Calc" Function, why the word in "" can not be shown....
*

*>
*

**Next message:**Kasi Jaswin.: "How to have a specific spin in the amplitude."**Previous message:**Sun Qingfeng: "Re: A BUG in The Calc Function"**In reply to:**Sun Qingfeng: "Re: A BUG in The Calc Function"**Next in thread:**Sun Qingfeng: "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/01/17-06:40:02 PM Z CET
*