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)]