| 84 | proc_id = -1 # if you use the syntax "@X" (with X>0), you can set proc_id to that value (this allows to distinguish process with identical initial/final state.) |
| 85 | nhel = -1 # means sum over all helicity |
| 86 | pdgs = [21,21,6,-6] #which pdg is requested |
| 87 | scale2 = 0. #only used for loop matrix element. should be set to 0 for tree-level |
| 88 | alphas=0.13 |
| 89 | |
| 90 | ans = allmatrix2py.smatrixhel(pdgs,p,alphas,scale2,nhel) |
| 91 | print ans |
| 92 | }}} |
| 93 | |
| 94 | |
| 95 | === Full library of process in python for version 2.6.0 and 2.7.0 |
| 96 | |
| 97 | If you are interested to have a single python library for a set of matrix-element. |
| 98 | This is also possible in fortran/python. |
| 99 | This is possible both for loop output ([sqr=virt]) and for tree level. |
| 100 | {{{ |
| 101 | generate p p > t t~ |
| 102 | output standalone PATH --prefix=int |
| 103 | }}} |
| 104 | |
| 105 | then you can compile the library by going to the SubProcesses directory and |
| 106 | {{{ |
| 107 | make allmatrix2py.so |
| 108 | }}} |
| 109 | |
| 110 | Here is one example in that case |
| 111 | {{{ |
| 112 | import allmatrix2py |
| 113 | allmatrix2py.initialise('../Cards/param_card.dat') |
| 114 | |
| 115 | def invert_momenta(p): |
| 116 | """ fortran/C-python do not order table in the same order""" |
| 117 | new_p = [] |
| 118 | for i in range(len(p[0])): new_p.append([0]*len(p)) |
| 119 | for i, onep in enumerate(p): |
| 120 | for j, x in enumerate(onep): |
| 121 | new_p[j][i] = x |
| 122 | return new_p |
| 123 | p =[[ 0.5000000E+03, 0.0000000E+00, 0.0000000E+00, 0.5000000E+03], |
| 124 | [0.5000000E+03, 0.0000000E+00, 0.0000000E+00, -0.5000000E+03], |
| 125 | [ 0.5000000E+03, 0.1040730E+03, 0.4173556E+03, -0.1872274E+03], |
| 126 | [ 0.5000000E+03, -0.1040730E+03, -0.4173556E+03, 0.1872274E+03] |
| 127 | ] |
| 128 | |
| 129 | p =invert_momenta(p) |