maxtuno / CNFX

A base -1 + i CNF encoder for complex field operations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CNFX

A base -1 + i CNF encoder for complex field operations.

Note: Multiplication is implemented (pre-alpha)

Note: Actually is only is implemented the addition, subtraction, equality and difference.

Note: In future the licence will change to MIT for the moment is 100% proprietary.

installation:

    pip install cnfx

Work in progress.

    python3 test.py
    ... 
    (-63.6640625-0.25390625j) (1.828125+0.9921875j) (0.1875+0j) (-61.7109375+0.74609375j) (-61.7109375+0.74609375j) (0.07421875+0.0078125j) (47.95703125+156.05859375j) (-0.25-0.25j) True True True False
    (-124.2265625-132.76171875j) (1.890625+1j) (0.1875+0j) (-122.2734375-131.76171875j) (-122.2734375-131.76171875j) (0.01171875+0j) (-53.91796875-154.01171875j) (-0.5+0j) True True True False
    (0.19921875-32.19921875j) (-5.09765625-8j) (0.1875+0j) (-4.84765625-40.19921875j) (-4.84765625-40.19921875j) 0j (-3.9375+0j) (-0.75+0j) True True True True
    (0.01171875-0.01171875j) (-5.09765625-8j) (0.1875+0j) (-5.03515625-8.01171875j) (-5.03515625-8.01171875j) 0j (0.1875+0j) (15.75+0j) True True True True
    (19.88671875+11.98046875j) (3.21484375-0.2421875j) (0.125+0j) (23.02734375+11.60546875j) (23.02734375+11.60546875j) (-0.25-0.1328125j) (-0.0234375+0.3359375j) (-128.328125+0.515625j) True True True False
    (-0.2265625-0.12890625j) (-5.296875-8.2578125j) -0.125j (-5.3359375-8.25390625j) (-5.3359375-8.25390625j) (-0.23828125-0.1171875j) (-111.69921875+7.8359375j) (-0.5-0.125j) True True True False
    (96.0234375-32.01171875j) (6.390625-4.5j) (0.1875+0j) (102.4765625-36.51171875j) (102.4765625-36.51171875j) (0.01171875+0j) (-48.06640625+100.09375j) (0.25+0.25j) True True True False
    (4.0234375-28.00390625j) (-13.171875+15.9921875j) (0.125+0j) (-8.9609375-12.00390625j) (-8.9609375-12.00390625j) (0.01171875+0.0078125j) (47.95703125+156.05859375j) (-0.25-0.25j) True True True False
    (31.7734375+31.99609375j) (3.015625-0.1328125j) (0.0625-0.125j) (34.8515625+32.12109375j) (34.8515625+32.12109375j) (-0.23828125+0.0078125j) (-3.9140625-47.75390625j) (-0.25+0.5j) True True True False
    (0.26171875-0.26171875j) (2.83984375+0.0625j) (0.1875+0j) (3.15234375-0.19921875j) (3.15234375-0.19921875j) 0j (-3.9375+0j) (-0.75+0j) True True True True
    (-0.23828125-0.76171875j) (2.90234375+0j) (0.1875+0j) (2.71484375-0.76171875j) (2.71484375-0.76171875j) 0j (3.9375-3.9375j) (0.375+0.375j) True True True True
    (-11.73828125+11.73828125j) (-5.09765625-8j) (0.1875+0j) (-16.78515625+3.73828125j) (-16.78515625+3.73828125j) 0j (-3.9375+0j) (-0.75+0j) True True True True
    (-8.30078125-8.69921875j) (6.90234375-4j) (0.1875+0j) (-1.34765625-12.69921875j) (-1.34765625-12.69921875j) 0j (31.5+31.5j) (0.046875-0.046875j) True True True True
    (-4.99609375-7.5j) (63.76953125+64.06640625j) (0.125+0j) (58.953125+56.56640625j) (58.953125+56.56640625j) (0.00390625+0j) 0.5j -6.0390625j True True True True
    (-48.5390625-144.37890625j) (2.953125-0.0078125j) (0.1875+0.125j) (-45.5859375-144.50390625j) (-45.5859375-144.50390625j) (-0.05078125+0.1328125j) (55.91796875-104.1796875j) (-0.5625-0.6875j) True True True False
    (64.01953125-64.00390625j) (6.83203125-4.0078125j) (0.125+0j) (71.03515625-68.00390625j) (71.03515625-68.00390625j) (0.0078125+0.0078125j) (-4.09375+0.03125j) (-0.75+0j) True True True False
    (-31.74609375+31.7421875j) (6.89453125-3.86328125j) (0.1875+0.125j) (-24.796875+27.62109375j) (-24.796875+27.62109375j) (0.00390625-0.0078125j) (71.63671875-72.06640625j) (-0.125+0.5j) True True True False
    (-31.74609375+32.25j) (58.39453125-72.49609375j) (0.1875+0j) (26.703125-40.24609375j) (26.703125-40.24609375j) (0.00390625+0j) (0.125-0.25j) (-55.94921875-56.12109375j) True True True False
    (0.2734375+0.24609375j) (6.828125-4.0078125j) (0.125+0j) (7.2890625-3.75390625j) (7.2890625-3.75390625j) (0.01171875+0.0078125j) (0.10546875+127.7421875j) (0.15625+0.0859375j) True True True False
    (48.01171875+31.98046875j) (6.90234375-3.9921875j) (0.1875+0j) (54.96484375+27.98046875j) (54.96484375+27.98046875j) -0.0078125j (-48.05859375+100.0703125j) (0.25+0.25j) True True True False
    (0.13671875-64.26171875j) (3.02734375+0j) (0.1875+0j) (3.08984375-64.26171875j) (3.08984375-64.26171875j) (-0.125+0j) (-107.71484375-164.2109375j) (-0.375+0.125j) True True True False
    (-19.9765625+147.99609375j) (2.828125-0.0078125j) (0.125+0j) (-16.9609375+147.99609375j) (-16.9609375+147.99609375j) (0.01171875+0.0078125j) (-0.421875-0.09375j) (-64.078125+0.08984375j) True True True False
    (0.26171875+0.23828125j) (-1.09765625-12j) (0.1875+0j) (-0.78515625-11.76171875j) (-0.78515625-11.76171875j) 0j (3.9375-3.9375j) (0.375+0.375j) True True True True
    (-0.23828125-0.38671875j) (2.90234375-31.875j) (0.1875+0j) (2.71484375-32.26171875j) (2.71484375-32.26171875j) 0j (-3.9375+0j) (-0.75+0j) True True True True
    (-0.23828125-0.26171875j) (2.90234375+0j) (0.1875+0j) (2.71484375-0.26171875j) (2.71484375-0.26171875j) 0j (-3.9375+0j) (-0.75+0j) True True True True
    (0.2734375+0.23828125j) (2.890625+0j) (0.1875+0j) (3.2265625+0.23828125j) (3.2265625+0.23828125j) (0.01171875+0j) (-53.91796875-154.01171875j) (-0.5+0j) True True True False
    (-0.23828125-4.26171875j) (2.90234375+0j) (0.1875+0j) (2.71484375-4.26171875j) (2.71484375-4.26171875j) 0j (-0.5-0.5j) (-2.953125+2.953125j) True True True True
    (-0.296875+7.66796875j) (2.7109375+0.0078125j) -0.125j (2.84375+7.79296875j) (2.84375+7.79296875j) (0.00390625-0.1328125j) (47.67578125+155.90234375j) (-0.25-0.25j) True True True False
    (-64.734375-22.76171875j) (2.3984375-0.5j) (0.1875+0j) (-62.28125-23.26171875j) (-62.28125-23.26171875j) (0.00390625+0j) (-48.03515625+100.078125j) (0.25+0.25j) True True True False
    (-15.7265625+152.12109375j) (2.828125+0.1171875j) (0.125+0j) (-12.7109375+152.24609375j) (-12.7109375+152.24609375j) (0.01171875+0.0078125j) (-176.00390625-159.91015625j) (-0.1875-0.75j) True True True False
    (0.265625+0.23828125j) (6.8984375-4j) (0.1875+0j) (7.21875-3.76171875j) (7.21875-3.76171875j) (0.00390625+0j) (-7.98828125+136.0703125j) (0.125+0.5j) True True True False
    (-8.73828125-6.76171875j) (2.90234375+0j) (0.1875+0j) (-5.78515625-6.76171875j) (-5.78515625-6.76171875j) 0j (3.9375-3.9375j) (0.375+0.375j) True True True True
    (-1.23828125+0.73828125j) (-13.16015625+16.0625j) (0.1875+0j) (-14.34765625+16.80078125j) (-14.34765625+16.80078125j) 0j (-2.953125+2.953125j) (-0.5-0.5j) True True True True
    (-15.609375-15.76953125j) (2.2734375-0.4921875j) (0.1875+0j) (-13.28125-16.26953125j) (-13.28125-16.26953125j) (0.00390625-0.0078125j) (0.0625+0j) (47.3125-0.125j) True True True True
    (-64.234375+7.73828125j) (-1.1015625-12j) (0.1875+0j) (-65.28125-4.26171875j) (-65.28125-4.26171875j) (0.00390625+0j) (-99.9375-155.97265625j) (-0.5-0.25j) True True True False
    (3.76171875-4.26171875j) (-14.09765625+17j) (0.1875+0j) (-10.28515625+12.73828125j) (-10.28515625+12.73828125j) 0j (3.9375-3.9375j) (0.375+0.375j) True True True True
    (4.26171875-3.76171875j) (2.90234375+0j) (0.1875+0j) (7.21484375-3.76171875j) (7.21484375-3.76171875j) 0j (-3.9375+0j) (-0.75+0j) True True True True
    (-0.23828125-0.26171875j) (-5.09765625-40j) (0.1875+0j) (-5.28515625-40.26171875j) (-5.28515625-40.26171875j) 0j (-2.953125+2.953125j) (-0.5-0.5j) True True True True
    (-0.23828125-0.26171875j) (2.90234375+0j) (0.1875+0j) (2.71484375-0.26171875j) (2.71484375-0.26171875j) 0j (-2.953125+2.953125j) (-0.5-0.5j) True True True True
    (-24.18359375+7.9921875j) (3.33203125-31.73828125j) (0.1875+0j) (-20.984375-23.75390625j) (-20.984375-23.75390625j) (-0.18359375-0.0078125j) (-107.95703125-164.375j) (-0.375+0.125j) True True True False
    (-4.05078125-11.44921875j) (2.71484375-0.125j) -0.125j (-0.91015625-11.32421875j) (-0.91015625-11.32421875j) 0j (-0.25+0j) (-12.5625-0.5j) True True True True
    (-2.05078125-9.44921875j) (0.71484375-2.125j) -0.125j (-0.91015625-11.32421875j) (-0.91015625-11.32421875j) 0j (-0.25+0j) (-12.5625-0.5j) True True True True
    (12-12j) (2.8984375+0.50390625j) (0.1875+0j) (14.94921875-11.49609375j) (14.94921875-11.49609375j) 0j (31.5+31.5j) (0.046875-0.046875j) True True True True
    (12.01171875-12j) (2.38671875+0.00390625j) (0.1875+0j) (14.4609375-11.99609375j) (14.4609375-11.99609375j) (0.01171875+0j) (-48.06640625+100.09375j) (0.25+0.25j) True True True False
    (12.06640625-12j) (2.20703125+127.87890625j) (0.0625-0.125j) (14.640625+116.12890625j) (14.640625+116.12890625j) (0.06640625+0j) (0.40625+8.34375j) -0.375j True True True False
    (3.51953125-4.00390625j) (2.83203125-0.0078125j) (0.125+0j) (6.53515625-4.00390625j) (6.53515625-4.00390625j) (0.0078125+0.0078125j) (-4.09375+0.03125j) (-0.75+0j) True True True False
    (4.01171875-3.51171875j) (2.40234375-0.5j) (0.1875+0j) (6.46484375-4.01171875j) (6.46484375-4.01171875j) 0j (3.9375-3.9375j) (0.375+0.375j) True True True True
    (-0.04296875+0.55859375j) (2.89453125-0.0078125j) (0.1875+0j) (2.91015625+0.55859375j) (2.91015625+0.55859375j) (0.0078125+0.0078125j) (0.015625-5.921875j) 0.5j True True True True
    (4.01171875-3.51171875j) (2.40234375-0.5j) (0.1875+0j) (6.46484375-4.01171875j) (6.46484375-4.01171875j) 0j (-2.953125+2.953125j) (-0.5-0.5j) True True True True
    (0.01171875-0.08203125j) (2.83984375+0.1328125j) (0.1875+0j) (2.90234375-0.08203125j) (2.90234375-0.08203125j) -0.1328125j (-31.78125+127.671875j) (0.28125-0.28125j) True True True False
    (0.01171875+0.05078125j) (1.83984375+1j) (0.1875+0j) (1.90234375+1.05078125j) (1.90234375+1.05078125j) 0j (31.5+31.5j) (0.046875-0.046875j) True True True True
    (2.01171875+2.05078125j) (-0.16015625-1j) (0.1875+0j) (1.90234375+1.05078125j) (1.90234375+1.05078125j) 0j (31.5+31.5j) (0.046875-0.046875j) True True True True
    (0.01171875+0.05078125j) (2.83984375+0j) (0.1875+0j) (2.90234375+0.05078125j) (2.90234375+0.05078125j) 0j (31.5+31.5j) (0.046875-0.046875j) True True True True
    (-7.98828125-7.94921875j) (2.83984375+0j) (0.1875+0j) (-5.09765625-7.94921875j) (-5.09765625-7.94921875j) 0j (3.9375-3.9375j) (0.375+0.375j) True True True True
    (3.2265625-4.203125j) (39.37890625+48j) (0.1875+0j) (42.6640625+43.796875j) (42.6640625+43.796875j) (0.0078125+0j) (0.125+0.125j) (11.84375-11.84375j) True True True True
    (0.01171875+0.05078125j) (1.83984375+1j) (0.1875+0j) (1.90234375+1.05078125j) (1.90234375+1.05078125j) 0j (3.9375-3.9375j) (0.375+0.375j) True True True True
    (64.26171875-56.32421875j) (2.83984375+0.125j) (0.1875+0j) (67.15234375-56.19921875j) (67.15234375-56.19921875j) 0j -5.90625j 0.5j True True True True

About

A base -1 + i CNF encoder for complex field operations.


Languages

Language:Python 100.0%