Enable try_matrix & friends for PPR and PPM#16011
Enable try_matrix & friends for PPR and PPM#16011Cryoris wants to merge 2 commits intoQiskit:mainfrom
try_matrix & friends for PPR and PPM#16011Conversation
Previously, the `matrix` method was added but not actually used in the codebase. This commit also fixes the commutation checker for PPR with another matrix-based gate, which previously failed since it couldn't extract a matrix from PPR.
|
One or more of the following people are relevant to this code:
|
|
#15975 isn't safe for backport - it's a new feature - so I wouldn't think this is either? Not spotting an optimisation opportunity isn't a bug really, it's just an opportunity to improve. |
There was a problem hiding this comment.
Thanks Julien for doing this. I am with Jake on this one - this is more of a new feature rather than a bug fix (and it's too much of code to backport at the last second in the upcoming release).
The other missing methods for packed_instruction that would be nice to add as a part of this PR are try_matrix_as_static_1q, try_matrix_as_nalgebra_1q, try_matrix_as_static_2q, and try_matrix_as_nalgebra_2q.
Update: also can you add some tests for PPMs? (Obviously we don't have matrices for those, but it would be nice to check that the code does not break when we call say try_matrix possibly as part of commutation checking).
releasenotes/notes/fix-ppr-commutation-checking-3d0c0c9397da4570.yaml
Outdated
Show resolved
Hide resolved
- Feature, not bugfix reno - Add SK test - Add PPM matrix test (which always is False)
Shelly is doing this in a separate issue, see #16020.
Done in a87b116. |
Previously, the
matrixmethod was added but not actually used in the codebase. This commit also fixes the commutation checker for PPR with another matrix-based gate, which previously failed since it couldn't extract a matrix from PPR.It would be good to backport this to 2.4, though we have to backport #15975 first.
AI/LLM disclosure