hosted by CEDAR HepForge

LHAPDF the Les Houches Accord PDF Interface


LHAPDF Python wrapper library

As of version 5.4, LHAPDF provides a Python wrapper package, based around the C++ interface.

To use the Python wrapper, first make sure that LHAPDF is installed properly and was built with Python support (this is the case by default).

Then make sure that the installed _lhapdf.so and lhapdf.py files are in a directory listed in your PYTHONPATH shell variable. This installation directory should be $prefix/lib/python$PYTHONVERSION/site-packages, so if LHAPDF was configured with a --prefix=/foo flag, then your PYTHONPATH should contain /foo/lib/python2.5/site-packages. We recommend that you install packages to one standard location, so that your PYTHONPATH can be set to one value in your shell setup scripts and not need to be changed.

Now run Python and import the module: $ python >>> import lhapdf >>> lhapdf.initPDFSetByName("MRST2004nlo.LHgrid") >>> lhapdf.initPDF(0) >>> print "alpha_s(Mz) = ", lhapdf.alphasPDF(91.2)


LHAPDF is maintained by Mike Whalley and Andy Buckley at Durham University (UK)
email: lhapdf@projects.hepforge.org phone: +44-191-334-3807 fax:+44-191-334-3658
Last updated: Thu May 22 16:15:56 2008