<commit_before>"""Cosmological potentials for cosmomodels.py by <NAME>
    $Id: cmpotentials.py,v 1.2 2008/10/22 13:15:20 ith Exp $
    
    Provides functions which can be used with cosmomodels.py. 
    Default parameter values are included but can also be 
    specified as a dictionary."""
    
from __future__ import division
import numpy as N

def msqphisq(y, params=None):
    """Return (V, dV/dphi, d2V/dphi2) for V=1/2 m^2 phi^2
    where m is the mass of the inflaton field.
    
    Arguments:
    y - Array of variables with background phi as y[0]
        If you want to specify a vector of phi values, make sure
        that the first index still runs over the different 
        variables, using newaxis if necessary.
    
    params - Dictionary of parameter values in this case should
             hold the parameter "mass" which specifies m above.
             
    m can be specified in the dictionary params or otherwise
    it defaults to the mass as normalized with the WMAP spectrum
    Pr = 2.07e-9 at the WMAP pivot scale of 0.05 Mpc^-1."""
    
    #Check if mass is specified in params
    if params is not None and "mass" in params:
        m = params["mass"]
    else:
        #Use WMAP value of mass (in Mpl)
        m = 6.133e-6
    #Use inflaton mass
    mass2 = m**2
    #potential U = 1/2 m^2 \phi^2
    U = 0.5*(mass2)*(y[0]**2)
    #deriv of potential wrt \phi
    dUdphi =  (mass2)*y[0]
    #2nd deriv
    d2Udphi2 = mass2
    
    return U,dUdphi,d2Udphi2

def lambdaphi4(y, params=None):
    """Return (V, dV/dphi, d2V/dphi2) for V=1/4 lambda phi^4
    for a specified lambda.
    
    Arguments:
    y - Array of variables with background phi as y[0]
        If you want to specify a vector of phi values, make sure
        that the first index still runs over the different 
        variables, using newaxis if necessary.
    
    params - Dictionary of parameter values in this case should
             hold the parameter "lambda" which specifies lambda
             above.
             
    lambda can be specified in the dictionary params or otherwise
    it defaults to the value as normalized with the WMAP spectrum
    Pr = 2.07e-9 at the WMAP pivot scale of 0.05 Mpc^-1."""
    
    #Check if mass is specified in params
    if params is not None and "lambda" in params:
        l = params["lambda"]
    else:
        #Use WMAP value of lambda
        l = 1 #Change!
    
    #potential U = 1/4 l \phi^4
    U = 0.25*l*(y[0]**4)
    #deriv of potential wrt \phi
    dUdphi =  l*(y[0]**3)
    #2nd deriv
    d2Udphi2 = l*(y[0]**2)
    
    return U,dUdphi,d2Udphi2<commit_msg>Correct value of lambda now in place.<commit_after>"""Cosmological potentials for cosmomodels.py by <NAME>
    $Id: cmpotentials.py,v 1.3 2008/10/27 13:04:36 ith Exp $
    
    Provides functions which can be used with cosmomodels.py. 
    Default parameter values are included but can also be 
    specified as a dictionary."""
    
from __future__ import division
import numpy as N
from pdb import set_trace

def msqphisq(y, params=None):
    """Return (V, dV/dphi, d2V/dphi2) for V=1/2 m^2 phi^2
    where m is the mass of the inflaton field.
    
    Arguments:
    y - Array of variables with background phi as y[0]
        If you want to specify a vector of phi values, make sure
        that the first index still runs over the different 
        variables, using newaxis if necessary.
    
    params - Dictionary of parameter values in this case should
             hold the parameter "mass" which specifies m above.
             
    m can be specified in the dictionary params or otherwise
    it defaults to the mass as normalized with the WMAP spectrum
    Pr = 2.07e-9 at the WMAP pivot scale of 0.05 Mpc^-1."""
    
    #Check if mass is specified in params
    if params is not None and "mass" in params:
        m = params["mass"]
    else:
        #Use WMAP value of mass (in Mpl)
        m = 6.133e-6
    #Use inflaton mass
    mass2 = m**2
    #potential U = 1/2 m^2 \phi^2
    U = 0.5*(mass2)*(y[0]**2)
    #deriv of potential wrt \phi
    dUdphi =  (mass2)*y[0]
    #2nd deriv
    d2Udphi2 = mass2
    
    return U,dUdphi,d2Udphi2

def lambdaphi4(y, params=None):
    """Return (V, dV/dphi, d2V/dphi2) for V=1/4 lambda phi^4
    for a specified lambda.
    
    Arguments:
    y - Array of variables with background phi as y[0]
        If you want to specify a vector of phi values, make sure
        that the first index still runs over the different 
        variables, using newaxis if necessary.
    
    params - Dictionary of parameter values in this case should
             hold the parameter "lambda" which specifies lambda
             above.
             
    lambda can be specified in the dictionary params or otherwise
    it defaults to the value as normalized with the WMAP spectrum
    Pr = 2.07e-9 at the WMAP pivot scale of 0.05 Mpc^-1."""
    #set_trace()
    #Check if mass is specified in params
    if params is not None and "lambda" in params:
        l = params["lambda"]
    else:
        #Use WMAP value of lambda
        l = 1.5355e-13 
    
    #potential U = 1/4 l \phi^4
    U = 0.25*l*(y[0]**4)
    #deriv of potential wrt \phi
    dUdphi =  l*(y[0]**3)
    #2nd deriv
    d2Udphi2 = 3*l*(y[0]**2)
    
    return U,dUdphi,d2Udphi2
{'fraction_non_alphanumeric': 0.07782174486527228, 'fraction_numerical': 0.034482758620689655, 'mean_word_length': 2.280593325092707, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2705486', 'n_tokens_mistral': 1783, 'n_tokens_neox': 1674, 'n_words': 699}