Repository navigation
fix: pass explicit qubit_order to final_state_vector in state_preparation_test - #1455
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the state preparation tests in state_preparation_test.py by explicitly passing the qubit_order=qubits argument to circuit.final_state_vector calls in test_prepare_gaussian_state, test_prepare_gaussian_state_with_spin_symmetry, and test_prepare_slater_determinant. There are no review comments, and I have no additional feedback to provide.
mhucka
left a comment
There was a problem hiding this comment.
The code changes are fine, but the PR description talks about a function that does not exist. Please review for correctness, and also shorten it to a concise summary of what the PR does.
|
Thanks for pointing that out. I've updated the description to accurately list the modified test functions and shortened the summary |
Fixes #1454
Summary
Passes explicit
qubit_order=qubitstofinal_state_vector()calls in state preparation tests to prevent dimension mismatch errors caused by implicit qubit ordering when idle qubits are present.Changes Made
qubit_order=qubitstofinal_state_vector()insrc/openfermion/circuits/primitives/state_preparation_test.py:test_prepare_gaussian_statetest_prepare_gaussian_state_with_spin_symmetrytest_prepare_slater_determinantVerification
pytest-randomlyusing seed--randomly-seed=1921347655. All tests pass cleanly.