Skip to content

Recursion error when using a replacement rule with TARCER TJI functions #366

Open

Description

@MJKirk

It seems impossible to write a replacement rule involving the TARCER TJI functions, as first you get a recursion error and then even non-pattern TJIs raise the same error.
Minimal example is (screen shot below):

$LoadAddOns={"TARCER"};
<<FeynCalc`

TJI[D,SPD[p,p],{{1,mc},{1,0},{1,0}}]

TJI[d_,s_,{{1,sqrtx_},{1,sqrty_},{1,sqrtz_}}]

TJI[D,SPD[p,p],{{1,mc},{1,0},{1,0}}]
Image

I assume there is some automatic simplification of TJI's that doesn't work when it is a pattern, but not sure why this then breaks everything else.

Activity

  1. vsht commented on Jul 29, 2026

    @vsht
    Member

    Can you use HoldPattern in your rule instead? This seems to work

    TJI[D, SPD[p, p], {{1, mc}, {1, 0}, {1, 0}}] /.  HoldPattern[TJI][d_, s_, {{1, sqrtx_}, {1, sqrty_}, {1, sqrtz_}}] -> 
     xyz
    

    I assume there is some automatic simplification of TJI's that doesn't work when it is a pattern, but not sure why this then breaks everything else.

    I'm not really familiar with the TARCER code since it's essentially something @rolfmertig and R. Scharf created in the first place. What is worse, I'm not using it at all and I don't have enough unit tests, which is why I prefer not to modify the source unless absolutely necessary. If something breaks down, I'm definitely not going to notice it, but it will mess up the workflow for those who employ TARCER regularly. The fact that the code creates a binary that is later loaded in the Mathematica session makes debugging really tricky.

    There are indeed people who use it more actively like @apik and even have some private improvements for particular reduction cases, but those things never made their way to the repo.

    Having said that, if you want to make a pull request addressing this issue, I'd be open for it.

  2. MJKirk commented on Jul 29, 2026

    @MJKirk
    Author

    Yes, HoldPattern works here, so it's not the end of the world.

    I'm not really familiar with the TARCER code since it's essentially something @rolfmertig and R. Scharf created in the first place.
    ...
    Having said that, if you want to make a pull request addressing this issue, I'd be open for it.

    I had a quick look at the TARCER code before opening the issue, and I didn't really understand it, so I can't offer a fix myself. I wondered if perhaps you were more familiar but I see not!
    Happy for you to close as WONTFIX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions