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

Obtain a two-qubit unitary's matrix in a way that will work after a qasm2 round-trip #528

Open
garrison opened this issue Apr 2, 2024 · 3 comments
Labels
cutting QPD-based circuit cutting code

Comments

@garrison
Copy link
Member

garrison commented Apr 2, 2024

Following Jake's comment at Qiskit/qiskit#12100 (comment), which should try replacing our use of Gate.to_matrix with a call to quantum_info.Operator(op).data. There should be a code comment right above this that says why this change was made (with a hyperlink). We should also add a test to circuit-knitting-toolbox/test/cutting/test_cutting_workflows.py to ensure that one can cut an arbitrary UnitaryGate after it has undergone a qasm2 round-trip.

This all was prompted by a test in #520 that had to be modified not to use XXPlusYYGate.

@garrison garrison added the cutting QPD-based circuit cutting code label Apr 2, 2024
@garrison
Copy link
Member Author

garrison commented Apr 2, 2024

Looks like Jake has proposed a fix. We may not need to fix this at all on our end.

@garrison
Copy link
Member Author

garrison commented Jun 6, 2024

It looks like this will be fixed in Qiskit 1.1.1: Qiskit/qiskit#12523.

@garrison garrison closed this as completed Jun 6, 2024
@garrison garrison reopened this Jun 8, 2024
@garrison
Copy link
Member Author

garrison commented Jun 8, 2024

It might actually be worth doing this. If an Instruction consists of only gates, the Operator(op).data seems to work, but .to_matrix() does not. It's worth some additional investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cutting QPD-based circuit cutting code
Projects
None yet
Development

No branches or pull requests

1 participant