4e26df090dbb8ebdb371301b9fa4deccf799ed80,qucumber/utils/test_cplx.py,TestCplx,test_kronecker_prod,#TestCplx#,90
Before Change
matrix = torch.tensor([ [[1,2],[3,4]], [[5,6],[7,8]] ],
dtype = torch.double)
result = torch.sum(cplx.kronecker_prod(matrix, matrix) -
torch.tensor([ [[-24,-28,-28,-32],[-32,-36,-36,-40],
[-32,-36,-36,-40],[-40,-44,-44,-48]],
[[10,16,16,24],[22,28,32,40],[22,32,28,40],
[42,52,52,64]] ], dtype = torch.double)).item()
self.assertEqual(result, 0.0)
def test_scalar_divide(self):
After Change
[42,52,52,64]] ], dtype = torch.double)
result = 0.0
for i in range(2):
for j in range(list(expect.size())[1]):
for k in range(list(expect.size())[2]):
result = (cplx.kronecker_prod(matrix, matrix)[i][j][k] -
expect[i][j][k]).item()
self.assertEqual(result, 0.0)
def test_scalar_divide(self):
scalar = torch.tensor([1,2], dtype = torch.double)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 27
Instances
Project Name: PIQuIL/QuCumber
Commit Name: 4e26df090dbb8ebdb371301b9fa4deccf799ed80
Time: 2018-08-02
Author: ijsdevlu@edu.uwaterloo.ca
File Name: qucumber/utils/test_cplx.py
Class Name: TestCplx
Method Name: test_kronecker_prod
Project Name: PIQuIL/QuCumber
Commit Name: 4e26df090dbb8ebdb371301b9fa4deccf799ed80
Time: 2018-08-02
Author: ijsdevlu@edu.uwaterloo.ca
File Name: qucumber/utils/test_cplx.py
Class Name: TestCplx
Method Name: test_outer_prod
Project Name: PIQuIL/QuCumber
Commit Name: 4e26df090dbb8ebdb371301b9fa4deccf799ed80
Time: 2018-08-02
Author: ijsdevlu@edu.uwaterloo.ca
File Name: qucumber/utils/test_cplx.py
Class Name: TestCplx
Method Name: test_kronecker_prod
Project Name: PIQuIL/QuCumber
Commit Name: 4e26df090dbb8ebdb371301b9fa4deccf799ed80
Time: 2018-08-02
Author: ijsdevlu@edu.uwaterloo.ca
File Name: qucumber/utils/test_cplx.py
Class Name: TestCplx
Method Name: test_make_complex