Skip to content
New issue

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

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

Already on GitHub? # to your account

Improve error message for failed qiskit_to_tk conversion #158

Merged
merged 9 commits into from
Aug 14, 2023

Conversation

CalMacCQ
Copy link
Contributor

@CalMacCQ CalMacCQ commented Aug 9, 2023

Small PR to imporve the error message for failed qiskit_to_tk conversion adressing #150

This snippet now gives the following error message for the unsupported gate

from qiskit import QuantumCircuit
from qiskit.circuit.library import XXPlusYYGate
from pytket.extensions.qiskit import qiskit_to_tk

qc = QuantumCircuit(2)
qc.append(XXPlusYYGate(0.1), [0, 1]) # add unsupported gate

tkc = qiskit_to_tk(qc)

Screenshot 2023-08-11 at 11 02 48

Note: The two reverted commits correspond to an attempted fix of #43. However I realised this was slightly more involved than expected so its probably best adressed in a separate PR.

@CalMacCQ CalMacCQ requested a review from cqc-melf as a code owner August 9, 2023 13:52
@CalMacCQ CalMacCQ removed the request for review from cqc-melf August 9, 2023 13:53
@CalMacCQ CalMacCQ changed the title Improve error messages for qiskit_to_tk and tk_to_qiskit Improve error message for failed qiskit_to_tk conversion Aug 11, 2023
@CalMacCQ CalMacCQ requested a review from cqc-alec August 11, 2023 10:05
@CalMacCQ
Copy link
Contributor Author

CalMacCQ commented Aug 12, 2023

Hmm maybe its better to use custom error here rather than NotImplementedError.

@cqc-alec
Copy link
Collaborator

Hmm maybe its better to use custom error here rather than NotImplementedError.

NotImplementedError seems fine to me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants