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

unit test failures with 4.7.5 and scipy 1.12 on aarch64 linux #2316

Open
ghost opened this issue Feb 4, 2024 · 3 comments
Open

unit test failures with 4.7.5 and scipy 1.12 on aarch64 linux #2316

ghost opened this issue Feb 4, 2024 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 4, 2024

Bug Description

unit test test_dqd_current fails on aarch64 linux

Code to Reproduce the Bug

the unit test

Code Output

=================================== FAILURES ===================================
_______________________________ test_dqd_current _______________________________
    def test_dqd_current():
        "Counting statistics: current and current noise in a DQD model"
    
        G = 0
        L = 1
        R = 2
    
        sz = qutip.projection(3, L, L) - qutip.projection(3, R, R)
        sx = qutip.projection(3, L, R) + qutip.projection(3, R, L)
        sR = qutip.projection(3, G, R)
        sL = qutip.projection(3, G, L)
    
        w0 = 1
        tc = 0.6 * w0
        GammaR = 0.0075 * w0
        GammaL = 0.0075 * w0
        nth = 0.00
        eps_vec = np.linspace(-1.5*w0, 1.5*w0, 20)
    
        J_ops = [GammaR * qutip.sprepost(sR, sR.dag())]
    
        c_ops = [np.sqrt(GammaR * (1 + nth)) * sR,
                 np.sqrt(GammaR * (nth)) * sR.dag(),
                 np.sqrt(GammaL * (nth)) * sL,
                 np.sqrt(GammaL * (1 + nth)) * sL.dag()]
    
        current = np.zeros(len(eps_vec))
        noise = np.zeros(len(eps_vec))
    
        for n, eps in enumerate(eps_vec):
            H = (eps/2 * sz + tc * sx)
            L = qutip.liouvillian(H, c_ops)
            rhoss = qutip.steadystate(L)
            c_, n_ = qutip.countstat_current_noise(L, [], rhoss=rhoss, J_ops=J_ops)
            current[n] = c_[0]
            noise[n] = n_[0, 0, 0]
    
            current2 = qutip.countstat_current(L, rhoss=rhoss, J_ops=J_ops)
            assert abs(current[n] - current2) < 1e-8
    
            current2 = qutip.countstat_current(L, c_ops, J_ops=J_ops)
            assert abs(current[n] - current2) < 1e-8
    
        current_target = (tc**2 * GammaR
                          / (tc**2 * (2+GammaR/GammaL) + GammaR**2/4 + eps_vec**2))
        noise_target = current_target * (
            1 - (8*GammaL*tc**2*(4 * eps_vec**2 * (GammaR - GammaL)
                                 + GammaR*(3*GammaL*GammaR + GammaR**2 + 8*tc**2))
                 / (4*tc**2*(2*GammaL + GammaR) + GammaL*GammaR**2
                    + 4*eps_vec**2*GammaL)**2)
        )
    
        np.testing.assert_allclose(current, current_target, atol=1e-4)
>       np.testing.assert_allclose(noise, noise_target, atol=1e-4)
/nix/store/7v2yn16c9sr8ysdpan9yd2a60a1sizv7-python3.11-qutip-4.7.5/lib/python3.11/site-packages/qutip/tests/test_countstat.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
args = (<function assert_allclose.<locals>.compare at 0xfffeb718f880>, array([0.0007729 , 0.00087857, 0.00099616, 0.00112145,...9, 0.00142197, 0.00144314, 0.00142247, 0.00135199,
       0.0012452 , 0.00112145, 0.00099616, 0.00087857, 0.0007729 ]))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-07, atol=0.0001', 'verbose': True}
    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Not equal to tolerance rtol=1e-07, atol=0.0001
E           
E           Mismatched elements: 1 / 20 (5%)
E           Max absolute difference: 0.00035163
E           Max relative difference: 0.26008554
E            x: array([0.000773, 0.000879, 0.000996, 0.001121, 0.001245, 0.001352,
E                  0.001422, 0.001443, 0.001422, 0.001393, 0.001393, 0.001422,
E                  0.001443, 0.001422, 0.001704, 0.001245, 0.001121, 0.000996,
E                  0.000879, 0.000773])
E            y: array([0.000773, 0.000879, 0.000996, 0.001121, 0.001245, 0.001352,
E                  0.001422, 0.001443, 0.001422, 0.001393, 0.001393, 0.001422,
E                  0.001443, 0.001422, 0.001352, 0.001245, 0.001121, 0.000996,
E                  0.000879, 0.000773])
/nix/store/dz8lm4h0ivibad5kfc0ya3p3zqyd2fyf-python3-3.11.7/lib/python3.11/contextlib.py:81: AssertionError
=========================== short test summary info ============================
FAILED ../tests/test_countstat.py::test_dqd_current - AssertionError:

Expected Behaviour

unit test succeeds

Your Environment

QuTiP Version:      4.7.5
Numpy Version:      1.26.2
Scipy Version:      1.12.0
Cython Version:     0.29.36
Matplotlib Version: 3.8.2
Python Version:     3.11.7
Number of CPUs:     80
BLAS Info:          Generic
OPENMP Installed:   True
INTEL MKL Ext:      False
Platform Info:      Linux (aarch64)

Additional Context

No response

@Ericgig
Copy link
Member

Ericgig commented Feb 5, 2024

Thank you for reporting.

However I am unable to reproduce it (on ubuntu, same scipy, numpy, cython, python3.11.5).
So I can't tell what went wrong or how to solve it...

@ghost
Copy link
Author

ghost commented Feb 5, 2024

on aarch64 linux? same test passes on x64 linux and x64 / aarch64 darwin.

@Ericgig
Copy link
Member

Ericgig commented Feb 5, 2024

On x64, I had arch Linux in mind...

I don't have a setup to test on aarch64, nor ever tried to emulate it.
It may take some time.

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

No branches or pull requests

1 participant