def read_db(self,minimum):
     '''Read structure from Pele minimum'''
     cluster=Cluster(self.natoms,
                     np.reshape(minimum.coords,(-1,3)),
                     self.minimiser,
                     atom_types=get_atom_types(self.composition),
                     labels=self.labels)
     cluster.energy=minimum.energy
     cluster.quenched=True
     return cluster
 def get_random_cluster(self):
     '''Return a cluster with random coordinates'''
     coords=(np.random.rand(self.natoms,3) -0.5) * 1.4 * float(self.natoms)**(1./3.)
     cluster = Cluster(self.natoms,
                       coords,
                       self.minimiser,
                       atom_types=get_atom_types(self.composition),
                       labels=self.labels)
     cluster.quenched=False
     return cluster
Exemple #3
0
 def read_db(self, minimum):
     '''Read structure from Pele minimum'''
     cluster = Cluster(self.natoms,
                       np.reshape(minimum.coords, (-1, 3)),
                       self.minimiser,
                       atom_types=get_atom_types(self.composition),
                       labels=self.labels)
     cluster.energy = minimum.energy
     cluster.quenched = True
     return cluster
Exemple #4
0
 def get_random_cluster(self):
     '''Return a cluster with random coordinates'''
     coords = (np.random.rand(self.natoms, 3) - 0.5) * 1.4 * float(
         self.natoms)**(1. / 3.)
     cluster = Cluster(self.natoms,
                       coords,
                       self.minimiser,
                       atom_types=get_atom_types(self.composition),
                       labels=self.labels)
     cluster.quenched = False
     return cluster
 def read_xyz(self,xyz_file):
     '''Read structure from xyz file.'''
     natoms=int(xyz_file.readline())
     coords=np.empty(shape=(natoms,3))
     energy=float(xyz_file.readline().split()[1])
     for i in range(0,natoms):
         coords[i]=xyz_file.readline().split()[1:4]
     cluster=Cluster(natoms,
                     coords,
                     self.minimiser,
                     atom_types=get_atom_types(self.composition),
                     labels=self.labels)
     cluster.energy=energy
     cluster.quenched=True
     return cluster
Exemple #6
0
 def read_xyz(self, xyz_file):
     '''Read structure from xyz file.'''
     natoms = int(xyz_file.readline())
     coords = np.empty(shape=(natoms, 3))
     energy = float(xyz_file.readline().split()[1])
     for i in range(0, natoms):
         coords[i] = xyz_file.readline().split()[1:4]
     cluster = Cluster(natoms,
                       coords,
                       self.minimiser,
                       atom_types=get_atom_types(self.composition),
                       labels=self.labels)
     cluster.energy = energy
     cluster.quenched = True
     return cluster