toqito icon indicating copy to clipboard operation
toqito copied to clipboard

AssertionError for a test in `toqito/state_props/tests/test_in_separable_ball`

Open purva-thakre opened this issue 1 year ago • 6 comments

image

A unit test has been failing at random over the past few days. It passes after the failed workflow is run again.

purva-thakre avatar May 16 '24 18:05 purva-thakre

based on a recent test failure and yesterday's discussion, the accuracy of one of the solvers does appear to be the culprit here and elsewhere. The screenshot below is related to this issue.

image

https://github.com/vprusso/toqito/actions/runs/9129845659/job/25105323745#step:5:3350

purva-thakre avatar May 17 '24 14:05 purva-thakre

@vprusso I think this error is the same one I encountered here. Maybe the fix is similar to the fix for #613.

Shivansh20128 avatar Oct 28 '24 16:10 Shivansh20128

@Shivansh20128 , yes this is 100% correct, exactly the same issue. So I think your solution here would be the appropriate fix in this case. Thank you for catching this, and yes, I agree that this is the way to fix it! Thank you!

vprusso avatar Oct 28 '24 17:10 vprusso

@vprusso I tried running the test in a loop iterating it 1 million times, and then I checked if any of the runs gave False. But I found that all the runs gave True, so I am not sure if this needs to be corrected. Or maybe I am looking at the wrong place. Here is what I did: Since the above screenshot of the test error in test_in_separable_ball shows failure in rho0, I ran the first test case from the file, which is as follows- image So the test case is np.identity(4) @ np.diag(np.array([1, 1, 1, 0])) / 3 @ np.identity(4).conj().T.

My program:

image

Please let me know if I am going in the right direction. Thank you!

Shivansh20128 avatar Oct 29 '24 17:10 Shivansh20128

Ah, perhaps I initially misunderstood the connection you were drawing here. I was under the impression that your comment here was in reference to the issue here.

IOW, I believe that the repeated approach will solve the document issue that sometimes arises for the error in this comment. However, indeed, the in_separable_ball is a separate problem that (I don't think) is connected. Sorry for the confusion, and hopefully that makes sense. Of course, let me know if not, @Shivansh20128 !

vprusso avatar Oct 29 '24 17:10 vprusso

Ohh okay @vprusso . This issue has now been dealt with and the error is not coming anymore. I am now talking about the in_separable_ball error. Please refer to my previous comment here and let me know if I am going in the right direction.

Shivansh20128 avatar Oct 30 '24 05:10 Shivansh20128

Ohh okay @vprusso . This issue has now been dealt with and the error is not coming anymore. I am now talking about the in_separable_ball error. Please refer to my previous comment here and let me know if I am going in the right direction.

Ah, okay, so if I understand what you're saying correctly (and sorry for taking this long to get here) you're saying that you're unable to replicate this issue even after running a bunch of times?

If that's the case, I wonder if we should close this issue out for now as we are unable to replicate?

vprusso avatar Oct 31 '24 12:10 vprusso

Ah, okay, so if I understand what you're saying correctly (and sorry for taking this long to get here) you're saying that you're unable to replicate this issue even after running a bunch of times?

Yes, that is what I meant.

If that's the case, I wonder if we should close this issue out for now as we are unable to replicate?

Yes, I think so too, because I think it is super unlikely to happen. If didn't show up even once after running for 1000000 times, I a doubtful how the error even showed up.

Shivansh20128 avatar Oct 31 '24 12:10 Shivansh20128

Ah, okay, so if I understand what you're saying correctly (and sorry for taking this long to get here) you're saying that you're unable to replicate this issue even after running a bunch of times?

Yes, that is what I meant.

If that's the case, I wonder if we should close this issue out for now as we are unable to replicate?

Yes, I think so too, because I think it is super unlikely to happen. If didn't show up even once after running for 1000000 times, I a doubtful how the error even showed up.

Gotcha. In that case, let's go ahead and close this issue for now. If it crops back up, we'll re-open. Thanks, @Shivansh20128 !

vprusso avatar Oct 31 '24 16:10 vprusso