#!/usr/bin/env python
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from math import erf

RPBE = np.array(
[[2, 0.4314],
[2.1, 0.6855],
[2.2, 0.8698],
[2.3, 1.0033],
[2.4, 1.1155],
[2.5, 1.2313],
[2.6, 1.3394],
[2.7, 1.4317],
[2.8, 1.5079],
[2.9, 1.5705],
[3, 1.6225]]
)

MSRPBEl = np.array(
[[2, 0.5818],
[2.1, 0.8178],
[2.2, 0.94],
[2.3, 1.0536],
[2.4, 1.1542],
[2.5, 1.2816],
[2.6, 1.3932],
[2.7, 1.4866],
[2.8, 1.5621],
[2.9, 1.6205],
[3, 1.6729]]
)

HSE03_13X = np.array(
[[2.0,	0.8789],
[2.1,	0.9591],
[2.2,	1.0027],
[2.3,	1.0488],
[2.4,	1.1341],
[2.5,	1.2803],
[2.6,	1.4319],
[2.7,	1.5478],
[2.8,	1.6322],
[2.9,	1.6931],
[3.0,	1.7414],
[3.1,	1.7847],
[3.2,	1.8222],
[3.3,	1.857],
[3.4,	1.8871],
[3.5,	1.9116]]
)

HSE03_13X_rVV10 = np.array(
[[2.1, 1.0261],
[2.2, 1.0894],
[2.3, 1.1839],
[2.4, 1.3487],
[2.5, 1.503],
[2.6, 1.6081],
[2.7, 1.6756],
[2.8, 1.7275],
[2.9, 1.7775],
[3, 1.8253]]
)

HSE06_14X = np.array(
[[2, 0.8503],
[2.1, 0.9487],
[2.2, 0.9996],
[2.3, 1.046],
[2.4, 1.1231],
[2.5, 1.2569],
[2.6, 1.3943],
[2.7, 1.5114],
[2.8, 1.6003],
[2.9, 1.665],
[3, 1.7151]]
)

HSE06_13X = np.array(
[[2.6, 1.4077],
[2.7, 1.5378],
[2.8, 1.6251]]
)

HSE06_12X = np.array(
[[2.8, 1.6585]]
)

RSX_PBE0 = np.array(
[[2, 0.8088],
[2.1, 0.9325],
[2.2, 1.0006],
[2.3, 1.0631],
[2.4, 1.1533],
[2.5, 1.2883],
[2.6, 1.4136],
[2.7, 1.5147],
[2.8, 1.5931],
[2.9, 1.6537],
[3, 1.7033]]
)

RSX_PBE13 = np.array(
[[2, 0.8683],
[2.1, 0.9567],
[2.2, 1.0055],
[2.3, 1.0582],
[2.4, 1.1458],
[2.5, 1.291],
[2.6, 1.4318],
[2.7, 1.5408],
[2.8, 1.6226],
[2.9, 1.6843],
[3, 1.7331]]
)

mpl.rc("text", usetex=True)
fig = plt.figure(figsize=(3.69,3))

plt.plot( RPBE[:,0], RPBE[:,1], label='RPBE')
plt.plot( MSRPBEl[:,0], MSRPBEl[:,1], label='MS-RPBEl')
#plt.plot( RSX_PBE0[:,0], RSX_PBE0[:,1], label='RSX-PBE0')
#plt.plot( RSX_PBE13[:,0], RSX_PBE13[:,1], label='RSX-PBE1/3')
plt.plot( HSE03_13X[:,0], HSE03_13X[:,1], label='HSE03-1/3X')
#plt.plot( HSE03_13X_rVV10[:,0], HSE03_13X_rVV10[:,1], label='HSE03-1/3X-rVV10')
#plt.plot( HSE06_14X[:,0], HSE06_14X[:,1], label='HSE06-1/4X')
#plt.plot( HSE06_13X[:,0], HSE06_13X[:,1], label='HSE06-1/3X')
#plt.plot( HSE06_12X[:,0], HSE06_12X[:,1], label='HSE06-1/2X')


plt.legend(loc='lower right', numpoints=1, scatterpoints=1, fontsize=9)
plt.xlim(1.9,3.1)
plt.ylim(0.4,1.8)
plt.tick_params(length=6, width=1, direction='in', top=True, right=True)
plt.ylabel('Total magnetic moment')
plt.xlabel(r'$Z$ (\r{A})')

plt.tight_layout()
plt.savefig('magneticmoment.pdf')
#plt.show()
