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 Relabel for odd size arrays #2082

Merged
merged 1 commit into from
Dec 30, 2024
Merged

Fix Relabel for odd size arrays #2082

merged 1 commit into from
Dec 30, 2024

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented Dec 29, 2024

When relabeling qubits arrays with odd lengths 5 or greater, the final case in the match statement triggered with a bug that caused the mappings tracked for swaps to be updated incorrectly, resulting in the wrong qubit labels being swapped. This fixes the bug, updates some variable names and comments for clarity, and adds new test cases to verify the expected behavior. It also fixes a minor test bug in a related test that was verifying the wrong state.

Fixes #2077

When relabeling qubits arrays with odd lengths 5 or greater, the final case in the match statement triggered with a bug that caused the mappings tracked for swaps to be updated incorrectly, resulting in the wrong qubit labels being swapped. This fixes the bug, updates some variable names and comments for clarity, and adds new test cases to verify the expected behavior. It also fixes a minor test bug in a related test that was verifying the wrong state.

Fixes #2077
@swernli swernli enabled auto-merge December 30, 2024 04:22
@swernli swernli disabled auto-merge December 30, 2024 18:21
@DmitryVasilevsky DmitryVasilevsky added this pull request to the merge queue Dec 30, 2024
Merged via the queue into main with commit ee533bb Dec 30, 2024
18 checks passed
@DmitryVasilevsky DmitryVasilevsky deleted the swernli/issue2077 branch December 30, 2024 19:20
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.

Relabel applies wrong permutation for >=5 qubits
3 participants