Atelier des rouesLab FR
Objects/Documentation

raccord27.py

A whole segment of optimal decoders · raccord27.py

Download ↓
"""Face of optimal faithful decoders at the half-transfer junction."""
import json
from fractions import Fraction as F
from faces25 import vertices,load,table,constraints

def study():
    laws=table(load('commun23')['controls'][1]['target'])
    j=next(i for i in (0,1) if laws[2][i])
    laws[2][j]-=F(1,2);laws[2][2]+=F(1,2)
    vs=sorted(vertices(laws,F(7,24)))
    assert len(vs)==2
    costs=[]
    for a in range(11):
        u,v=[(x*a+y*(10-a))/10 for x,y in zip(*vs)]
        cost=max(x*u+y*v-rhs for (x,y),rhs in constraints(laws));assert cost==F(7,24)
        costs.append([F(a,10),u,v,cost])

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.