<jupyter_start><jupyter_text>Starting with a simple Hamiltonian<jupyter_code>import flatnetwork_simple as fns
L = [6,10,2]
d = 3

mu = lambda t,i: mut[t,i]
rho = 5.0

fnet = fns.FlatNetwork(L,d)
fnet.loadParams(mu, rho)
fnet.make_mpos()

S, D = fnet.getHamiltonian()
sweepD = [     1,     2,     2,     3,     3,     4,     5,     8,    10]
sweepI = [    10,    10,    10,    10,    10,    10,    10,    10,    10]
sweepN = [1.0e-2,1.0e-3,1.0e-4,1.0e-5,1.0e-6,1.0e-6,1.0e-6,1.0e-6,1.0e-6]
sweepM = [     5,     5,     5,     5,     5,     5,     5,     5,     5]
e, mps = fnet.run(sweepd = sweepD, sweepi = sweepI, sweepn = sweepN, sweepmin = sweepM)
fvs = fnet.computeWeights(mps)
fvm = np.zeros([L[1],L[0]])

for pair in fvs:
    fvm[pair[1],pair[0]] = fvs[pair]
    if(abs(fvs[pair]>1.0e-8)):
        print(pair, fvs[pair], mu(pair[0],pair[1])))
import matplotlib.pyplot as plt
ts = [t for t in range(0,L[0])]

for i in range(L[1]):
    plt.plot(ts,fvm[i,:],'-x')
plt.xlabel('Time', fontsize=20)
plt.ylabel('Weight', fontsize=20)
for i in range(L[1]):
    plt.plot(ts,mut[:,i],'-x')
    
plt.xlabel('Time', fontsize=20)
plt.ylabel('Relative Profit', fontsize=20)<jupyter_output><empty_output><jupyter_text>Going then to Full Hamiltonian<jupyter_code>import flatnetwork as ffns
L = [6,10,2]
d = 3

mu = lambda t,i: mut[t,i]
Sig = lambda t,i,j: sigmat[t,i,j]
lam = lambda t,i: 0.001
ga = 10.0
rho = 100.0

ffnet = ffns.FlatNetwork(L,d)
ffnet.loadParams(mu, lam, Sig, rho, ga)
ffnet.make_mpos()

fS, fD = ffnet.getHamiltonian()
sweepD = [     1,     2,     2,     3,     3,     4,     5,     8,    10]
sweepI = [    10,    10,    10,    10,    10,    10,    10,    10,    10]
sweepN = [1.0e-2,1.0e-3,1.0e-4,1.0e-5,1.0e-6,1.0e-6,1.0e-6,1.0e-6,1.0e-6]
sweepM = [     5,     5,     5,     5,     5,     5,     5,     5,     5]

fe, fmps = ffnet.run(sweepd = sweepD, sweepi = sweepI, sweepn = sweepN, sweepmin = sweepM)
ffvs = ffnet.computeWeights(fmps)
ffvm = np.zeros([L[1],L[0]])

for pair in ffvs:
    ffvm[pair[1],pair[0]] = ffvs[pair]
    if(abs(ffvs[pair]>1.0e-8)):
        print(pair, ffvs[pair], mu(pair[0],pair[1]), Sig(pair[0],pair[1],pair[1]))
import matplotlib.pyplot as plt
ts = [t for t in range(0,L[0])]

for i in range(L[1]):
    plt.plot(ts,ffvm[i,:],'-x')
plt.xlabel('Time', fontsize=20)
plt.ylabel('Weight', fontsize=20)
for i in range(L[1]):
    plt.plot(ts,mut[:,i]/sigmat[:,i,i],'-x')
    
plt.xlabel('Time', fontsize=20)
plt.ylabel('Relative Profit/Volatility', fontsize=20)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19968304278922344, 'fraction_numerical': 0.07765451664025357, 'mean_word_length': 3.04, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '171391', 'license': 'MIT', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1207, 'n_words': 235, 'path': 'CosmiQ/xanadu/dataloader_test.ipynb', 'repo_name': 'ushnishray/Hackathon2021', 'size': '2524'}