Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FaultEnumerator with method='propagator' incorrectly handles multiple classical registers #183

Open
quantumjim opened this issue May 2, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@quantumjim
Copy link
Member

quantumjim commented May 2, 2022

Steps to reproduce the problem

from qiskit_qec.analysis.faultenumerator import FaultEnumerator
from qiskit import *

qc = QuantumCircuit(2)
for _ in range(2):
    qc.add_register(ClassicalRegister(1))
qc.measure(range(2),range(2))

fe = FaultEnumerator(qc, order=1, method="propagator")

print(list(fe.generate()))

What is the current behavior?

Output is flattened to a single classical register when FaultEnumerator is used with method="propagator". For example, the following outputs

[(0, ['measure'], ['x'], [1, ' ', 0]), (1, ['measure'], ['x'], [0, ' ', 1])]

for method="stabilizer", where the [1, ' ', 0] represents the bit string 1 0 that would be output by the circuit, etc. However, for method="propagator" the output is

[(0, ['measure'], ['x'], [1, 0]), (1, ['measure'], ['x'], [0, 1])]

What is the expected behavior?

The two methods should give the same output.

This issue has been fixed in #179 for the use of generate(), but the fix has not yet been applied to generate_blocks().

Once the issue is fixed, the following test should be added to 'tests/matching/test_repetitionmatcher.py' (added in #179) and should pass.

    def test_error_pairs_pymatching_propagator(self):
        """Test the case with two faults on a d=5 code using pymatching and the propagator method."""
        self.test_error_pairs(dec_method="pymatching", fe_method="propagator")
@quantumjim quantumjim added the bug Something isn't working label May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant