Double Well Potential¶
- class symdet.data.double_well_potential.DoubleWellPotential(a: float = 2.3)[source]¶
Class for the double well potential implementation.
- a¶
Scaling factor in the equation (see below)
- Type
float
Examples
>>> from symdet import DoubleWellPotential >>> generator = DoubleWellPotential() >>> generator.load_data() >>> generator.plot_data()
Notes
The double well potential is written mathematically:
\[V = -a \cdot (x^{2} + y^{2}) + (x^{2} + y^{2})^{2}\]We will require the data to be stored as x,y coordinates in order to facilitate the generator extraction in this part of the process.
Methods
build_clusters([value_range, bin_operation, ...])Split the raw function data into classes.
load_data(points[, save])Load / generate the data.
plot_clusters([save])Plot the clusters generated.
plot_data([save, show])Plot the data.
- build_clusters(value_range: Optional[list] = None, bin_operation: Optional[list] = None, representatives=1000)[source]¶
Split the raw function data into classes.
- Parameters
representatives (int) – Number of class representatives to have for each bin.
value_range (list) – The parameters within which to bin e.g. k in [-5, 5]
bin_operation (list) – Operation to apply to the bins e.g [1/5, 1e-3] will lead to bins of the form [k/5 - 1e-3, k/5 + 1e-3]
- Return type
Updates the class state.
Notes
In the double well potential we can simply use the range_binning clustering algorithm.
- load_data(points: Union[int, ndarray], save: bool = False)[source]¶
Load / generate the data.
- Parameters
points (Union[int, np.ndarray]) – Points to generate, either an np.ndarray or an integer. If an integer, N points will be generated, if an array, it will either be treated as input to a function to generate values or those indices will be drawn from a pool.
save (bool) – If true, save the data after generating it.
- Return type
Updates the class state.