Atelier des rouesLab FR
Objects/Documentation

temoin_xiv.py

Code, data or reproducible check for the circuits dossier.

Download ↓
"""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)]

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.