walsh transform

This commit is contained in:
2026-05-18 15:05:09 +02:00
parent 3f93c074ef
commit 84fda8757c
5 changed files with 108 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
from walsh.walsh import walsh_transform
def test_walsh_xor_two_variables():
assert walsh_transform("x1 XOR x2") == [0, 0, 0, 4]
def test_walsh_or_two_variables():
assert walsh_transform("x1 OR x2") == [-2, 2, 2, 2]
def test_walsh_xor_three_variables():
assert walsh_transform("x1 XOR x2 XOR x3") == [0, 0, 0, 0, 0, 0, 0, 8]