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

Fix #134: incorrect optimization for qiskit circuit #135

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

bichselb
Copy link

This should fix #134.

@jvdwetering jvdwetering merged commit 0f8737d into zxcalc:master Aug 24, 2023
4 checks passed
@dlyongemallo
Copy link
Contributor

I noticed that this change has a side-effect on an edge case. Suppose the input is this:

   ┌───┐
q: ┤ T ├
   └───┘

Then, after applying optimisation, the previous output would've been no change:

   ┌───┐
q: ┤ T ├
   └───┘

However, with this change, the output now becomes:

   ┌─────────┐
q: ┤ Rz(π/4) ├
   └─────────┘

It's logically the same, but it's a change nevertheless. Is this desirable?

@jvdwetering
Copy link
Collaborator

I don't think that should lead to any problems. It is semantically still the same circuit.

@dlyongemallo
Copy link
Contributor

I agree. I just thought I'd note it in case someone wanted a noop for an already optimised input, or if some tool which takes in qasm input treats t and rz(0.25*pi) differently for some reason.

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

Successfully merging this pull request may close these issues.

Incorrect optimization for Qiskit circuit?
3 participants