# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 2
#     language: python
#     name: python2
# ---

# + [markdown] run_control={"frozen": false, "read_only": false} toc="true"
# # Table of Contents
#  <p>

# + run_control={"frozen": false, "read_only": false}
import numpy as np
# %matplotlib inline
import sys
sys.path.append("../")
from optimize_dhamed import *

# + run_control={"frozen": false, "read_only": false}
c_l = [np.genfromtxt("count_matrix_1.txt")]

# + run_control={"frozen": false, "read_only": false}
v_ar = np.genfromtxt("wfile.txt")[:,1].reshape((9,1))

# + run_control={"frozen": false, "read_only": false}
gi= np.zeros(9)
gi[0] = 1
gi[-1] = 0.1

# + [markdown] run_control={"frozen": false, "read_only": false}
# * Subtract minimum bias energy. 

# + run_control={"frozen": false, "read_only": false}
v_ar.shape

# + run_control={"frozen": false, "read_only": false}
og = run_dhamed(c_l, -np.log(v_ar), g_init=-(np.zeros(9))*-1.0, numerical_gradients=False, gtol=10**-9, maxiter=10000)

# + run_control={"frozen": false, "read_only": false}
plt.plot(og*-1)

# + run_control={"frozen": false, "read_only": false}


StarcoderdataJupyterScriptsDedupFiltered