We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a8014b commit 878345aCopy full SHA for 878345a
docs/source/chapters/chapter1.rst
@@ -86,9 +86,11 @@ Copy the following lines into *potentials.py*:
86
return 4 * epsilon * ((sigma / r) ** 12 - (sigma / r) ** 6)
87
elif potential_type == "Hard-Sphere":
88
if derivative:
89
- raise ValueError("Derivative is not defined for Hard-Sphere potential.")
+ # Derivative is not defined for Hard-Sphere potential.
90
+ # --> return 0
91
+ return np.zeros(len(r))
92
else:
- return np.where(r < sigma, 0, 1000)
93
+ return np.where(r > sigma, 0, 1000)
94
95
raise ValueError(f"Unknown potential type: {potential_type}")
96
0 commit comments