Todos
This commit is contained in:
		
							parent
							
								
									a3d4d8a2c6
								
							
						
					
					
						commit
						cdf9e3104f
					
				@ -19,7 +19,8 @@ class State:
 | 
				
			|||||||
    return energy(self.positions())
 | 
					    return energy(self.positions())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def minimize(self) -> None:
 | 
					  def minimize(self) -> None:
 | 
				
			||||||
    res = minimize(energy, self.positions(), method='L-BFGS-B', bounds=Bounds(0,self.size), jac='3-point')
 | 
					    # report with jax gradient
 | 
				
			||||||
 | 
					    res = minimize(energy, self.positions(), method='CG', jac='3-point')
 | 
				
			||||||
    min = res.x
 | 
					    min = res.x
 | 
				
			||||||
    min = np.matrix(min)
 | 
					    min = np.matrix(min)
 | 
				
			||||||
    min.shape = (self.count,3)
 | 
					    min.shape = (self.count,3)
 | 
				
			||||||
@ -75,6 +76,7 @@ def distances(P):
 | 
				
			|||||||
  XYZ = abs(XYZ)
 | 
					  XYZ = abs(XYZ)
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  # nearest image convention
 | 
					  # nearest image convention
 | 
				
			||||||
 | 
					  # replace with modulo
 | 
				
			||||||
  XYZ = XYZ.at[XYZ > 0.5].add(-0.5)
 | 
					  XYZ = XYZ.at[XYZ > 0.5].add(-0.5)
 | 
				
			||||||
  XYZ = XYZ**2
 | 
					  XYZ = XYZ**2
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user