If the method HTreeQST().get_statevector() is used with a Qiskit run that has SPAM mitigation (resilience_level=1) then negative values for samples may be returned (typically these are small values).
The amplitudes above assumes samples will be positive valued (which makes sense in most cases).
What is the expected behavior?
While the physical nature of negative samples is not meaningful, it can occur in some rare cases and therefore should ideally not break this tomography technique. While it may not be very rigorous, the obvious quick fix is to redefine amplitudes = np.sqrt(np.abs(samples[0])) .
Steps to reproduce the problem
If the method HTreeQST().get_statevector() is used with a Qiskit run that has SPAM mitigation (resilience_level=1) then negative values for samples may be returned (typically these are small values).
What is the current behavior?
def get_statevector(self, parameters): """summary
The amplitudes above assumes samples will be positive valued (which makes sense in most cases).
What is the expected behavior?
While the physical nature of negative samples is not meaningful, it can occur in some rare cases and therefore should ideally not break this tomography technique. While it may not be very rigorous, the obvious quick fix is to redefine amplitudes = np.sqrt(np.abs(samples[0])) .