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

Makes measurement support degenerate states #2342

Merged
merged 3 commits into from Mar 1, 2024

Conversation

Ericgig
Copy link
Member

@Ericgig Ericgig commented Feb 29, 2024

Description
Measurement functions did not take into account degenerate states of the operator. (#1800, #2054)
Also the returned probabilities could be negative. (#2265)

I added a tolerance to these function for the minimal probability. Smaller / negative probabilities are rounded to 0.
I also changed measurement_statistics_observable to support degenerate operators: It always return the projectors, with projectors and probabilities of degenerate sub-systems summed. It also only return the (eigenvalues, projector, probability) set for cases where the probability is greater than tol.

Related issues or PRs
fix #1800, #2054, #2029, #2265

@coveralls
Copy link

coveralls commented Feb 29, 2024

Coverage Status

coverage: 85.844% (+0.03%) from 85.813%
when pulling 891b7c3 on Ericgig:misc.degen_measurement
into 4234aa5 on qutip:master.

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.

One suggestion but otherwise looks good.

qutip/measurement.py Show resolved Hide resolved
qutip/measurement.py Outdated Show resolved Hide resolved
@Ericgig Ericgig merged commit 330b545 into qutip:master Mar 1, 2024
11 of 12 checks passed
@Ericgig Ericgig deleted the misc.degen_measurement branch March 1, 2024 14:28
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.

Support measurments of observables with degenerate eigenvalues
3 participants