|
1 | | -import numpy as np |
2 | 1 | import pytest |
3 | 2 |
|
4 | 3 | import pauliengine as pe |
5 | 4 |
|
6 | 5 |
|
7 | 6 | @pytest.mark.parametrize(("pauli_string", "coeff", "expected_x", "expected_z"), [ |
8 | | - ({0:"I", 1:"Z", 2:"X"}, 5.0, [3], [2]), # using dict input |
9 | | - ({10: 'Z', 2: 'X'}, 6.0, [2**10 + 2**3] , [2**10]), # using dict input with non-consecutive qubits |
| 7 | + ({0:"I", 1:"Z", 2:"X"}, 5.0, [6], [2]), # using dict input |
| 8 | + ({10: 'Z', 2: 'X'}, 6.0, [2**10 + 2**2] , [2**10]), # using dict input with non-consecutive qubits |
10 | 9 | ]) |
11 | 10 | def test_pauli_string_valid_pauli_string_input(pauli_string, coeff, expected_x, expected_z): |
12 | 11 | ps = pe.PauliString(pauli_string, coeff) |
13 | 12 | # TODO: coeff is an Expression object, need to be exposed to Python somehow. |
14 | 13 | # assert ps.coeff == coeff |
15 | 14 | assert ps.x == expected_x |
16 | | - assert ps.z == expected_z |
| 15 | + assert ps.y == expected_z |
17 | 16 |
|
18 | | -@pytest.xfail(reason="Currently, the PauliString constructor does not validate the input, but it should.") |
| 17 | +@pytest.mark.xfail |
19 | 18 | @pytest.mark.parametrize("invalid_pauli_string", [ |
20 | 19 | {0: "A", 2: "B", 3: "Z"}, # invalid character |
21 | 20 | {0: "i", 2: "z", 3: "y"}, # lowercase character |
|
0 commit comments