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

num_duplicate_paulis cannot distinguish from num_trimmed_paulis #13

Open
caleb-johnson opened this issue Sep 25, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@caleb-johnson
Copy link
Collaborator

The reported values extracted in the qiskit_addon_obp.utils.simplify module cannot distinguish the difference between duplicate and trimmed paulis (e.g. due the tolerance).

@caleb-johnson caleb-johnson added the bug Something isn't working label Sep 25, 2024
@caleb-johnson caleb-johnson assigned mrossinek and unassigned mrossinek Sep 25, 2024
@mrossinek
Copy link
Member

Just some additional info here:

  • there is already a unittest which should cover this prepared here (it just has to be uncommented once fixed):

    # FIXME: the following fails due to a known bug. The `num_duplicate_paulis` cannot
    # differentiate between actual duplicates and values which have been trimmed due to the
    # chosen tolerances.
    # self.assertEqual(metadata.num_duplicate_paulis, 0)

  • a fix for this will have to update the following logic which will already disregard close-to-zero values from the entire simplification process:

    non_zero = np.logical_not(np.isclose(operator.coeffs, 0, atol=atol, rtol=rtol))
    paulis_x = operator.paulis.x[non_zero]
    paulis_z = operator.paulis.z[non_zero]
    nz_coeffs = operator.coeffs[non_zero]

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

2 participants