14cd2551a18a2c098a7342d47d5f0b81f8eb8eb5,qucumber/nn_states/positive_wavefunction.py,PositiveWavefunction,phase,#PositiveWavefunction#Any#,84

Before Change


        :returns: Matrix/vector containing the phases of v
        :rtype: torch.Tensor
        
        return torch.zeros(v.shape[0]).to(v)

    def psi(self, v):
        rCompute the (unnormalized) wavefunction of a given vector/matrix of visible states.

After Change


        :returns: Matrix/vector containing the phases of v
        :rtype: torch.Tensor
        
        if v.dim() == 1:
            v = v.unsqueeze(0)
            unsqueezed = True
        else:
            unsqueezed = False

        phase = torch.zeros(v.shape[0])

        if unsqueezed:
            return phase.squeeze_(0)
        else:
            return phase

    def psi(self, v):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: PIQuIL/QuCumber
Commit Name: 14cd2551a18a2c098a7342d47d5f0b81f8eb8eb5
Time: 2018-08-19
Author: emerali@users.noreply.github.com
File Name: qucumber/nn_states/positive_wavefunction.py
Class Name: PositiveWavefunction
Method Name: phase


Project Name: pyprob/pyprob
Commit Name: 97a8cd3417c9c3a79ade5ca97fc85543c4c2f1c9
Time: 2018-02-22
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/distributions.py
Class Name: Distribution
Method Name: sample


Project Name: pyprob/pyprob
Commit Name: 97a8cd3417c9c3a79ade5ca97fc85543c4c2f1c9
Time: 2018-02-22
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/distributions.py
Class Name: Distribution
Method Name: log_prob