Exemple #1
0
def reduced_coordinates_displace(stepsize,
                                 lattice_matrix,
                                 coords,
                                 indices=None):
    """uniform random displacement of reduced coordinates

    Parameters
    ----------
    coords : array like x(:,3)
       coordinates
    indices : list, optional
       list of coordinates to displace, None for all coordinates in array

    """
    coords = coords.reshape(-1, 3)
    ilattice = vec3.invert3x3(lattice_matrix)  # inverse_lattice
    if indices is not None:
        for i in indices:
            coords[i] += np.dot(
                ilattice,
                stepsize * rotations.vector_random_uniform_hypersphere(3))
        return

    for x in coords:
        x += np.dot(ilattice,
                    stepsize * rotations.vector_random_uniform_hypersphere(3))
Exemple #2
0
def uniform_displace(stepsize, coords, indices=None):
    """uniform random displacement

    Parameters
    ----------
    coords : array like x(:,3)
       coordinates
    indices : list, optional
       list of coordinates to displace, None for all coordinates in array
    """
    if indices:
        for i in indices:
            coords[i] += stepsize * rotations.vector_random_uniform_hypersphere(3)
        return

    for x in coords:
        x += stepsize * rotations.vector_random_uniform_hypersphere(3)
Exemple #3
0
def uniform_displace(stepsize, coords, indices=None):
    """uniform random displacement

    Parameters
    ----------
    coords : array like x(:,3)
       coordinates
    indices : list, optional
       list of coordinates to displace, None for all coordinates in array
    """
    if indices:
        for i in indices:
            coords[
                i] += stepsize * rotations.vector_random_uniform_hypersphere(3)
        return

    for x in coords:
        x += stepsize * rotations.vector_random_uniform_hypersphere(3)
Exemple #4
0
def reduced_coordinates_displace(stepsize, lattice_matrix, coords, indices=None):
    """uniform random displacement of reduced coordinates

    Parameters
    ----------
    coords : array like x(:,3)
       coordinates
    indices : list, optional
       list of coordinates to displace, None for all coordinates in array

    """
    ilattice = vec3.invert3x3(lattice_matrix)  # inverse_lattice
    if indices:
        for i in indices:
            coords[i] += np.dot(ilattice, stepsize * rotations.vector_random_uniform_hypersphere(3))
        return

    for x in coords:
        x += np.dot(ilattice, stepsize * rotations.vector_random_uniform_hypersphere(3))
Exemple #5
0
 def takeStep(self, coords, **kwargs):
     c = coords[self.srange]
     for x in c.reshape(old_div(c.size, 3), 3):
         x += self.stepsize * rotations.vector_random_uniform_hypersphere(3)
Exemple #6
0
 def takeStep(self, coords, **kwargs):
     c = coords[self.srange]        
     for x in c.reshape(c.size/3,3):
         x += self.stepsize * rotations.vector_random_uniform_hypersphere(3)