8c271d54da8f609c9b56e9d0ab98d453b3e4f81c,tensorly/metrics/tests/test_entropy.py,,test_vonNeumann_entropy_mixed_state_CP,#,32

Before Change



def test_vonNeumann_entropy_mixed_state_CP():
    mat = parafac(tl.tensor(mat_mixed), rank=2, normalize_factors=True)
    tl_vne = np.array(vonNeumann_entropy(mat))
    assert np.allclose(tl_vne, np.array([0.5545]), rtol=1e-03, atol=1e-03)

def test_vonNeumann_entropy_mixed_state_CP_unnormalized_factors():
    mat = parafac(tl.tensor(mat_mixed), rank=2, normalize_factors=True)

After Change


def test_vonNeumann_entropy_mixed_state_CP():
    mat = parafac(tl.tensor(mat_mixed), rank=2, normalize_factors=True)
    tl_vne = cp_vonneumann_entropy(mat)
    tl.testing.assert_array_almost_equal(tl_vne, actual_vne, decimal=3)

def test_vonNeumann_entropy_mixed_state_CP_unnormalized_factors():
    mat = parafac(tl.tensor(mat_mixed), rank=2, normalize_factors=False)
    tl_vne = cp_vonneumann_entropy(mat)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 3

Instances


Project Name: tensorly/tensorly
Commit Name: 8c271d54da8f609c9b56e9d0ab98d453b3e4f81c
Time: 2021-03-08
Author: taylorpatti@g.harvard.edu
File Name: tensorly/metrics/tests/test_entropy.py
Class Name:
Method Name: test_vonNeumann_entropy_mixed_state_CP


Project Name: tensorly/tensorly
Commit Name: 8c271d54da8f609c9b56e9d0ab98d453b3e4f81c
Time: 2021-03-08
Author: taylorpatti@g.harvard.edu
File Name: tensorly/metrics/tests/test_entropy.py
Class Name:
Method Name: test_vonNeumann_entropy_mixed_state_CP_unnormalized_factors


Project Name: tensorly/tensorly
Commit Name: 8c271d54da8f609c9b56e9d0ab98d453b3e4f81c
Time: 2021-03-08
Author: taylorpatti@g.harvard.edu
File Name: tensorly/metrics/tests/test_entropy.py
Class Name:
Method Name: test_vonNeumann_entropy_mixed_state


Project Name: tensorly/tensorly
Commit Name: 8c271d54da8f609c9b56e9d0ab98d453b3e4f81c
Time: 2021-03-08
Author: taylorpatti@g.harvard.edu
File Name: tensorly/metrics/tests/test_entropy.py
Class Name:
Method Name: test_vonNeumann_entropy_pure_state_CP


Project Name: tensorly/tensorly
Commit Name: 8c271d54da8f609c9b56e9d0ab98d453b3e4f81c
Time: 2021-03-08
Author: taylorpatti@g.harvard.edu
File Name: tensorly/metrics/tests/test_entropy.py
Class Name:
Method Name: test_vonNeumann_entropy_pure_state