BubbleProfiler  0.3.0
by Peter Athron, Csaba Balazs, Michael Bardsley, Andrew Fowlie, Dylan Harries & Graham White
sm_plus_singlet_tn_plot.py
Go to the documentation of this file.
1 from __future__ import print_function
2 
3 import sys
4 import argparse
5 import numpy as np
6 import sm_plus_singlet
7 
8 def get_plot_data(min_temp, max_temp, num_points, Tc, lambda_m, lambda_s, retry):
9  # List of tuples (T, action)
10  data = []
11 
12  for T in np.linspace(min_temp, max_temp, num_points):
13  tries = 0
14 
15  #HORRID HACK
16  epsilon = 0.001
17  Trun = T
18 
19  while tries < retry:
20  try:
21  potential_data = sm_plus_singlet.generate_potential(Trun, Tc, lambda_m, lambda_s)
22  profiler_output = sm_plus_singlet.run_profiler(potential_data)
23  break
24  except:
25  Trun = Trun + epsilon
26  print("retrying at T=" + str(Trun))
27  tries += 1
28 
29  if tries == retry:
30  print("Error: profiler failed to converge for T = " + str(T) +
31  " after " + str(retry) + " attempts")
32  sys.exit(1)
33 
34  data.append((Trun, profiler_output["action"]))
35 
36  #TEMP
37  print(Trun, profiler_output["action"],
38  "S_E/T=", str(profiler_output["action"] / Trun))
39 
40 
41 if __name__ == "__main__":
42  parser = argparse.ArgumentParser(description='Generate a plot of S_E/T for an instance of the SM+Singlet model')
43 
44  parser.add_argument("--min-temp", type=float, default=0.0,
45  help="lower bound on temp for plot")
46  parser.add_argument("--max-temp", type=float, required=True,
47  help="upper bound on temp for plot")
48  parser.add_argument("--num-points", type=int, required=True,
49  help="number of points on plot")
50  parser.add_argument('-Tc', '--crit-temp', type=float, required=True,
51  help='critical temperature for this potential')
52  parser.add_argument('--lambda-m', type=float, required=True,
53  help='mixed quartic coupling parameter')
54  parser.add_argument('--lambda-s', type=float, required=True,
55  help='singlet quartic coupling parameter')
56  parser.add_argument("--retry", type=int, default=3,
57  help="retry a given point this many times before failing")
58 
59  args = parser.parse_args()
60 
61  plot_data = get_plot_data(
62  args.min_temp, args.max_temp, args.num_points, args.crit_temp,
63  args.lambda_m, args.lambda_s, args.retry
64  )
def get_plot_data(min_temp, max_temp, num_points, Tc, lambda_m, lambda_s, retry)
def generate_potential(T, Tc, lambda_m, lambda_s)
def run_profiler(data)