db073909d05ae6f91b7abd8d6251bfa247349447,qucumber/utils/cplx.py,,conjugate,#,226

Before Change


        z[1] = -x[1]

    if x.dim() == 3:
        z = torch.zeros(2, x.size()[2], x.size()[1], dtype=x.dtype, device=x.device)
        z[0] = torch.transpose(x[0], 0, 1)
        z[1] = -torch.transpose(x[1], 0, 1)

    return z


def elementwise_mult(x, y):
    Alias for :func:`scalar_mult`.

After Change


    if x.dim() < 3:
        return conj(x)
    else:
        return make_complex(
            torch.transpose(real(x), 0, 1), -torch.transpose(imag(x), 0, 1)
        )


def conj(x):
    Returns the element-wise complex conjugate of the argument.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: PIQuIL/QuCumber
Commit Name: db073909d05ae6f91b7abd8d6251bfa247349447
Time: 2019-12-31
Author: emerali@users.noreply.github.com
File Name: qucumber/utils/cplx.py
Class Name:
Method Name: conjugate


Project Name: PIQuIL/QuCumber
Commit Name: f1afb5df71893ff2770c7cc7ca83d2ac68f977d7
Time: 2019-12-28
Author: emerali@users.noreply.github.com
File Name: tests/test_observables.py
Class Name: MockWaveFunction
Method Name: psi


Project Name: PIQuIL/QuCumber
Commit Name: 10bdd46d76d35cfba3a484b007ea3e14af801813
Time: 2019-12-09
Author: emerali@users.noreply.github.com
File Name: qucumber/nn_states/positive_wavefunction.py
Class Name: PositiveWaveFunction
Method Name: psi