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

Test test_hilbert_schmidt_inner_product_is_positive_definite[m6] fails on aarch64 and ppc64le #4379

Closed
ggardet opened this issue Aug 3, 2021 · 14 comments
Assignees
Labels
area/linalg area/testing kind/bug-report Something doesn't seem to work. triage/needs-reproduction [Bugs reports] The bug or problem has not been reproduced yet

Comments

@ggardet
Copy link

ggardet commented Aug 3, 2021

Description of the issue
Test test_hilbert_schmidt_inner_product_is_positive_definite[m6] fails on openSUSE Tumbleweed aarch64/ppc64le

[  765s] =================================== FAILURES ===================================
[  765s] _________ test_hilbert_schmidt_inner_product_is_positive_definite[m6] __________
[  765s] 
[  765s] m = array([[ 0.5+0.5j, -0.5-0.5j],
[  765s]        [ 0.5+0.5j,  0.5+0.5j]])
[  765s] 
[  765s]     @pytest.mark.parametrize('m', (I, X, Y, Z, H, SQRT_X, SQRT_Y, SQRT_Z))
[  765s]     def test_hilbert_schmidt_inner_product_is_positive_definite(m):
[  765s]         v = cirq.hilbert_schmidt_inner_product(m, m)
[  765s] >       assert np.isreal(v)
[  765s] E       assert False
[  765s] E        +  where False = <function isreal at 0xffff928f8310>((2.000000000000001+4.930380657631324e-32j))
[  765s] E        +    where <function isreal at 0xffff928f8310> = np.isreal
[  765s] 
[  765s] cirq/linalg/operator_spaces_test.py:166: AssertionError

How to reproduce the issue
Run test suite on aarch64 or ppc64le.

Cirq version
0.9.1

@ggardet ggardet added the kind/bug-report Something doesn't seem to work. label Aug 3, 2021
@ggardet ggardet changed the title Test test_hilbert_schmidt_inner_product_is_positive_definite[m6] fails on aarch64 Test test_hilbert_schmidt_inner_product_is_positive_definite[m6] fails on aarch64 and ppc64le Aug 3, 2021
@viathor
Copy link
Collaborator

viathor commented Aug 6, 2021

@ggardet Do you have more information about how the test fails?

Everyone else: Anyone's got access to the platform? I think you can run this to reproduce:

pytest -k test_hilbert_schmidt_inner_product_is_positive_definite cirq-core/cirq/linalg/operator_spaces_test.py

@viathor viathor added area/linalg triage/needs-reproduction [Bugs reports] The bug or problem has not been reproduced yet area/testing labels Aug 6, 2021
@ggardet
Copy link
Author

ggardet commented Aug 6, 2021

@ggardet Do you have more information about how the test fails?

I forgot to add the log, sorry. I added it to the 1st comment now.

@balopat
Copy link
Contributor

balopat commented Aug 12, 2021

A rounding error...e-32... we should just use np.isclose(np.imag(v), atol=1e-16) or similar.

@ggardet
Copy link
Author

ggardet commented Sep 7, 2021

I can test a patch if needed.

@github-actions
Copy link

github-actions bot commented Oct 8, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days

@vtomole
Copy link
Collaborator

vtomole commented Oct 8, 2021

@ggardet Please do.

@ggardet
Copy link
Author

ggardet commented Oct 8, 2021

@ggardet Please do.

@vtomole Which patch could I test? I see nothing to test yet.

@github-actions
Copy link

github-actions bot commented Nov 8, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days

@dabacon
Copy link
Collaborator

dabacon commented Nov 8, 2021

Could someone who has access to this architecture please see if the fix provided works?

@ggardet ?

CirqBot pushed a commit that referenced this issue Nov 8, 2021
See #4379 for failure which occurs only on some architectures.
@risicle
Copy link

risicle commented Nov 10, 2021

We happen to be putting together the NixOS package for this at the moment and we're finding this and a few other tests are failing on aarch64-linux due to tolerance issues. Full log: https://hydra.nixos.org/log/df0xzjzyvn3g8g9pmaais8y8k5wv3pd3-python3.8-cirq-core-0.13.1.drv

@ggardet
Copy link
Author

ggardet commented Nov 12, 2021

Could someone who has access to this architecture please see if the fix provided works?

@ggardet ?

Yes, the fix in #4636 make the test to pass. Thanks!

@vtomole
Copy link
Collaborator

vtomole commented Nov 12, 2021

@ggardet Awesome

@risicle Does this fix work for that NixOS package? Note, you'll need to test on the dev version of Cirq: pip install cirq==0.14.0.dev20211112014647

CirqBot pushed a commit that referenced this issue Nov 12, 2021
More tests that were failing due to precision.  See #4379
@dabacon
Copy link
Collaborator

dabacon commented Nov 12, 2021

@risicle added fixes for the tests you list. Could you verify these are now fine. Thanks!

@risicle
Copy link

risicle commented Nov 12, 2021

Absolutely. 100%. Perfect - thankyou. 👍

rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this issue Oct 31, 2024
See quantumlib#4379 for failure which occurs only on some architectures.
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this issue Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/linalg area/testing kind/bug-report Something doesn't seem to work. triage/needs-reproduction [Bugs reports] The bug or problem has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

6 participants