Is there any way to import the parameters automatically from a file which contains a lot of points in the parameter space

Asked by Da Liu

Hi,

   Recently I want to use a lot of points in the parameter space, then it is not feasible to modify the parameter one by one by hand.

So is there any systematical and automatical way to import the parameter values to the parameter.card?

Thank you very much.

Best wishes,

Da Liu

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

The question:

Do you want to edit a card (press enter to bypass editing)?
  1 / param : param_card.dat
  2 / run : run_card.dat
 you can also
   - enter the path to a valid card or banner.
   - use the 'set' command to modify a parameter directly.
     The set option works only for param_card and run_card.
     Type 'help set' for more information on this command.
 [0, done, 1, param, 2, run, enter path][60s to answer]

allow to enter the path to valid parameter file Like those generated by a spectrum generator.

If this is not what you want,
you can use the "set"
(you can type "help set" to see various example of syntax.)

If you want to script those set command, please read the associate FAQ

Cheers,

Olivier

Revision history for this message
Da Liu (liuda) said :
#2

Hi Olivier,

  Thank you very much. Actually, I have a mathematical function (written in mathematica )which can numerically calculate all the values of the physical parameters in terms of given Lagrangian parameters. The problem is how to use this numerical physical values calculated by mathematica to generate the parameter.card automatically and don't need to set the value one by one by hand? That is once I give the values of Lagrangian parameters and I will automatically get the parameter.card that MadGraph5 can use directly. In there any code which can do this job?

Thanks a lot.

Best wishes,

Da Liu

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

Hi Da Liu,

The best is probably that you edit your mathematica cod such that he writes directly a valid param_card.dat.
Another solution exists if those parameter have the same name of those of the model then the "set" options
might be easier since the command
set PARAMNAME VALUE
works (if PARAMNAME is a valid parameter of the UFO model obviously)

> In there any code which can do this job?

Without knowing what you are doing exactly (which framework,…) this is really hard to help you.
If you use a mathematical framework develop by some physicist they might have done things like that already.
And you can contact them. Sorry but I can't help you more than that.

Cheers,

Olivier

On Jan 20, 2014, at 10:51 PM, Da Liu <email address hidden> wrote:

> Question #242489 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/madgraph5/+question/242489
>
> Status: Answered => Open
>
> Da Liu is still having a problem:
> Hi Olivier,
>
> Thank you very much. Actually, I have a mathematical function (written
> in mathematica )which can numerically calculate all the values of the
> physical parameters in terms of given Lagrangian parameters. The problem
> is how to use this numerical physical values calculated by mathematica
> to generate the parameter.card automatically and don't need to set the
> value one by one by hand? That is once I give the values of Lagrangian
> parameters and I will automatically get the parameter.card that
> MadGraph5 can use directly. In there any code which can do this job?
>
> Thanks a lot.
>
> Best wishes,
>
> Da Liu
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Da Liu (liuda) said :
#4

Thanks Olivier Mattelaer, that solved my question.

Revision history for this message
Da Liu (liuda) said :
#5

Hi Olivier Mattelaer,

Sorry for bothering you again, but the real problem for me is to try to read the parameter values from a .dat file which contain many benchmark points in the multi-parameter space and then set the values for the correspond parameters in the UFO model. I try to write a shell script to read it, but it seems that ./bin/mg5 test.sh don't have the awk command:

awk -F " " '{ a= $1 }' coupling.dat
set mrho a

Is there any way for the Madgraph5 to read parameter values from .dat file?

Or Is there any easy way to do many benchmark points for MadGraph5 instead of using set one by one?

Thank you very much.

Best wishes,

Da Liu

Revision history for this message
Best Olivier Mattelaer (olivier-mattelaer) said :
#6

Hi Da Liu,

If you have a file with the following format:

1.000
2.000
3.000

which all correspond to the value that you want for mrho (in a sequence way).
Then this is trivial to rewrite this into
launch
  set mrho 1.000
launch
  set mrho 2.000
launch
  set mrho 3.000

the following python script is doing that:
text = ''
for line in open('couplings.dat')
    text +='launch \n set mrho %s' % line
open('mg5_cmd','w').write(text)

and then you can do:
./bin/mg5 mg5_cmd
to do your scan on this parameter.

Cheers,

Olivier

On Jan 23, 2014, at 1:01 AM, Da Liu <email address hidden> wrote:

> Question #242489 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/madgraph5/+question/242489
>
> Status: Solved => Open
>
> Da Liu is still having a problem:
> Hi Olivier Mattelaer,
>
> Sorry for bothering you again, but the real problem for me is to try to
> read the parameter values from a .dat file which contain many benchmark
> points in the multi-parameter space and then set the values for the
> correspond parameters in the UFO model. I try to write a shell script to
> read it, but it seems that ./bin/mg5 test.sh don't have the awk command:
>
> awk -F " " '{ a= $1 }' coupling.dat
> set mrho a
>
> Is there any way for the Madgraph5 to read parameter values from .dat
> file?
>
> Or Is there any easy way to do many benchmark points for MadGraph5
> instead of using set one by one?
>
> Thank you very much.
>
> Best wishes,
>
> Da Liu
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Da Liu (liuda) said :
#7

Hi Olivier Mattelaer,

Thank you very much, it works.

Cheers,
Da Liu

Revision history for this message
Da Liu (liuda) said :
#8

Thanks Olivier Mattelaer, that solved my question.