diff --git a/docs/reference/beignet.datasets.md b/docs/reference/beignet.datasets.md index 19ea16585e..fa330754c8 100644 --- a/docs/reference/beignet.datasets.md +++ b/docs/reference/beignet.datasets.md @@ -39,7 +39,6 @@ ::: beignet.datasets.MartinsBloodBrainBarrierDataset ::: beignet.datasets.NCATSPAMPAPermeabilityDataset ::: beignet.datasets.ObachHalfLifeDataset -::: beignet.datasets.PDB70Dataset ::: beignet.datasets.PDBTrajectoryDataset ::: beignet.datasets.PDBbindDataset ::: beignet.datasets.ParquetDataset diff --git a/docs/reference/datasets/sequences.md b/docs/reference/datasets/sequences.md index a9865cdd66..c77a4d8d22 100644 --- a/docs/reference/datasets/sequences.md +++ b/docs/reference/datasets/sequences.md @@ -8,7 +8,6 @@ ::: beignet.datasets.FreeSolvDataset ::: beignet.datasets.GDSC1Dataset ::: beignet.datasets.GDSC2Dataset -::: beignet.datasets.PDB70Dataset ::: beignet.datasets.PDBbindDataset ::: beignet.datasets.REALDatabaseDataset ::: beignet.datasets.SKEMPIDataset diff --git a/docs/reference/operators/interatomic-potentials.md b/docs/reference/operators/interatomic-potentials.md index 90d9f71356..90fbd3ef99 100644 --- a/docs/reference/operators/interatomic-potentials.md +++ b/docs/reference/operators/interatomic-potentials.md @@ -1 +1,2 @@ ::: beignet.lennard_jones_potential +::: beignet.morse_potential diff --git a/docs/reference/operators/thermodynamics.md b/docs/reference/operators/thermodynamics.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mkdocs.yml b/mkdocs.yml index 6e0d7a6ae2..e0b474ca2a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,7 +34,6 @@ nav: - "Probabilists’ Hermite polynomial": "reference/operators/special-functions/orthogonal-polynomials/probabilists-hermite-polynomial.md" - "Laguerre polynomial": "reference/operators/special-functions/orthogonal-polynomials/laguerre-polynomial.md" - "Legendre polynomial": "reference/operators/special-functions/orthogonal-polynomials/legendre-polynomial.md" - - "Thermodynamics": "reference/operators/thermodynamics.md" - "beignet.datasets": "reference/beignet.datasets.md" - "beignet.features": - "General-purpose": "reference/features/general-purpose.md" diff --git a/src/beignet/__init__.py b/src/beignet/__init__.py index fe3fd28ca7..b072ffbf76 100644 --- a/src/beignet/__init__.py +++ b/src/beignet/__init__.py @@ -194,6 +194,7 @@ from ._linear_probabilists_hermite_polynomial import ( linear_probabilists_hermite_polynomial, ) +from ._morse_potential import morse_potential from ._multiply_chebyshev_polynomial import multiply_chebyshev_polynomial from ._multiply_chebyshev_polynomial_by_x import multiply_chebyshev_polynomial_by_x from ._multiply_laguerre_polynomial import multiply_laguerre_polynomial @@ -370,14 +371,9 @@ "apply_rotation_matrix", "apply_rotation_vector", "apply_transform", - "evaluate_chebyshev_polynomial_cartesian_2d", - "evaluate_chebyshev_polynomial_cartesian_3d", - "chebyshev_interpolation", - "linear_chebyshev_polynomial", - "multiply_chebyshev_polynomial_by_x", - "chebyshev_zeros", "chebyshev_extrema", "chebyshev_gauss_quadrature", + "chebyshev_interpolation", "chebyshev_polynomial_companion", "chebyshev_polynomial_domain", "chebyshev_polynomial_from_roots", @@ -391,6 +387,7 @@ "chebyshev_polynomial_weight", "chebyshev_polynomial_x", "chebyshev_polynomial_zero", + "chebyshev_zeros", "compose_euler_angle", "compose_quaternion", "compose_rotation_matrix", @@ -416,22 +413,34 @@ "evaluate_chebyshev_polynomial", "evaluate_chebyshev_polynomial_2d", "evaluate_chebyshev_polynomial_3d", + "evaluate_chebyshev_polynomial_cartesian_2d", + "evaluate_chebyshev_polynomial_cartesian_3d", "evaluate_laguerre_polynomial", "evaluate_laguerre_polynomial_2d", "evaluate_laguerre_polynomial_3d", + "evaluate_laguerre_polynomial_cartesian_2d", + "evaluate_laguerre_polynomial_cartesian_3d", "evaluate_legendre_polynomial", "evaluate_legendre_polynomial_2d", "evaluate_legendre_polynomial_3d", + "evaluate_legendre_polynomial_cartesian_2d", + "evaluate_legendre_polynomial_cartesian_3d", "evaluate_physicists_hermite_polynomial", "evaluate_physicists_hermite_polynomial_2d", "evaluate_physicists_hermite_polynomial_3d", + "evaluate_physicists_hermite_polynomial_cartesian_2d", + "evaluate_physicists_hermite_polynomial_cartesian_3d", "evaluate_polynomial", "evaluate_polynomial_2d", "evaluate_polynomial_3d", + "evaluate_polynomial_cartesian_2d", + "evaluate_polynomial_cartesian_3d", "evaluate_polynomial_from_roots", "evaluate_probabilists_hermite_polynomial", "evaluate_probabilists_hermite_polynomial_2d", "evaluate_probabilists_hermite_polynomial_3d", + "evaluate_probabilists_hermite_polynomial_cartersian_2d", + "evaluate_probabilists_hermite_polynomial_cartersian_3d", "farthest_first_traversal", "fit_chebyshev_polynomial", "fit_laguerre_polynomial", @@ -443,14 +452,6 @@ "gauss_legendre_quadrature", "gauss_physicists_hermite_polynomial_quadrature", "gauss_probabilists_hermite_polynomial_quadrature", - "evaluate_probabilists_hermite_polynomial_cartersian_2d", - "evaluate_probabilists_hermite_polynomial_cartersian_3d", - "linear_probabilists_hermite_polynomial", - "multiply_probabilists_hermite_polynomial_by_x", - "evaluate_physicists_hermite_polynomial_cartesian_2d", - "evaluate_physicists_hermite_polynomial_cartesian_3d", - "linear_physicists_hermite_polynomial", - "multiply_physicists_hermite_polynomial_by_x", "integrate_chebyshev_polynomial", "integrate_laguerre_polynomial", "integrate_legendre_polynomial", @@ -462,10 +463,6 @@ "invert_rotation_matrix", "invert_rotation_vector", "invert_transform", - "evaluate_laguerre_polynomial_cartesian_2d", - "evaluate_laguerre_polynomial_cartesian_3d", - "linear_laguerre_polynomial", - "multiply_laguerre_polynomial_by_x", "laguerre_polynomial_companion", "laguerre_polynomial_domain", "laguerre_polynomial_from_roots", @@ -492,17 +489,26 @@ "legendre_polynomial_weight", "legendre_polynomial_x", "legendre_polynomial_zero", - "evaluate_legendre_polynomial_cartesian_2d", - "evaluate_legendre_polynomial_cartesian_3d", - "linear_legendre_polynomial", - "multiply_legendre_polynomial_by_x", "lennard_jones_potential", + "linear_chebyshev_polynomial", + "linear_laguerre_polynomial", + "linear_legendre_polynomial", + "linear_physicists_hermite_polynomial", + "linear_polynomial", + "linear_probabilists_hermite_polynomial", + "morse_potential", "multiply_chebyshev_polynomial", + "multiply_chebyshev_polynomial_by_x", "multiply_laguerre_polynomial", + "multiply_laguerre_polynomial_by_x", "multiply_legendre_polynomial", + "multiply_legendre_polynomial_by_x", "multiply_physicists_hermite_polynomial", + "multiply_physicists_hermite_polynomial_by_x", "multiply_polynomial", + "multiply_polynomial_by_x", "multiply_probabilists_hermite_polynomial", + "multiply_probabilists_hermite_polynomial_by_x", "physicists_hermite_polynomial_companion", "physicists_hermite_polynomial_domain", "physicists_hermite_polynomial_from_roots", @@ -516,10 +522,6 @@ "physicists_hermite_polynomial_weight", "physicists_hermite_polynomial_x", "physicists_hermite_polynomial_zero", - "evaluate_polynomial_cartesian_2d", - "evaluate_polynomial_cartesian_3d", - "linear_polynomial", - "multiply_polynomial_by_x", "polynomial_companion", "polynomial_domain", "polynomial_from_roots", diff --git a/src/beignet/_morse_potential.py b/src/beignet/_morse_potential.py new file mode 100644 index 0000000000..4612511a55 --- /dev/null +++ b/src/beignet/_morse_potential.py @@ -0,0 +1,46 @@ +import torch +from torch import Tensor + + +def morse_potential( + input: Tensor, + sigma: Tensor | None = 1.0, + epsilon: Tensor | None = 5.0, + alpha: Tensor | None = 5.0, + **_, +) -> Tensor: + """ + Morse interaction between particles with a minimum at `sigma`. + + Parameters + ---------- + input : Tensor, shape=[n, m] + Pairwise distances between particles. + + sigma : Tensor, optional + Distance between particles where the energy has a minimum. Should + either be a floating-point scalar or a Tensor of shape `[n, m]`. + + epsilon : Tensor, optional + Interaction energy scale. Should either be a floating-point scalar or + a Tensor of shape `[n, m]`. + + alpha : Tensor, optional + Range parameter. Should either be a floating-point scalar or a Tensor + of shape `[n, m]`. + + Returns + ------- + output : Tensor, shape=[n, m] + Energies. + """ + if sigma is None: + sigma = torch.tensor(1.0, dtype=input.dtype) + + if epsilon is None: + epsilon = torch.tensor(5.0, dtype=input.dtype) + + if alpha is None: + alpha = torch.tensor(5.0, dtype=input.dtype) + + return epsilon * (1.0 - torch.exp(-alpha * (input - sigma))) ** 2.0 - epsilon