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

SWAP gate for (non-) reversed circuit #177

Merged
merged 1 commit into from
Nov 9, 2022
Merged

Conversation

BoxiLi
Copy link
Member

@BoxiLi BoxiLi commented Nov 9, 2022

SWAP needs to be treated differently for circuits with reversed and non-reversed states order.

The fix in #170 was not complete. The reason for using \qwx[%d] without the minus sign is actually because in qutip-qip the order of states is reversed.

SWAP needs to be treated differently for circuits with reversed and non-reversed states order.
Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change looks good. Is it possible to add some sort of test for this? If it's very hard, I am okay with skipping it. It would just be nice because we keep getting this wrong. :)

@BoxiLi
Copy link
Member Author

BoxiLi commented Nov 9, 2022

It would be nice to have some tests indeed. In the test actions of qutip-qip we don't yet install texlive and other things. So some more work is needed to properly test circuit plotting. Let's maybe do it in a separate PR. Opened an issue for it #178.

@BoxiLi BoxiLi merged commit 17d37af into qutip:master Nov 9, 2022
@BoxiLi BoxiLi added this to the qutip-qip-0.2.3 milestone Dec 9, 2022
BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Dec 11, 2022
SWAP needs to be treated differently for circuits with reversed and non-reversed states order.
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.

None yet

2 participants