Atelier des rouesLaboratoire EN
Objets/Documentation

temoin_xiv.py

Programme, données ou contrôle reproductible du dossier circuits.

Télécharger ↓
"""MAJ/UMA adder from XIV and exact forward/inverse checks on all pairs."""
from blocs import cx,apply
from fractions import Fraction
import json

def tof(a, b, c):
    return (1 << a | 1 << b, 1 << c)


def maj(a, b, c):
    return [cx(a, b), cx(a, c), tof(b, c, a)]


def uma(a, b, c):
    return [tof(b, c, a), cx(a, c), cx(c, b)]

Lire dans son contexte

Commentaires

Les commentaires en français et en anglais sont réunis ici.

La discussion reste consultable. J’ouvrirai les participations dès que la protection antispam sera configurée.