Ejemplo n.º 1
0
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import numpy as np
import matplotlib.pyplot as plt
import y_conjugacy_classes as ycc
import state as st

s2 = st.ToricLattice(2)
sc2 = ycc.synd_classes(s2)
h2 = ycc.hist_array(sc2, 2)

s4 = st.ToricLattice(4)
sc4 = ycc.synd_classes(s4)
h4 = ycc.hist_array(sc4, 4)

s6 = st.ToricLattice(6)
sc6 = ycc.synd_classes(s6)
h6 = ycc.hist_array(sc6, 6)


def p2(p):
    return ycc.success_probability(h2, p)


def p4(p):
    return ycc.success_probability(h4, p)


def p6(p):
    return ycc.success_probability(h6, p)
Ejemplo n.º 2
0
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import numpy as np
import matplotlib.pyplot as plt
import y_conjugacy_classes as ycc
import state as st

s2 = st.ToricLattice(2)
sc2 = ycc.synd_classes(s2)
h2 = ycc.hist_array(sc2, 2)

s4 = st.ToricLattice(4)
sc4 = ycc.synd_classes(s4)
h4 = ycc.hist_array(sc4, 4)

s6 = st.ToricLattice(6)
sc6 = ycc.synd_classes(s6)
h6 = ycc.hist_array(sc6, 6)

def p2(p):
    return ycc.success_probability(h2, p)
def p4(p):
    return ycc.success_probability(h4, p)
def p6(p):
    return ycc.success_probability(h6, p)

pp = np.linspace(0, 1, 101)

fontsize=16
Ejemplo n.º 3
0
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import numpy as np
import y_conjugacy_classes as ycc
import state as st

s4 = st.ToricLattice(4)
sc4 = ycc.synd_classes(s4)
h4 = ycc.hist_array(sc4, 4)

def p4n(p, q):
    return ycc.small_noisy_prob(h4, 4, p, q)

pp = np.linspace(0, 0.2, 81)
qq = np.linspace(0, 0.12, 49)

PP, QQ = np.meshgrid(pp, qq)

Z4 = np.array([[p4n(p, q) for p in pp] for q in qq])

import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)

fontsize=16

Z = Z4 - (1 - PP)**2
cont =  ax.contour(QQ, PP, Z, [0.06, 0.05, 0.04, 0.03, 0.02, 0.01], colors=('black'))
plt.clabel(cont, inline=1, fontsize=fontsize)
cont2 = ax.contour(QQ, PP, Z, [0], colors = ('black'), linewidths=(3))