Giter Site home page Giter Site logo

python-form's Introduction

python-form

PyPI version Python versions Build Status Coverage Documentation Status DOI

This package provides a mechanism to embed FORM [1] [2] [3] programs in Python code. The basic idea of the implementation is the same as FormLink [4]: it utilizes unnamed pipes between FORM and an external program [5], Python in this case. It is expected to work on Unix-like systems.

Installation

$ pip install python-form

or directly from GitHub for the latest development version:

$ pip install git+https://github.com/tueda/python-form.git

See also the documentation for pip install.

Example

import form

with form.open() as f:
    f.write('''
        AutoDeclare Vector p;
        Local F = g_(0,p1,...,p6);
        trace4,0;
        .sort
    ''')
    print(f.read('F'))

Documentation

Licence

python-form is distributed under the MIT licence. See the LICENCE file.

Note that FORM itself adopts the GPL version 3. A program/package using FORM via python-form could be considered as an aggregate (at your own risk) or a combined work affected by the GPL.

References

[1]J.A.M. Vermaseren, New features of FORM, arXiv:math-ph/0010025.
[2]J. Kuipers, T. Ueda, J.A.M. Vermaseren and J. Vollinga, FORM version 4.0, Comput.Phys.Commun. 184 (2013) 1453-1467, arXiv:1203.6543 [cs.SC].
[3]https://github.com/vermaseren/form
[4]Feng Feng and Rolf Mertig, FormLink/FeynCalcFormLink : Embedding FORM in Mathematica and FeynCalc, arXiv:1212.3522 [hep-ph].
[5]M. Tentyukov and J.A.M. Vermaseren, Extension of the functionality of the symbolic program FORM by external software, Comput.Phys.Commun. 176 (2007) 385-405, arXiv:cs/0604052.

python-form's People

Contributors

tueda avatar

Stargazers

Alexander Puck Neuwirth avatar Valentin avatar Sudeepan Datta avatar Indiscipline avatar Feel avatar Vladyslav Shtabovenko avatar Ben Ruijl avatar

Watchers

Ben Ruijl avatar James Cloos avatar  avatar Vladyslav Shtabovenko avatar  avatar paper2code - bot avatar

python-form's Issues

Difficult to specify environment variables for a python-form session.

When running a FORM code with python-form that has such a pragma e.g.:

#: MaxTermsize 1M

Then it is not interpreted correctly, in the sense that it is not updating that environment value for FORM when executing the code.
This is likely because a FORM session/kernel has already been started by then and it cannot update this option afterwards.
But then, what would be nice is to be able to update these FORM environment variables as options to the open(...) function.

For now I can make sure to specify the path of my FORM interpreter to one where I have an appropriate form.set file, but it'd be more convenient to be able to supply this with python options as I suggested.

where form saves log?

I start form with f = form.open(keep_log=True), in text of program I write on statistics;, and then I found file xform01427.str near .ipynb file I run, but that file is void.
Where form saves log?

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.