Closed crazy4pi314 closed 3 years ago
@rmlarose is this correct? I also couldn't work out exactly how existing methods supported Qiskit circuits 😓
_create_weight_mask
is a helper function specific to cirq.Circuit
s. The public folding functions https://github.com/unitaryfund/mitiq/blob/a3d6bd773798af3ec3e7a555ea6a1b91e207be1e/mitiq/zne/scaling/__init__.py#L17-L27 are for any QPROGRAM
. I think mypy complains if these public functions are not annotated with cirq.Circuit
s, but anything with the @noise_scaling_converter
decorator accepts any QPROGRAM
.
I think this can be closed. Please reopen if appropriate.
Pre-Report Checklist
Issue Description
It seems like many of the helper functions for folding only work for Circ circuits, but seem to pass some tests when given Qiskit circuits with seemingly no conversion. See https://github.com/unitaryfund/mitiq/blob/master/mitiq/zne/scaling/folding.py#L509 for example, which says it take only Circ circuit types but seems to work with the Qiskit ones. I know type hints are not binding, but we can see that one of the functions called by fold from right/left fails when given a Qiskit circuit.
How to Reproduce
Code Snippet
Sample from image
Error Output
Environment Context
Use the
about()
function to summarize information on operating system, python version and dependencies.Additional Python Environment Details (
pip freeze
orconda list
):