Compare commits
	
		
			4 Commits
		
	
	
		
			00043637e9
			...
			fix/nojump
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 9ff3badab1 | ||
|  | 492098fe01 | ||
| 65ac6e9143 | |||
|  | 4047db209c | 
| @@ -182,10 +182,10 @@ def tetrahedral_order( | |||||||
|     ) |     ) | ||||||
|  |  | ||||||
|     # Connection vectors |     # Connection vectors | ||||||
|     neighbors_1 -= atoms |     neighbors_1 = pbc_diff(neighbors_1, atoms, box=atoms.box) | ||||||
|     neighbors_2 -= atoms |     neighbors_2 = pbc_diff(neighbors_2, atoms, box=atoms.box) | ||||||
|     neighbors_3 -= atoms |     neighbors_3 = pbc_diff(neighbors_3, atoms, box=atoms.box) | ||||||
|     neighbors_4 -= atoms |     neighbors_4 = pbc_diff(neighbors_4, atoms, box=atoms.box) | ||||||
|  |  | ||||||
|     # Normed Connection vectors |     # Normed Connection vectors | ||||||
|     neighbors_1 /= np.linalg.norm(neighbors_1, axis=-1).reshape(-1, 1) |     neighbors_1 /= np.linalg.norm(neighbors_1, axis=-1).reshape(-1, 1) | ||||||
|   | |||||||
| @@ -149,32 +149,21 @@ def nojump(frame: CoordinateFrame, usecache: bool = True) -> CoordinateFrame: | |||||||
|             i0 = 0 |             i0 = 0 | ||||||
|             delta = 0 |             delta = 0 | ||||||
|  |  | ||||||
|         delta = ( |         delta = (delta | ||||||
|             delta |             + np.vstack( | ||||||
|             + np.array( |  | ||||||
|                 np.vstack( |  | ||||||
|                 [m[i0 : abstep + 1].sum(axis=0) for m in reader.nojump_matrices] |                 [m[i0 : abstep + 1].sum(axis=0) for m in reader.nojump_matrices] | ||||||
|                 ).T |             ).T) | ||||||
|             ) |  | ||||||
|             @ frame.box |  | ||||||
|         ) |  | ||||||
|  |  | ||||||
|         reader._nojump_cache[abstep] = delta |         reader._nojump_cache[abstep] = delta | ||||||
|         while len(reader._nojump_cache) > NOJUMP_CACHESIZE: |         while len(reader._nojump_cache) > NOJUMP_CACHESIZE: | ||||||
|             reader._nojump_cache.popitem(last=False) |             reader._nojump_cache.popitem(last=False) | ||||||
|         delta = delta[selection, :] |  | ||||||
|     else: |     else: | ||||||
|         delta = ( |         delta = np.vstack( | ||||||
|             np.array( |                 [m[: frame.step + 1, selection].sum(axis=0) for m in reader.nojump_matrices] | ||||||
|                 np.vstack( |  | ||||||
|                     [ |  | ||||||
|                         m[: frame.step + 1, selection].sum(axis=0) |  | ||||||
|                         for m in reader.nojump_matrices |  | ||||||
|                     ] |  | ||||||
|                 ).T |                 ).T | ||||||
|             ) |      | ||||||
|             @ frame.box |     delta = delta[selection, :] | ||||||
|         ) |     delta = np.array(delta @ frame.box) | ||||||
|     return frame - delta |     return frame - delta | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user