File size: 666 Bytes
ac2f8e9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from sympy.testing.pytest import XFAIL
from sympy.physics.quantum.qapply import qapply
from sympy.physics.quantum.qubit import Qubit
from sympy.physics.quantum.shor import CMod, getr
@XFAIL
def test_CMod():
assert qapply(CMod(4, 2, 2)*Qubit(0, 0, 1, 0, 0, 0, 0, 0)) == \
Qubit(0, 0, 1, 0, 0, 0, 0, 0)
assert qapply(CMod(5, 5, 7)*Qubit(0, 0, 1, 0, 0, 0, 0, 0, 0, 0)) == \
Qubit(0, 0, 1, 0, 0, 0, 0, 0, 1, 0)
assert qapply(CMod(3, 2, 3)*Qubit(0, 1, 0, 0, 0, 0)) == \
Qubit(0, 1, 0, 0, 0, 1)
def test_continued_frac():
assert getr(513, 1024, 10) == 2
assert getr(169, 1024, 11) == 6
assert getr(314, 4096, 16) == 13
|