Ejemplo n.º 1
0
 def draw(self, coords, index):
     if self.one_frozen:
         coords = self.coords_converter.get_full_coords(coords)
     d = .4
     r = .04
     nspins = old_div(coords.size, 2)
     com = sum(self.node2xyz(node) for node in self.pot.G.nodes())
     com /= nspins
     coords = coords.reshape([-1,2])
     for node in self.pot.G.nodes():
         xyz = self.node2xyz(node)
         spin2 = coords[self.pot.indices[node],:]
         spin3 = hs.make3dVector(spin2)
         x1 = xyz - 0.5 * spin3 * d - com
         x2 = xyz + 0.5 * spin3 * d - com
         draw_cone(x1, x2, rbase=r)
Ejemplo n.º 2
0
 def draw(self, coords, index):
     if self.one_frozen:
         coords = self.coords_converter.get_full_coords(coords)
     d = .4
     r = .04
     nspins = coords.size / 2
     com = sum(self.node2xyz(node) for node in self.pot.G.nodes())
     com /= nspins
     coords = coords.reshape([-1,2])
     for node in self.pot.G.nodes():
         xyz = self.node2xyz(node)
         spin2 = coords[self.pot.indices[node],:]
         spin3 = hs.make3dVector(spin2)
         x1 = xyz - 0.5 * spin3 * d - com
         x2 = xyz + 0.5 * spin3 * d - com
         draw_cone(x1, x2, rbase=r)
Ejemplo n.º 3
0
def normalize_2dspins(coords):
    """there is probably a better way to do this."""
    return hs.make2dVector(hs.make3dVector(coords))
Ejemplo n.º 4
0
def normalize_2dspins(coords):
    """there is probably a better way to do this."""
    return hs.make2dVector(hs.make3dVector(coords))