test_fctexp.py 984 Bytes
Newer Older
Markus Stimpfle's avatar
Markus Stimpfle committed
1
import numpy as np
2
from time import time
3
import matplotlib.pyplot as plt
4 5

import odeg as od
6
from odeg.h_eigenvalues import calculateEVs
7 8 9 10
od.utils.blockevs.output_time = True
# od.utils.hamiltonian.h_is_p_symmetric = False
plt.rcParams['figure.dpi'] = 300
plt.rcParams['savefig.dpi'] = 300
Markus Stimpfle's avatar
Markus Stimpfle committed
11 12 13 14


if __name__ == '__main__':
    
Markus Stimpfle's avatar
Markus Stimpfle committed
15
    mu_grid = np.linspace(-1.34, -1.32, 300)
16
    
17
    
18
    cfg = {
19 20
        'r0': 1,
        'rs': 2,
21 22
        'p_max': 4,
        'pos_charge': 5,
23
        'n_spin': 2,
Markus Stimpfle's avatar
Markus Stimpfle committed
24
        'theta': 0.125,
25
        'mu': mu_grid,
26
        'parallel': False,
Markus Stimpfle's avatar
Markus Stimpfle committed
27 28
        'coupling_strength': 1,
        'load_evs': True,
29
        }
30

31
    # print("\n\nconfiguration:\n", cfg, "\n\n")
32 33
    
    start = time()
34
    h_exp, n_exp, n2_exp = od.fctExp(od.energyFct, od.numberFct, od.number2Fct, **cfg)
35
    # evs, cat = calculateEVs(**cfg)
36 37 38 39
    print("t[fctexp] =", time() - start)
    # free_energy = od.freeEnergy(**cfg)
    # entropy = od.entropy(**cfg)
    
40 41
    plt.plot(mu_grid, n_exp)