Code Monkey home page Code Monkey logo

Comments (2)

JP-Ellis avatar JP-Ellis commented on September 18, 2024

Thanks for the feedback, I'm glad you have found this package useful :)

Firstly, the graph can be flipped around by using horizontal'=v1 to v2 instead of horizontal=v1 to v2. The extra ' tells the graphing algorithm to flip the graph around that line, so this should fix your fermion line to be going up.

As for the momentum labels, there is the key momentum/label distance which can move the momentum label further away; however, due to the way Ti_k_Z draws the graph, it doesn't work on a per-arrow basis when used inside a graph and has to be set globally. When I get around to it, I want to fix this and implement a similar syntax to the way labels are created (something like momentum={[label sep=0.5cm] \(k\)}). Your code also illustrates another bug: the momentum arrows override the way the line is draw and remove the effect of bend left unfortunately (something else I have to fix).

Finally, regarding the fermion lines not being bent by the scalar: unfortunately this can't be achieved with the algorithm as it is (at least, to my knowledge). Ti_k_Z-Feynman builds on the existing graphing algorithms from Ti_k_Z and for me to support this, I would need to rework the underlying algorithms to work more intimately with Ti_k_Z-Feynman (which I may do at some point in the future, but it's definitely not a priority). A workaround is to not draw the scalar edge in the graph itself, but draw it afterwards (though I find the

Here is a minimal working example to illustrate the fixes:

\documentclass[tikz]{standalone}
\usepackage{tikz-feynman}

\begin{document}
\begin{tikzpicture}[momentum/label distance=0.5cm]
    \graph[feynman, horizontal'=v1 to v2]{
        a
        -- [fermion, momentum'=\(p\)] h1
        -- [fermion, momentum=\(k\)] v1
        -- [fermion, momentum={\(k' = k + q\)}] h2
        -- [fermion, momentum'=\(p'\)] b
        ;

        h1 -- [scalar, momentum'=\(p - k\)] h2;

        v2 -- [photon, momentum=\(q\)] v1;
    };
\end{tikzpicture}
\begin{tikzpicture}[momentum/label distance=0.5cm]
    \graph[feynman, horizontal'=v1 to v2]{
        a
        -- [fermion, momentum'=\(p\)] h1
        -- [fermion, momentum=\(k\)] v1
        -- [fermion, momentum=\(k + q\)] h2
        -- [fermion, momentum'=\(p'\)] b
        ;

        v2 -- [photon, momentum=\(q\)] v1;
    };
    \draw[scalar, momentum'=\(p - k\)] (h1) to (h2);
\end{tikzpicture}
\end{document}

I have exams finishing on the 9th of November, so I won't be able to fix these bugs until then; however, I certainly intend to get version 1 of Ti_k_Z-Feynman complete soon afterwards :)

from tikz-feynman.

martin-ueding avatar martin-ueding commented on September 18, 2024

Thanks for the suggestions! Those helped me enough to get a nice looking graph. Good luck with your exams!

from tikz-feynman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.