57d419c21650c6bad57ba7ac6b3b14a219b16a3a,qucumber/complex_wavefunction.py,ComplexWavefunction,generate_hilbert_space,#ComplexWavefunction#Any#,227

Before Change


                                device=self.device, dtype=torch.double)
            for i in range(1 << size):
                d = i
                for j in range(size):
                    d, r = divmod(d, 2)
                    space[i, size - j - 1] = int(r)
            return space

    def compute_normalization(self):
        rCompute the normalization constant of the wavefunction.

After Change


        if (size > self.size_cut):
            raise ValueError("Size of the Hilbert space too large!")
        else:
            d = np.arange(2 ** size)
            space = (((d[:, None] & (1 << np.arange(size)))) > 0)[:, ::-1]
            space = space.astype(int)
            return torch.tensor(space, dtype=torch.double, device=self.device)

    def compute_normalization(self):
        rCompute the normalization constant of the wavefunction.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: PIQuIL/QuCumber
Commit Name: 57d419c21650c6bad57ba7ac6b3b14a219b16a3a
Time: 2018-08-09
Author: emerali@users.noreply.github.com
File Name: qucumber/complex_wavefunction.py
Class Name: ComplexWavefunction
Method Name: generate_hilbert_space


Project Name: dmlc/dgl
Commit Name: f5eb80d221fec8690e8cfb087256671545bb9a5a
Time: 2020-08-11
Author: coin2028@hotmail.com
File Name: examples/pytorch/graphsage/train_sampling_unsupervised.py
Class Name: SAGE
Method Name: inference


Project Name: PIQuIL/QuCumber
Commit Name: 57d419c21650c6bad57ba7ac6b3b14a219b16a3a
Time: 2018-08-09
Author: emerali@users.noreply.github.com
File Name: qucumber/positive_wavefunction.py
Class Name: PositiveWavefunction
Method Name: generate_hilbert_space