vprusso / toqito

|toqito> (Theory of Quantum Information Toolkit) in Python :snake:
https://toqito.readthedocs.io/en/latest/
MIT License
137 stars 54 forks source link

Failure in non-local games tutorial #613

Open purva-thakre opened 1 month ago

purva-thakre commented 1 month ago

Vincent brought up this failure last week but we did not have a screenshot for it.

image

The difference between the expected and calculated values is large enough to think it is not due to the accuracy of the solvers.

Interestingly, this failure might happen only for Python 3.12.

vprusso commented 1 month ago

Nice catch. Yeah, don't quite know why this occurs in the docs only. I am able to run Python 3.12 on Mac with that snippet which yields (correctly) the 0.85 figure.

I wonder if it's somehow about how the docs are sequentially run and weather there might be something residual in the namespace that runs somewhat strangely in the docs for 3.12.

Good to have caught it, but definitely a bit perplexing!

purva-thakre commented 1 month ago

I am able to run Python 3.12 on Mac with that snippet which yields (correctly) the 0.85 figure.

I remember Nate saying something about a difference in a local macOS device vs. what's used by the workflows. I had unintentionally created a bug in mitiq by trying to please mypy. This led to a test passing locally on his device but the CI/CD would fail all the time.

If you see this code block passing locally on a macOS device, maybe it's a similar issue where the resources used in the runner differ from what's used on your local device. I know we don't use mypy yet but it could still be related to the accuracy of the solvers and available resources?

https://github.com/unitaryfund/mitiq/pull/2127

I did notice this failure twice yesterday. python3.11 would pass while python3.10 got canceled because python3.12 saw the failure in the screenshot.

vprusso commented 1 month ago

Ah, nice catch. And good point! It's probably something subtle like that. Which is good as it doesn't appear to be a breaking change, but definitely a bit frustrating as it's not clear where/how the state is being mangled here. Thanks for catching this!

vprusso commented 6 days ago

I think we can close this one out, but I'll wait for @purva-thakre to confirm whether I might be missing any reason to not do so.

purva-thakre commented 5 days ago

Did it resolve itself? I have not seen the failure after I created this issue.

vprusso commented 4 days ago

It has been a while since I've noticed the issue. If this one does rear its head again, we can go ahead and reopen the issue. For now, I'll tempt fate and close (which I'm sure will trigger the universe to throw the error again inadvertently).

vprusso commented 2 days ago

Opening back up: https://github.com/vprusso/toqito/actions/runs/9973551751/job/27559130957