-
Notifications
You must be signed in to change notification settings - Fork 380
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
Code that never executes in MPS::sample_measure_single_qubit #2305
Comments
…Lambdas are multiplied into mat as the algorithm goes over the qubits in the 'multiply mat by right lambda' portion of the code.
Without yet looking over the referred article(s), it looks like the multiplication by left lambda should not be done, all lambdas are multiplied along into `mat' by the code that follows and multiplies the 'right lambda'. This does not seem to be a bug, but simply a small enhancement by removing the useless code. Related with this, the Could somebody change the label to 'enhancement', it seems that I cannot edit that. |
Related with the same code, I think there still is an enhancement possible, avoiding the same matrix multiplication twice if zero is measured on a qubit. What I mean is exemplified - because it's in a single function - in my implementation of a MPS simulator: |
* For #2305 * Removed the release notes for the change
Informations
What is the current behavior?
There is some code in
src/simulators/matrix_product_state/matrix_product_state_internal.cpp' in
MPS::sample_measure_single_qubit` that never executes, more precisely, here:qiskit-aer/src/simulators/matrix_product_state/matrix_product_state_internal.cpp
Line 1686 in 1e86d65
Steps to reproduce the problem
I was looking over the sources to learn more about the qiskit aer internals when I've spotted this. Might be harmless, but it looks suspicious, so I labelled it as a bug.
What is the expected behavior?
I need to look more carefully over the code and perhaps over the referred paper (and also over 'Andrew J. Ferris and Guifre Vidal, “Perfect sampling with unitary tensor networks,” Phys. Rev. B 85, 165146 (2012)') to be sure...
Suggested solutions
Either the
code should not be there or it should not be there but the
should be in the
else
branch.The text was updated successfully, but these errors were encountered: