Objects/Documentation
polarites12.py
I provide this item to inspect or reproduce the check AT.D4.
Download ↓"""Price signed controls in an explicit positive X/CNOT/Toffoli gate library."""
from itertools import product,permutations
import json
def plan(parallel):
if not parallel:
layers=[];pol=3
for mask in (3,1,0,2,3):
if mask!=pol:
bit=0 if (mask^pol)==2 else 1
layers.append([(bit,)])
if mask!=3 or not layers:layers.append([(0,1,2+mask)])
pol=mask
return layers,6
copy=[[(0,2),(1,3)],[(0,4),(2,6),(1,5),(3,7)]]
polar=[(2*j+k,) for j in range(4) for k in (0,1) if not (j & (2>>k))]