transitionFinder.py

The transitionFinder module is used to calculate finite temperature cosmological phase transitions: it contains functions to find the phase structure as a function of temperature, and functions to find the transition (bubble nucleation) temperature for each phase. In contrast, pathDefomration is useful for finding the tunneling solution for a fixed potential or a potential at a fixed temperature.

The most directly used functions in this module will likely be traceMultiMin() for finding the phase structure, and findAllTransitions() and findCriticalTemperatures() for calculating properties of the phase transitions.

Finding the phase structure

traceMinimum(f, d2f_dxdt, d2f_dx2, x0, t0, tstop, dtstart, deltaX_target, dtabsMax=20.0, dtfracMax=0.25, dtmin=0.001, deltaX_tol=1.2, minratio=0.01)[source]

Trace the minimum xmin(t) of the function f(x,t), starting at x0, t0.

Parameters:
  • f (callable) – The scalar function f(x,t) which needs to be minimized. The input will be of the same type as (x0,t0).
  • d2f_dx2 (d2f_dxdt,) – Functions which return returns derivatives of f(x). d2f_dxdt should return the derivative of the gradient of f(x) with respect to t, and d2f_dx2 should return the Hessian matrix of f(x) evaluated at t. Both should take as inputs (x,t).
  • x0 (array_like) – The initial starting point. Must be an array even if the potential is one-dimensional (in which case the array should have length 1).
  • t0 (float) – The initial starting parameter t.
  • tstop (float) – Stop the trace when t reaches tstop.
  • dtstart (float) – Initial stepsize.
  • deltaX_target (float) – The target error in x at each step. Determines the stepsize in t by extrapolation from last error.
  • dtabsMax (float, optional) –
  • dtfracMax (float, optional) – The largest stepsize in t will be the LARGEST of abs(dtstart)*dtabsMax and t*dtfracMax.
  • dtmin (float, optional) – The smallest stepsize we’ll allow before assuming the transition ends, relative to dtstart
  • deltaX_tol (float, optional) – deltaX_tol*deltaX_target gives the maximum error in x before we want to shrink the stepsize and recalculate the minimum.
  • minratio (float, optional) – The smallest ratio between smallest and largest eigenvalues in the Hessian matrix before treating the smallest eigenvalue as zero (and thus signaling a saddle point and the end of the minimum).
Returns:

  • X, T, dXdT (array_like) – Arrays of the minimum at different values of t, and its derivative with respect to t.
  • overX (array_like) – The point beyond which the phase seems to disappear.
  • overT (float) – The t-value beyond which the phase seems to disappear.

Notes

In prior versions, d2f_dx2 was optional and called d2f, while d2f_dxdt was calculated from an optional parameter df using finite differences. If Neither of these were supplied, they would be calculated directly from f(x,t) using finite differences. This lead to a messier calling signature, since additional parameters were needed to find the finite differences. By instead requiring that the derivatives be supplied, the task of creating the derivative functions can be delegated to more general purpose routines (see e.g. helper_functions.gradientFunction and helper_functions.hessianFunction).

Also new in this version, dtmin and dtabsMax are now relative to dtstart. The idea here is that there should be some required parameter that sets the scale, and then optional parameters can set the tolerances relative to this scale. deltaX_target is now not optional for the same reasoning.

class Phase(key, X, T, dXdT)[source]

Describes a temperature-dependent minimum, plus second-order transitions to and from that minimum.

Variables:
  • key (hashable) – A unique identifier for the phase (usually an int).
  • T, dXdT (X,) – The minima and its derivative at different temperatures.
  • tck (tuple) – Spline knots and coefficients, used in interpolate.splev.
  • low_trans (set) – Phases (identified by keys) which are joined by a second-order transition to this phase.
  • high_trans (set) – Phases (identified by keys) which are joined by a second-order transition to this phase.
valAt(T, deriv=0)[source]

Find the minimum at the value T using a spline.

Parameters:
  • T (float or array_like) –
  • deriv (int) – If deriv > 0, instead return the derivative of the minimum with respect to T. Can return up to the third derivative for cubic splines (when len(X) > 3) or first derivative for linear splines.
addLinkFrom(other_phase)[source]

Add a link from other_phase to this phase, checking to see if there is a second-order transition.

traceMultiMin(f, d2f_dxdt, d2f_dx2, points, tLow, tHigh, deltaX_target, dtstart=0.001, tjump=0.001, forbidCrit=None, single_trace_args={}, local_min_args={})[source]

Trace multiple minima xmin(t) of the function f(x,t).

This function will trace the minima starting from the initial (x,t) values given in points. When a phase disappears, the function will search for new nearby minima, and trace them as well. In this way, if each minimum corresponds to a different phase, this function can find the (possibly) complete phase structure of the potential.

Parameters:
  • f (callable) – The scalar function f(x,t) which needs to be minimized. The input will be of the same type as each entry in the points parameter.
  • d2f_dx2 (d2f_dxdt,) – Functions which return returns derivatives of f(x). d2f_dxdt should return the derivative of the gradient of f(x) with respect to t, and d2f_dx2 should return the Hessian matrix of f(x) evaluated at t. Both should take as inputs (x,t).
  • points (list) – A list of points [(x1,t1), (x2,t2),...] that we want to trace, where x1, x2, etc. are each a one-dimensional array.
  • tHigh (tLow,) – Lowest and highest temperatures between which to trace.
  • deltaX_target (float) – Passed to traceMinimum() and used to set the tolerance in minimization.
  • dtstart (float, optional) – The starting stepsize, relative to tHigh-tLow.
  • tjump (float, optional) – The jump in t from the end of one phase to the initial tracing point in another. If this is too large, intermediate phases may be skipped. Relative to tHigh-tLow.
  • forbidCrit (callable or None, optional) – A function that determines whether or not to forbid a phase with a given starting point. Should take a point x as input, and return True (if the phase should be discarded) or False (if the phase should be kept).
  • single_trace_args (dict, optional) – Arguments to pass to traceMinimum().
  • local_min_args (dict, optoinal) – Arguments to pass to findApproxLocalMinima().
Returns:

phases (dict) – A dictionary of Phase instances. The keys in the dictionary are integers corresponding to the order in which the phases were constructed.

findApproxLocalMin(f, x1, x2, args=(), n=100, edge=0.05)[source]

Find minima on a straight line between two points.

When jumping between phases, we want to make sure that we don’t jump over an intermediate phase. This function does a rough calculation to find any such intermediate phases.

Parameters:
  • f (callable) – The function f(x) to minimize.
  • x2 (x1,) – The points between which to find minima.
  • args (tuple, optional) – Extra arguments to pass to f.
  • n (int, optional) – Number of points to test for local minima.
  • edge (float, optional) – Don’t test for minima directly next to the input points. If edge==0, the minima potentially go all the way to input points. If edge==0.5, the range of tested minima shrinks to a single point at the center of the two points.
Returns:

list – A list of approximate minima, with each minimum having the same shape as x1 and x2.

removeRedundantPhases(f, phases, xeps=1e-05, diftol=0.01)[source]

Remove redundant phases from a dictionary output by traceMultiMin().

Although traceMultiMin() attempts to only trace each phase once, there are still instances where a single phase gets traced twice. If a phase is included twice, the routines for finding transition regions and tunneling get very confused. This attempts to avoid that problem.

Parameters:
  • f (callable) – The function f(x,t) which was passed to traceMultiMin().
  • phases (dict) – The output of traceMultiMin().
  • xeps (float, optional) – Error tolerance in minimization.
  • diftol (float, optional) – Maximum separation between two phases before they are considered to be coincident.
Returns:

None

Notes

If two phases are merged to get rid of redundancy, the resulting phase has a key that is a string combination of the two prior keys.

Todo

Make sure to test removeRedundantPhases().

Todo

Possibly add extra logic to account for phases which coinincide at one end but not the other.

Warning

This hasn’t been thoroughly tested yet.

getStartPhase(phases, V=None)[source]

Find the key for the high-T phase.

Parameters:
  • phases (dict) – Output from traceMultiMin().
  • V (callable) – The potential V(x,T). Only necessary if there are multiple phases with the same Tmax.

Calculating phase transitions

tunnelFromPhase(phases, start_phase, V, dV, Tmax, Ttol=0.001, maxiter=100, phitol=1e-08, overlapAngle=45.0, nuclCriterion=<function <lambda>>, verbose=True, fullTunneling_params={})[source]

Find the instanton and nucleation temeprature for tunneling from start_phase.

Parameters:
  • phases (dict) – Output from traceMultiMin().
  • start_phase (Phase object) – The metastable phase from which tunneling occurs.
  • dV (V,) – The potential V(x,T) and its gradient.
  • Tmax (float) – The highest temperature at which to try tunneling.
  • Ttol (float, optional) – Tolerance for finding the nucleation temperature.
  • maxiter (int, optional) – Maximum number of times to try tunneling.
  • phitol (float, optional) – Tolerance for finding the minima.
  • overlapAngle (float, optional) – If two phases are in the same direction, only try tunneling to the closer one. Set to zero to always try tunneling to all available phases.
  • nuclCriterion (callable) – Function of the action S and temperature T. Should return 0 for the correct nucleation rate, > 0 for a low rate and < 0 for a high rate. Defaults to S/T - 140.
  • verbose (bool) – If true, print a message before each attempted tunneling.
  • fullTunneling_params (dict) – Parameters to pass to pathDeformation.fullTunneling().
Returns:

dict or None – A description of the tunneling solution at the nucleation temperature, or None if there is no found solution. Has the following keys:

  • Tnuc : the nucleation temperature
  • low_vev, high_vev : vevs for the low-T phase (the phase that the instanton tunnels to) and high-T phase (the phase that the instanton tunnels from).
  • low_phase, high_phase : identifier keys for the low-T and high-T phases.
  • action : The Euclidean action of the instanton.
  • instanton : Output from pathDeformation.fullTunneling(), or None for a second-order transition.
  • trantype : 1 or 2 for first or second-order transitions.

secondOrderTrans(high_phase, low_phase, Tstr='Tnuc')[source]

Assemble a dictionary describing a second-order phase transition.

findAllTransitions(phases, V, dV, tunnelFromPhase_args={})[source]

Find the complete phase transition history for the potential V.

This functions uses tunnelFromPhase() to find the transition temperature and instanton for each phase, starting at the highest phase in the potential. Note that if there are multiple transitions that could occur at the same minimum (if, for example, there is a Z2 symmetry or a second-order transition breaks in multiple directions), only one of the transitions will be used.

Parameters:
  • phases (dict) – Output from traceMultiMin().
  • dV (V,) – The potential function and its gradient, each a function of field value (which should be an array, not a scalar) and a temperature.
  • tunnelFromPhase_args (dict) – Parameters to pass to tunnelFromPhase().
Returns:

list of transitions – Each item is a dictionary describing the transition (see tunnelFromPhase() for keys). The first transition is the one at the highest temperature.

findCriticalTemperatures(phases, V, start_high=False)[source]

Find all temperatures Tcrit such that there is degeneracy between any two phases.

Parameters:
  • phases (dict) – Output from traceMultiMin().
  • V (callable) – The potential function V(x,T), where x is the field value (which should be an array, not a scalar) and T is the temperature.
  • start_high (bool, optional) – If True, only include those transitions which could be reached starting from the high-T phase. NOT IMPLEMENTED YET.
Returns:

list of transitions – Transitions are sorted in decreasing temperature. Each transition is a dictionary with the following keys:

  • Tcrit : the critical temperature
  • low_vev, high_vev : vevs for the low-T phase (the phase that the model transitions to) and high-T phase (the phase that the model transitions from).
  • low_phase, high_phase : identifier keys for the low-T and high-T phases.
  • trantype : 1 or 2 for first or second-order transitions.

addCritTempsForFullTransitions(phases, crit_trans, full_trans)[source]

For each transition dictionary in full_trans, find the corresponding transition in crit_trans and add it to the dictionary for the key crit_trans, or add None if no corresponding transition is found.

Notes

The phases in the supercooled transitions might not be exactly the same as the phases in the critical temperature transitions. This would be the case, for example, if in full_trans the phase transitions go like 1 -> 2 -> 3, but in crit_trans they go like 1 -> (2 or 3).

Parameters:
  • phases (dict) –
  • crit_trans (list) –
  • full_trans (list) –