Exemple #1
0
    def predict_E(self, structure):
        energy = torch.zeros(1).double()

        for count in range(len(structure.species)):
            environment = ace.LocalEnvironment(structure, count, self.cutoff)
            energy += self.predict_local_E(environment)

        return energy
Exemple #2
0
    def predict_EFS(self, structure):
        noa = len(structure.species)
        efs_tens = torch.zeros(1 + 3 * noa + 6).double()

        for count in range(noa):
            environment = ace.LocalEnvironment(structure, count, self.cutoff)
            efs_tens += self.predict_local_EFS(environment)

        return efs_tens
Exemple #3
0
    def predict_F(self, structure):
        noa = len(structure.species)
        f_tens = torch.zeros(3 * noa).double()

        for count in range(noa):
            environment = ace.LocalEnvironment(structure, count, self.cutoff)
            f_tens += self.predict_local_F(environment)

        return f_tens
Exemple #4
0
    def predict_EF(self, structure):
        # Initialize energy/force tensor.
        noa = len(structure.species)
        ef_tens = torch.zeros(1 + 3 * noa).double()

        for count in range(noa):
            environment = ace.LocalEnvironment(structure, count, self.cutoff)
            ef_tens += self.predict_local_EF(environment)

        return ef_tens
Exemple #5
0
                      [-2.01399916, 1.26567364, -0.34566542],
                      [-1.24917847, 0.11058142, -0.35152255],
                      [-0.26895874, -1.24669592, 3.20771389],
                      [2.65635959, -1.73157442, 0.26207606],
                      [-0.27368027, 1.27614842, -2.37945504],
                      [3.57300086, -0.82058207, -1.6675233],
                      [2.19445749, 0.74663571, -3.1649488],
                      [-3.6649996, 1.36982664, 0.68209262],
                      [-3.84709602, 1.91009051, -0.95156392],
                      [-3.87331649, 0.10910619, -0.56318171]])

noa = len(positions)
test_struc = ace.Structure(cell, coded_species, positions)

cutoff = 7.
test_env = ace.LocalEnvironment(test_struc, 0, cutoff)

radial_basis = "chebyshev"
cutoff_function = "cosine"
radial_hyps = [0, cutoff]
cutoff_hyps = []
nos = 3
N = 2
lmax = 1
descriptor_settings = [nos, N, lmax]
descriptor = \
    ace.DescriptorCalculator(radial_basis, cutoff_function, radial_hyps,
                             cutoff_hyps, descriptor_settings)

descriptor.compute_B2(test_env)