Repository: 1QB-Information-Technologies/ccvm (language: python)

Issue:
Adding Pumped Langevin dynamics solver in the CCVM Simulator
### Feature Description
**Please describe the feature you would like to see added:**

CCVM Simulator supports all of the equation of motions in the [CCVM paper](https://arxiv.org/pdf/2209.04415) except **pumped Langevin dynamics** defined by  $d c_i = \big[(-1 + p- c_i^2)c_i -\partial_i f(c)\big]dt + \sigma dW$ for $i=1,\ldots,N$. 
This equation is a modified version of Langevin equation which is recently [added](https://github.com/1QB-Information-Technologies/ccvm/issues/96#issue-1884294958) to the code base.

### Rationale
**Why is this feature important? What problem does it solve?**

We need to extend CCVM Simulator with _pumped Langevin solver_ in order to make it a complete benchmarking software tool for the [paper](https://arxiv.org/pdf/2209.04415).





Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index af7ce655..df423308 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,10 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Fixed issue where `s` was being updated incorrectly on each iteration  of `DLSolver._solve()`.
 
 ### Added
-- Implemented a simple gradient descent post-processing step, as described in the paper.
-  - Similar to Langevin dynamics but without noise.
-  - Implemented using the Euler method with box constraint imposition at each iteration.
-  - Designed to reflect the results outlined in the paper.
+- Added `PumpedLangevinSolver`, which is an extension of `LangevinSolver` to simulate pumped Langevin dynamics with a demo script in the examples directory.
+- Implemented a simple gradient descent post-processing step, as described in the paper, similar to Langevin dynamics but without noise; uses the Euler method with box constraint imposition at each iteration.
 
 ### Changed
 - Streamlined README by relocating and optimizing architecture diagrams.
diff --git a/ccvm_simulators/solvers/README.md b/ccvm_simulators/solvers/README.md
index e77eb93f..f67f645c 100644
--- a/ccvm_simulators/solvers/README.md
+++ b/ccvm_simulators/solvers/README.md
@@ -1,11 +1,16 @@
 # Solvers
 
 ### Solver classes
-There are currently two methods available for each solver class [DL-CCVM, MF-CCVM, Langevin] which are **original** (default) and **Adam**.
+There are currently two methods available for each solver class [DL-CCVM, MF-CCVM, Langevin, Pumped-Langevin] which are **original** (default) and **Adam**.
 
 - `dl_solver.py`: models the delay-line coherent continuous-variable machine (DL-CCVM).
 - `mf_solver.py`: models the measurement-feedback coherent continuous-variable machine (MF-CCVM).
 - `langevin_solver.py`: models typical Langevin dynamics as a system of stochastic differential equations (SDE).
+- `pumped_langevin_solver.py`: extends typical Langevin dynamics as a system of stochastic differential equations (SDE).
+Apart from Langevin dynamics, it augments additional drift terms: 
+    - a photon loss rate, `−1`
+    - the strength of the external pump field, `p` and 
+    - nonlinear term, `c**2_i` induced by a nonlinear crystal.
 
 #### The solver hierarchy 
 The diagram portrays the relationships among different solvers and their
diff --git a/ccvm_simulators/solvers/__init__.py b/ccvm_simulators/solvers/__init__.py
index 41c85c03..7222346c 100644
--- a/ccvm_simulators/solvers/__init__.py
+++ b/ccvm_simulators/solvers/__init__.py
@@ -2,3 +2,4 @@
 from .dl_solver import DLSolver
 from .mf_solver import MFSolver
 from .langevin_solver import LangevinSolver
+from .pumped_langevin_solver import PumpedLangevinSolver
diff --git a/ccvm_simulators/solvers/dl_solver.py b/ccvm_simulators/solvers/dl_solver.py
index 887938e4..9baf1473 100644
--- a/ccvm_simulators/solvers/dl_solver.py
+++ b/ccvm_simulators/solvers/dl_solver.py
@@ -298,11 +298,11 @@ def _solve(
                 * np.sqrt(dt)
                 / noise_ratio_i
             )
-            
-            diff = 2 * g * torch.sqrt(c**2 + s**2 + 0.5) 
-            
+
+            diff = 2 * g * torch.sqrt(c**2 + s**2 + 0.5)
+
             c += dt * c_drift + diff * wiener_increment_c
-            
+
             s += dt * s_drift + diff * wiener_increment_s
 
             # If evolution_step_size is specified, save the values if this iteration
diff --git a/ccvm_simulators/solvers/langevin_solver.py b/ccvm_simulators/solvers/langevin_solver.py
index ce37920b..8a9e1b28 100644
--- a/ccvm_simulators/solvers/langevin_solver.py
+++ b/ccvm_simulators/solvers/langevin_solver.py
@@ -76,17 +76,17 @@ def parameter_key(self):
 
     @parameter_key.setter
     def parameter_key(self, parameters):
-        expected_dlparameter_key_set = set(
+        expected_lparameter_key_set = set(
             ["dt", "iterations", "sigma", "feedback_scale"]
         )
         parameter_key_list = parameters.values()
         # Iterate over the parameters for each given problem size
         for parameter_key in parameter_key_list:
-            if parameter_key.keys() != expected_dlparameter_key_set:
+            if parameter_key.keys() != expected_lparameter_key_set:
                 # The parameter key is not valid for this solver
                 raise ValueError(
                     "The parameter key is not valid for this solver. Expected keys: "
-                    + str(expected_dlparameter_key_set)
+                    + str(expected_lparameter_key_set)
                     + " Given keys: "
                     + str(parameter_key.keys())
                 )
diff --git a/ccvm_simulators/solvers/pumped_langevin_solver.py b/ccvm_simulators/solvers/pumped_langevin_solver.py
new file mode 100644
index 00000000..dcce5a00
--- /dev/null
+++ b/ccvm_simulators/solvers/pumped_langevin_solver.py
@@ -0,0 +1,638 @@
+from ccvm_simulators.solvers import CCVMSolver
+from ccvm_simulators.solvers.algorithms import AdamParameters
+from ccvm_simulators.solution import Solution
+from ccvm_simulators.post_processor.factory import PostProcessorFactory
+import torch
+import numpy as np
+import torch.distributions as tdist
+import time
+
+LANGEVIN_SCALING_MULTIPLIER = 0.05
+"""The value used by the pumped Langevin solver when calculating a scaling value in
+super.get_scaling_factor()"""
+
+
+class PumpedLangevinSolver(CCVMSolver):
+    """This class models pumped Langevin dynamics as a system of SDEs."""
+
+    def __init__(
+        self,
+        device,
+        problem_category="boxqp",
+        batch_size=1000,
+        S=1,
+    ):
+        """
+        Args:
+            device (str): The device to use for the solver. Can be "cpu" or "cuda".
+            problem_category (str): The category of problem to solve. Can be one of
+                "boxqp". Defaults to "boxqp".
+            batch_size (int): The number of times to solve a problem instance
+                simultaneously. Defaults to 1000.
+            S (float or torch.tensor): Enforced saturation value. Defaults to 1.
+
+        Raises:
+            ValueError: If the problem category is not supported by the solver.
+
+        Returns:
+            PumpedLangevinSolver: The PumpedLangevinSolver object.
+        """
+        super().__init__(device)
+        self.batch_size = batch_size
+        self.S = S
+        self._scaling_multiplier = LANGEVIN_SCALING_MULTIPLIER
+        # Use the method selector to choose the problem-specific methods to use
+        self._method_selector(problem_category)
+
+    @property
+    def parameter_key(self):
+        """The parameters that will be used by the solver when solving the problem.
+
+        Note:
+            Setting this parameter after calling tune() will overwrite tuned parameters.
+
+        The parameter_key must match the following format:
+
+            * key: problem size (the number of variables in the problem).
+            * value: dict with these keys:
+                * pump (float),
+                * dt (float),
+                * iterations (int),
+                * sigma (float),
+                * feedback_scale (float)
+
+            With values, the parameter key might look like this::
+
+                {
+                    20: {"dt": 0.005, "iterations": 15000, "sigma":0.02, "feedback_scale": 1.0}
+                }
+
+        Raises:
+            ValueError: If the parameter key does not contain the solver-specific
+                combination of keys described above.
+        """
+        return self._parameter_key
+
+    @parameter_key.setter
+    def parameter_key(self, parameters):
+        expected_pl_parameter_key_set = set(
+            ["pump", "dt", "iterations", "sigma", "feedback_scale"]
+        )
+        parameter_key_list = parameters.values()
+        # Iterate over the parameters for each given problem size
+        for parameter_key in parameter_key_list:
+            if parameter_key.keys() != expected_pl_parameter_key_set:
+                # The parameter key is not valid for this solver
+                raise ValueError(
+                    "The parameter key is not valid for this solver. Expected keys: "
+                    + str(expected_pl_parameter_key_set)
+                    + " Given keys: "
+                    + str(parameter_key.keys())
+                )
+
+        # If we get here, the parameter key is valid
+        self._parameter_key = parameters
+        self._is_tuned = False
+
+    def _calculate_drift_boxqp(self, c, p, S, feedback_scale):
+        """We treat the SDE that simulates the CIM of NTT as drift
+        calculation.
+
+        Args:
+            c (torch.Tensor): In-phase amplitudes of the solver
+            p (float): Instance of pump field
+            S (float): The saturation value of the amplitudes.
+            feedback_scale (float): feedback scale for gradient.
+
+        Returns:
+            tensor: The calculated change in the variable amplitude.
+        """
+
+        c_pow = torch.pow(c, 2)
+        c_drift_0 = torch.einsum("cj,cj -> cj", -1 + p - c_pow, c)
+
+        c_drift = c_drift_0 + feedback_scale * self._calculate_grads_boxqp(c, S)
+
+        return c_drift
+
+    def _calculate_grads_boxqp(self, c, S=1):
+        """We treat the SDE that simulates the CIM of NTT as gradient
+        calculation. Original SDE considers only quadratic part of the objective
+        function. Therefore, we need to modify and add linear part of the QP to
+        the SDE.
+
+        Args:
+            c (torch.Tensor): In-phase amplitudes of the solver
+
+        Returns:
+            tensor: The calculated change in the variable amplitude.
+        """
+
+        c_grad_1 = torch.einsum("bi,ij -> bj", (c + S) / (2 * S), self.q_matrix) / (
+            2 * S
+        )
+        c_grad_2 = self.v_vector / (2 * S)
+
+        c_grads = -c_grad_1 - c_grad_2
+
+        return c_grads
+
+    def _change_variables_boxqp(self, problem_variables, S=1):
+        """Perform a change of variables to enforce the box constraints.
+
+        Args:
+            problem_variables (torch.Tensor): The variables to change.
+            S (float): The saturation value of the amplitudes. Defaults to 1.
+
+        Returns:
+            torch.Tensor: The changed variables.
+        """
+        return 0.5 * (problem_variables / S + 1)
+
+    def _fit_to_constraints_boxqp(self, c, lower_clamp, upper_clamp):
+        """Clamps the values of c to be within the box constraints
+
+        Args:
+            c (torch.Tensor): The variables to clamp.
+            lower_clamp (float or torch.tensor): The lower bound of the box constraints.
+            upper_clamp (float or torch.tensor): The upper bound of the box constraints.
+
+        Returns:
+            torch.Tensor: The clamped variables.
+        """
+
+        c_clamped = torch.clamp(c, lower_clamp, upper_clamp)
+        return c_clamped
+
+    def _append_samples_to_file(self, c_sample, s_sample, evolution_file_object):
+        """Saves samples of the amplitude values to a file.
+        The end file will contain the values of the c_sample followed by the s_sample.
+        Each line corresponds to a row in the tensor, with tab-delineated values.
+
+        Args:
+            c_sample (torch.Tensor): The sample of in-phase amplitudes to add to the
+            file. Expected Dimensions: problem_size x num_samples
+            s_sample (torch.Tensor): The sample of quadrature amplitudes to add to the
+            file. Expected Dimensions: problem_size x num_samples
+            evolution_file_object (io.TextIOWrapper): The file object of the file to save
+            the samples to.
+        """
+        # Save the c samples to the file
+        c_rows = c_sample.shape[0]  # problem_size
+        c_columns = c_sample.shape[1]  # num_samples
+        for nn in range(c_rows):
+            for ii in range(c_columns):
+                evolution_file_object.write(str(round(c_sample[nn, ii].item(), 4)))
+                evolution_file_object.write("\t")
+            evolution_file_object.write("\n")
+
+        # Save the s samples to the file
+        s_rows = s_sample.shape[0]  # problem_size
+        s_columns = s_sample.shape[1]  # num_samples
+        for nn in range(s_rows):
+            for ii in range(s_columns):
+                evolution_file_object.write(str(round(s_sample[nn, ii].item(), 4)))
+                evolution_file_object.write("\t")
+            evolution_file_object.write("\n")
+
+    def tune(self, instances, post_processor=None, pump_rate_flag=True, g=0.05):
+        """Determines the best parameters for the solver to use by adjusting each
+        parameter over a number of iterations on the problems in the given set of
+        problems instances. The `parameter_key` attribute of the solver will be
+        updated with the best parameters found.
+
+        Args:
+            instances (list): A list of problem instances to tune the solver on.
+            post_processor (str): The name of the post processor to use to process the
+                results of the solver. None if no post processing is desired.
+                Defaults to None.
+            pump_rate_flag (bool): Whether or not to scale the pump rate based on the
+            iteration number. If False, the pump rate will be 1.0. Defaults to True.
+            g (float): The nonlinearity coefficient. Defaults to 0.05.
+        """
+        # TODO: This implementation is a placeholder; full implementation is a
+        #       future consideration
+        self.is_tuned = True
+
+    def _solve(
+        self,
+        problem_size,
+        batch_size,
+        device,
+        S,
+        pump,
+        dt,
+        iterations,
+        sigma,
+        pump_rate_flag,
+        feedback_scale,
+        evolution_step_size,
+        samples_taken,
+    ):
+        """Solves the given problem instance using the pumped Langevin solver.
+
+        Args:
+            problem_size (int): instance size.
+            batch_size (int): The number of times to solve a problem instance
+            device (str): The device to use for the solver. Can be "cpu" or "cuda".
+            S (float): Saturation bound.
+            pump (float): Pump field strength.
+            dt (float): Simulation time step.
+            iterations (int): number of steps.
+            sigma (float): diffusion constant.
+            pump_rate_flag (bool): Whether or not to scale the pump rate based on the
+            iteration number.
+            feedback_scale (float): feedback scale.
+            evolution_step_size (int): If set, the c/s values will be sampled once
+                per number of iterations equivalent to the value of this variable.
+                At the end of the solve process, the best batch of sampled values
+                will be written to a file that can be specified by setting the evolution_file parameter.
+            samples_taken (int): sample slice.
+
+        Returns:
+            c (tensor): random variable.
+        """
+        # Initialize tensor variables on the device that will be used to perform the
+        # calculations
+        c = torch.zeros((batch_size, problem_size), dtype=torch.float, device=device)
+        wiener_dist_c = tdist.Normal(
+            torch.tensor([0.0] * batch_size, device=device),
+            torch.tensor([1.0] * batch_size, device=device),
+        )
+
+        # Define a method conditionally for estimating instantaneous pump rate
+        if pump_rate_flag:
+            pump_field = lambda n: pump * (n + 1) / iterations
+        else:
+            pump_field = lambda n: pump
+
+        # Perform the solve over the specified number of iterations
+
+        for i in range(iterations):
+            c_drift = self.calculate_drift(c, pump_field(i), S, feedback_scale)
+
+            wiener_increment_c = wiener_dist_c.sample((problem_size,)).transpose(
+                0, 1
+            ) * np.sqrt(dt)
+
+            c += dt * c_drift + sigma * wiener_increment_c
+
+            # Ensure variables are within any problem constraints
+            # The lower bound is determined by ell=-S, and upper bound by u=S
+            c = self.fit_to_constraints(c, -S, S)
+
+            # If evolution_step_size is specified, save the values if this iteration
+            # aligns with the step size or if this is the last iteration
+            if evolution_step_size and (
+                i % evolution_step_size == 0 or i + 1 >= iterations
+            ):
+                # Update the record of the sample values with the values found at
+                # this iteration
+                self.c_sample[
+                    :, :, samples_taken
+                ] = c  
+                samples_taken += 1
+
+        return c
+
+    def _solve_adam(
+        self,
+        problem_size,
+        batch_size,
+        device,
+        S,
+        pump,
+        dt,
+        iterations,
+        sigma,
+        pump_rate_flag,
+        feedback_scale,
+        evolution_step_size,
+        samples_taken,
+        hyperparameters,
+    ):
+        """Solves the given problem instance using the pumped Langevin solver with Adam algorithm.
+
+        Args:
+            problem_size (int): instance size.
+            batch_size (int): The number of times to solve a problem instance
+            device (str): The device to use for the solver. Can be "cpu" or "cuda".
+            S (float): Saturation bound.
+            pump (float): Pump field strength.
+            dt (float): Simulation time step.
+            iterations (int): number of steps.
+            sigma (float): diffusion constant.
+            pump_rate_flag (bool): Whether or not to scale the pump rate based on the
+            feedback_scale (float): feedback scale.
+            evolution_step_size (int): If set, the c/s values will be sampled once
+                per number of iterations equivalent to the value of this variable.
+                At the end of the solve process, the best batch of sampled values
+                will be written to a file that can be specified by setting the evolution_file parameter.
+            samples_taken (int): sample slice.
+            hyperparameters (dict): Hyperparameters for Adam algorithm.
+
+        Returns:
+            c (tensor): random variable.
+        """
+        # Initialize tensor variables on the device that will be used to perform the
+        # calculations
+        c = torch.zeros((batch_size, problem_size), dtype=torch.float, device=device)
+        wiener_dist_c = tdist.Normal(
+            torch.tensor([0.0] * batch_size, device=device),
+            torch.tensor([1.0] * batch_size, device=device),
+        )
+
+        alpha = hyperparameters["alpha"]
+        beta1 = hyperparameters["beta1"]
+        beta2 = hyperparameters["beta2"]
+        epsilon = 1e-8
+
+        # Choose desired update method.
+        if hyperparameters["add_assign"]:
+            update_grads_with_moment2 = (
+                lambda grads, mhat, vhat: grads
+                + alpha * torch.div(mhat, torch.sqrt(vhat) + epsilon)
+            )
+
+            update_grads_without_moment2 = lambda grads, mhat: grads + alpha * mhat_c
+        else:
+            update_grads_with_moment2 = lambda grads, mhat, vhat: alpha * torch.div(
+                mhat, torch.sqrt(vhat) + epsilon
+            )
+
+            update_grads_without_moment2 = lambda grads, mhat: alpha * mhat_c
+
+        # Initialize first moment vector
+        m_c = torch.zeros((batch_size, problem_size), dtype=torch.float, device=device)
+        # Initialize second moment conditionally
+        if not beta2 == 1.0:
+            v_c = torch.zeros(
+                (batch_size, problem_size), dtype=torch.float, device=device
+            )
+        else:
+            v_c = None
+
+        # Define a method conditionally for estimating instantaneous pump rate
+        if pump_rate_flag:
+            pump_field = lambda n: pump * (n + 1) / iterations
+        else:
+            pump_field = lambda n: pump
+
+        # Perform the solve with Adam over the specified number of iterations
+        for i in range(iterations):
+            # Calculate gradient
+            c_grads = self.calculate_grads(c, S)
+
+            # Update biased first moment estimate
+            m_c = beta1 * m_c + (1.0 - beta1) * c_grads
+
+            # Compute bias correction in 1st moment
+            beta1i = 1.0 - beta1 ** (i + 1)
+            mhat_c = m_c / beta1i
+
+            # Conditional second moment estimation
+            if not beta2 == 1.0:
+                # Update biased 2nd moment estimate
+                v_c = beta2 * v_c + (1.0 - beta2) * torch.pow(c_grads, 2)
+
+                # Compute bias correction in 2nd moment
+                beta2i = 1.0 - beta2 ** (i + 1)
+                vhat_c = v_c / beta2i
+
+                # Compute bias corrected grad using 1st and 2nd moments
+                # in the form of element-wise division
+                c_grads = update_grads_with_moment2(c_grads, mhat_c, vhat_c)
+            else:
+                # Compute bias corrected grad only with 1st moment
+                c_grads = update_grads_without_moment2(c_grads, mhat_c)
+
+            wiener_increment_c = wiener_dist_c.sample((problem_size,)).transpose(
+                0, 1
+            ) * np.sqrt(dt)
+
+            # Calculate contribution of pumped field
+            c_pow = torch.pow(c, 2)
+            c_pump = torch.einsum("cj,cj -> cj", -1 + pump_field(i) - c_pow, c)
+
+            # Update variable
+            c += dt * (c_pump + feedback_scale * c_grads) + sigma * wiener_increment_c
+
+            # Ensure variables are within any problem constraints
+            # The lower bound is determined by ell=-S, and upper bound by u=S
+            c = self.fit_to_constraints(c, -S, S)
+
+            # If evolution_step_size is specified, save the values if this iteration
+            # aligns with the step size or if this is the last iteration
+            if evolution_step_size and (
+                i % evolution_step_size == 0 or i + 1 >= iterations
+            ):
+                # Update the record of the sample values with the values found at
+                # this iteration
+                self.c_sample[:, :, samples_taken] = c
+                samples_taken += 1
+
+        return c
+
+    def __call__(
+        self,
+        instance,
+        post_processor=None,
+        pump_rate_flag=True,
+        evolution_step_size=None,
+        evolution_file=None,
+        algorithm_parameters=None,
+    ):
+        """Solves the box-constrained programming problem using the pumped Langevin solver using 
+        either Adam algorithm for the calculation of the gradient of the objective function or 
+        the simple gradient descent method. This choice can be set in the argument of `algorithm_parameters`.
+
+        Args:
+            instance (ProblemInstance): The problem instance to solve.
+            post_processor (str): The name of the post processor to use to process the results of the solver.
+                None if no post processing is desired. Defaults to None.
+            pump_rate_flag (bool): Whether or not to scale the pump rate based on the
+                iteration number. If False, the pump rate will be 1.0. Defaults to True.
+            evolution_step_size (int): If set, the c/s values will be sampled once
+                per number of iterations equivalent to the value of this variable.
+                At the end of the solve process, the best batch of sampled values
+                will be written to a file that can be specified by setting the evolution_file parameter.
+                Defaults to None, meaning no problem variables will be written to the file.
+            evolution_file (str): The file to save the best set of c/s samples to.
+                Only revelant when evolution_step_size is set.
+                If a file already exists with the same name, it will be overwritten.
+                Defaults to None, which generates a filename based on the problem instance name.
+            algorithm_parameters (None, AdamParameters): Specify for the solver to use a specialized algorithm by passing in
+                an instance of the algorithm's parameters class. Options include: AdamParameters.
+                Defaults to None, which uses the original Langevin solver.
+
+        Returns:
+            solution (Solution): The solution to the problem instance.
+        """
+        # If the instance and the solver don't specify the same device type, raise
+        # an error
+        if instance.device != self.device:
+            raise ValueError(
+                f"The device type of the instance ({instance.device}) and the solver"
+                f" ({self.device}) must match."
+            )
+
+        # Get problem from problem instance
+        problem_size = instance.problem_size
+        self.q_matrix = instance.q_matrix
+        self.v_vector = instance.v_vector
+
+        # Get solver setup variables
+        S = self.S
+        batch_size = self.batch_size
+        device = self.device
+
+        # Get parameters from parameter_key
+        try:
+            pump = self.parameter_key[problem_size]["pump"]
+            dt = self.parameter_key[problem_size]["dt"]
+            iterations = self.parameter_key[problem_size]["iterations"]
+            sigma = self.parameter_key[problem_size]["sigma"]
+            feedback_scale = self.parameter_key[problem_size]["feedback_scale"]
+
+        except KeyError as e:
+            raise KeyError(
+                f"The parameter '{e.args[0]}' for the given instance size is not defined."
+            ) from e
+
+        # If S is a 1-D tensor, convert it to to a 2-D tensor
+        if torch.is_tensor(S) and S.ndim == 1:
+            # Dimension indexing in pytorch starts at 0
+            if S.size(dim=0) == problem_size:
+                S = torch.outer(torch.ones(batch_size), S)
+            else:
+                raise ValueError("Tensor S size should be equal to problem size.")
+
+        # Start the timer for the solve
+        solve_time_start = time.time()
+
+        samples_taken = None
+        self.c_sample = None  # variable for random sample
+        if evolution_step_size:
+            # Check that the value is valid
+            if evolution_step_size < 1:
+                raise ValueError(
+                    f"The evolution step size must be greater than or equal to 1."
+                )
+            # Generate evolution file name
+            if evolution_file is None:
+                evolution_file = f"./{instance.name}_evolution.txt"
+
+            # Get the number of samples to save
+            # Find the number of full steps that will be taken
+            num_steps = int(iterations / evolution_step_size)
+            # We will also capture the first iteration through
+            num_samples = num_steps + 1
+            # And capture the last iteration if the step size doesn't evenly divide
+            if iterations % evolution_step_size != 0:
+                num_samples += 1
+
+            # Initialize tensors
+            # Store on CPU to keep the memory usage lower on the GPU
+            self.c_sample = torch.zeros(
+                (batch_size, problem_size, num_samples),
+                dtype=torch.float,
+                device="cpu",
+            )
+            samples_taken = 0
+
+        if algorithm_parameters is None:
+            # Use the original Langevin solver
+            c = self._solve(
+                problem_size,
+                batch_size,
+                device,
+                S,
+                pump,
+                dt,
+                iterations,
+                sigma,
+                pump_rate_flag,
+                feedback_scale,
+                evolution_step_size,
+                samples_taken,
+            )
+        elif isinstance(algorithm_parameters, AdamParameters):
+            # Use the Langevin solver with the Adam algorithm
+            c = self._solve_adam(
+                problem_size,
+                batch_size,
+                device,
+                S,
+                pump,
+                dt,
+                iterations,
+                sigma,
+                pump_rate_flag,
+                feedback_scale,
+                evolution_step_size,
+                samples_taken,
+                algorithm_parameters.to_dict(),
+            )
+        else:
+            raise ValueError(
+                f"Solver option type {type(algorithm_parameters)} is not supported."
+            )
+
+        # Stop the timer for the solve
+        solve_time = time.time() - solve_time_start
+
+        # Calibrate the variable
+        c_prime = (c + S) / (2 * S)
+
+        # Run the post processor on the results, if specified
+        if post_processor:
+            post_processor_object = PostProcessorFactory.create_postprocessor(
+                post_processor
+            )
+
+            problem_variables = post_processor_object.postprocess(
+                c_prime, self.q_matrix, self.v_vector
+            )
+            pp_time = post_processor_object.pp_time
+        else:
+            problem_variables = c_prime
+            pp_time = 0.0
+
+        # Calculate the objective value
+        objval = instance.compute_energy(problem_variables)
+
+        if evolution_step_size:
+            # Write samples to file
+            # Overwrite file if it exists
+            open(evolution_file, "w")
+
+            # Get the indices of the best objective values over the sampled iterations
+            # to use to get and save the best sampled values of c and s
+            batch_index = torch.argmax(-objval)
+            with open(evolution_file, "a") as evolution_file_obj:
+                self._append_samples_to_file(
+                    c_sample=self.c_sample[batch_index],
+                    evolution_file_object=evolution_file_obj,
+                )
+
+        solution = Solution(
+            problem_size=instance.problem_size,
+            batch_size=batch_size,
+            instance_name=instance.name,
+            iterations=iterations,
+            objective_values=objval,
+            solve_time=solve_time,
+            pp_time=pp_time,
+            optimal_value=instance.optimal_sol,
+            best_value=instance.best_sol,
+            num_frac_values=instance.num_frac_values,
+            solution_vector=instance.solution_vector,
+            variables={"problem_variables": problem_variables},
+            device=self.device,
+        )
+
+        # Add evolution filename to solution if it was generated
+        if evolution_step_size:
+            solution.evolution_file = evolution_file
+
+        return solution
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 6f27d759..8f8ea2d9 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -40,4 +40,4 @@
 
 html_theme = "furo"
 html_static_path = ["_static"]
-html_css_files = ['custom.css']
+html_css_files = ["custom.css"]
diff --git a/examples/README.md b/examples/README.md
index 13ace985..cdface84 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -8,6 +8,7 @@ There are currently two methods available for each solver class [DL-CCVM, MF-CCV
 - `ccvm_boxqp_dl.py`: Solves DL-CCVM using the Adam algorithm, without plotting. The original solver can be used by removing the `algorithm_parameters` argument.
 - `ccvm_boxqp_mf.py`: Solves MF-CCVM using the Adam algorithm, without plotting. The original solver can be used by removing the `algorithm_parameters` argument.
 - `langevin_boxqp.py`: Solves Langevin equation using the Adam algorithm, without plotting. The original solver can be used by removing the `algorithm_parameters` argument.
+- `pumped_langevin_boxqp.py`: Solves pumped Langevin equation by either Adam algorithm or original solver with a use of `algorithm_parameters` argument.
 - `benchmarking_studies.py`: Benchmark DL-CCVM against a Langevin solver (**to be implemented**)
 
 
diff --git a/examples/ccvm_boxqp_dl.py b/examples/ccvm_boxqp_dl.py
index c0045cec..a33ddf84 100644
--- a/examples/ccvm_boxqp_dl.py
+++ b/examples/ccvm_boxqp_dl.py
@@ -28,7 +28,7 @@
         # Scale the problem's coefficients for more stable optimization
         boxqp_instance.scale_coefs(solver.get_scaling_factor(boxqp_instance.q_matrix))
 
-        # Solve the problem with one of the methods by setting 
+        # Solve the problem with one of the methods by setting
         # (1) algorithm_parameters=None (Default) for original algorithm
         # (2) algorithm_parameters=AdamParameters(..) for the Adam algorithm
         solution = solver(
diff --git a/examples/ccvm_boxqp_mf.py b/examples/ccvm_boxqp_mf.py
index 84800501..aaa550ac 100644
--- a/examples/ccvm_boxqp_mf.py
+++ b/examples/ccvm_boxqp_mf.py
@@ -35,7 +35,7 @@
         # Scale the problem's coefficients for more stable optimization
         boxqp_instance.scale_coefs(solver.get_scaling_factor(boxqp_instance.q_matrix))
 
-        # Solve the problem with one of the methods by setting 
+        # Solve the problem with one of the methods by setting
         # (1) algorithm_parameters=None (Default) for original algorithm
         # (2) algorithm_parameters=AdamParameters(..) for the Adam algorithm
         solution = solver(
diff --git a/examples/langevin_boxqp.py b/examples/langevin_boxqp.py
index 56c548bc..2dfe73fd 100644
--- a/examples/langevin_boxqp.py
+++ b/examples/langevin_boxqp.py
@@ -3,7 +3,8 @@
 from ccvm_simulators.solvers import LangevinSolver
 from ccvm_simulators.solvers.algorithms import AdamParameters
 
-TEST_INSTANCES_DIR = "./test_instances/"
+# TEST_INSTANCES_DIR = "./test_instances/"
+TEST_INSTANCES_DIR = "./tuning_instances/"
 
 if __name__ == "__main__":
     # Initialize solver
@@ -33,7 +34,7 @@
         # Scale the problem's coefficients for more stable optimization
         boxqp_instance.scale_coefs(solver.get_scaling_factor(boxqp_instance.q_matrix))
 
-        # Solve the problem with one of the methods by setting 
+        # Solve the problem with one of the methods by setting
         # (1) algorithm_parameters=None for original algorithm
         # (2) algorithm_parameters=AdamParameters(..) for the Adam algorithm
         solution = solver(
diff --git a/examples/pumped_langevin_boxqp.py b/examples/pumped_langevin_boxqp.py
new file mode 100644
index 00000000..b4da5d69
--- /dev/null
+++ b/examples/pumped_langevin_boxqp.py
@@ -0,0 +1,50 @@
+import glob
+from ccvm_simulators.problem_classes.boxqp import ProblemInstance
+from ccvm_simulators.solvers import PumpedLangevinSolver
+from ccvm_simulators.solvers.algorithms import AdamParameters
+
+TEST_INSTANCES_DIR = "./test_instances/"  # "./tuning_instances/"
+
+if __name__ == "__main__":
+    # Initialize solver
+    batch_size = 1000
+    solver = PumpedLangevinSolver(
+        device="cpu", batch_size=batch_size, S=0.5
+    )  # or "cuda"
+
+    # Supply solver parameters for different problem sizes
+    solver.parameter_key = {
+        20: {
+            "pump": 2.0,  # p0
+            "dt": 0.002,
+            "iterations": 15000,
+            "sigma": 0.5,
+            "feedback_scale": 1.0,
+        },
+    }
+
+    # Load test instances to solve
+    test_instances_files = [f for f in glob.glob(TEST_INSTANCES_DIR + "*.in")]
+    for instance_file in test_instances_files:
+        # Load the problem from the problem file into the instance
+        boxqp_instance = ProblemInstance(
+            instance_type="test",
+            file_path=instance_file,
+            device=solver.device,
+        )
+
+        # Scale the problem's coefficients for more stable optimization
+        boxqp_instance.scale_coefs(solver.get_scaling_factor(boxqp_instance.q_matrix))
+
+        # Solve the problem with one of the methods by setting
+        # (1) algorithm_parameters=None for original algorithm
+        # (2) algorithm_parameters=AdamParameters(..) for the Adam algorithm
+        solution = solver(
+            instance=boxqp_instance,
+            post_processor=None,
+            # algorithm_parameters=AdamParameters(
+            #     alpha=0.001, beta1=0.9, beta2=0.999, add_assign=True
+            # ),
+        )
+
+        print(solution)
diff --git a/examples/tuning_instances/tuningH020-100-1.in b/examples/tuning_instances/tuningH020-100-1.in
new file mode 100644
index 00000000..c70de5e4
--- /dev/null
+++ b/examples/tuning_instances/tuningH020-100-1.in
@@ -0,0 +1,23 @@
+20	216.556096	216.556096	True	0.0679	0.0018	1	0
+29.31109252937092	30.31531106351077	-6.9559689052863405	-2.405556239044123	18.117473303379196	7.550433479175683	-31.523845104544158	-0.1590753460245935	7.09130325916829	5.596156724185187	3.567639033653592	8.457683496532766	20.986200468610754	13.738032541538903	27.472410249485556	21.193027385882296	22.278306106457684	-1.548874821427099	27.151770508804688	-9.220695726599352	
+-16.77261499407211	9.149041656522641	-6.121205826357512	12.787863011676318	-14.203390861128911	-5.81766914749365	0.7165305787115365	-5.588761149046411	-3.650499637309019	3.2842941617064483	-17.714350074787696	10.432319995377295	-7.173527723441508	6.844332705340018	5.257266234082818	2.5463067951542304	-0.318897085577245	3.317373379395544	7.375246015443432	-4.462342198185778	
+9.149041656522643	-18.22480838834753	5.921452481467456	-6.949066344794556	-1.6389831110434818	-4.921775380433786	10.534577921155517	15.531369543264068	-16.714405784339576	-8.710060598768596	7.143627737691952	-0.05594804462377329	-9.283791196412253	3.6195198734446485	-9.481837366709549	5.349992001559396	9.008670909720589	-0.3530887069404753	4.1894680747008355	-0.05940922643698245	
+-6.121205826357514	5.9214524814674565	4.193944963659949	1.7630772333167384	8.056435174348547	8.022636233051987	-4.657698136696957	1.5171458129031057	-1.6652594201100537	1.960520738278422	-8.07020863157074	-7.839998879530174	-3.2863172202311137	4.736555531320671	-6.741858304113627	-1.6613633512040809	-2.764663063754247	-2.1252499138529446	-1.1107621770011904	-5.75424066880558	
+12.787863011676318	-6.949066344794558	1.7630772333167384	-20.55904160598547	5.225445416163233	-0.8017497037912307	-1.6988228505840302	-2.5947962802907916	-4.866589013667977	-7.603703734553342	9.414887494128635	-0.958241490497337	2.460309530734136	-3.6329477475646517	0.31713861860734943	-4.886591840558977	-1.1505435634648884	4.654880795366641	-1.8276885278580368	11.658679122601223	
+-14.203390861128911	-1.6389831110434818	8.056435174348545	5.225445416163234	-10.99369092666027	1.787140329029452	6.455225027165778	-1.9117345024595003	8.282518553444959	6.1219818741694425	-14.419147303666987	-0.7262614527388516	-2.031416228445803	-9.72502735737912	-4.100847217900739	-9.494206443628084	-4.853512609502083	7.50611825999636	-1.7901349961144324	8.717935891631038	
+-5.81766914749365	-4.921775380433786	8.022636233051985	-0.80174970379123	1.7871403290294519	-13.708546163437637	-1.2890003582666274	-6.243052725409302	-4.586725671755428	-0.6005764123097004	-10.64088707804776	7.126780829048237	-0.9239887023695347	11.480071324956748	3.6436120834293573	-3.448029909464383	3.119366598670081	-1.484501503116037	8.848851796557282	-4.409175747329236	
+0.7165305787115374	10.534577921155515	-4.657698136696957	-1.6988228505840304	6.455225027165778	-1.2890003582666272	-15.840600654692821	-4.634389554481922	9.215455986064907	10.287428100642407	2.9588367217989404	3.8168507680317347	-0.045211446124351226	5.050482390699087	13.708362122530414	2.5724994447692238	-8.609665433489505	1.154713777169339	-4.258710215157683	-2.135446763110273	
+-5.5887611490464115	15.531369543264066	1.5171458129031052	-2.5947962802907916	-1.9117345024594992	-6.243052725409302	-4.634389554481922	-5.283672761559772	10.050791862796755	11.64055669440906	-6.464709121336906	-9.20183354742953	-0.758590388311131	7.091164359153972	7.366877818956489	5.222768760914415	-13.699088561021249	-4.172132081361385	-7.502098839607522	-5.939034409850929	
+-3.650499637309019	-16.714405784339576	-1.6652594201100541	-4.866589013667979	8.28251855344496	-4.5867256717554294	9.215455986064908	10.050791862796755	-23.93417350945532	-4.675929642723049	1.852363323049408	6.83907617981109	-9.491870681028947	-0.8259546449840086	-8.201237288257094	-5.941849662242866	11.204852748631165	17.946158606924776	-5.199639245860117	1.1039269288135183	
+3.2842941617064487	-8.710060598768596	1.9605207382784215	-7.603703734553341	6.1219818741694425	-0.6005764123097009	10.287428100642405	11.64055669440906	-4.675929642723049	-12.192615508066888	15.801028069659141	-6.975025482343036	0.02983404247360085	-2.6320320789445386	-8.201491882159196	-3.8276468952486375	5.951870056506254	3.861595306196327	-1.1033051383755348	3.8717982300273444	
+-17.7143500747877	7.143627737691951	-8.07020863157074	9.414887494128635	-14.419147303666985	-10.64088707804776	2.9588367217989404	-6.464709121336905	1.8523633230494079	15.801028069659141	-12.66474155731528	14.540998299825699	-8.893726115323917	4.010072384047932	8.717669724201869	-4.032137778425826	-0.7959209530584775	13.938151490991482	3.8686740072105708	-2.547022165823843	
+10.432319995377295	-0.05594804462377278	-7.839998879530172	-0.9582414904973371	-0.7262614527388519	7.126780829048237	3.8168507680317347	-9.20183354742953	6.83907617981109	-6.975025482343037	14.540998299825699	-9.788838174060938	21.96756806396435	-13.678049588424608	-6.038679054854794	-8.191333084340096	1.5705056411171074	-2.6486518530178804	-1.4846181980755866	-3.756841403577882	
+-7.1735277234415085	-9.283791196412253	-3.286317220231115	2.460309530734136	-2.031416228445803	-0.9239887023695352	-0.04521144612435022	-0.7585903883111305	-9.491870681028946	0.029834042473600646	-8.893726115323918	21.96756806396435	-13.146936501699846	0.4165575392295686	-1.110382389630049	-5.439624252379725	5.1302650847166555	9.099759961551664	1.1595578673704199	6.5899418767020785	
+6.844332705340018	3.6195198734446485	4.736555531320671	-3.6329477475646517	-9.72502735737912	11.480071324956748	5.050482390699087	7.091164359153974	-0.825954644984008	-2.6320320789445386	4.010072384047932	-13.678049588424606	0.41655753922956795	0.10099084581566387	-9.27846124233709	-0.7691240596529302	3.012298599529683	-1.0000173515688116	8.87293059857608	-1.843968776193578	
+5.257266234082818	-9.481837366709549	-6.741858304113627	0.3171386186073497	-4.100847217900739	3.643612083429358	13.708362122530414	7.36687781895649	-8.201237288257094	-8.201491882159196	8.717669724201869	-6.038679054854794	-1.1103823896300489	-9.27846124233709	-23.004228523965267	-1.5952403606589654	8.13656189686807	11.505347500001852	7.401561340765317	-6.575569523825783	
+2.5463067951542304	5.349992001559395	-1.6613633512040806	-4.886591840558977	-9.494206443628086	-3.448029909464382	2.5724994447692238	5.222768760914415	-5.941849662242866	-3.8276468952486358	-4.032137778425825	-8.1913330843401	-5.439624252379725	-0.7691240596529291	-1.5952403606589654	8.803612598070949	-0.6457858572820417	2.6793595642426222	2.7500026923163965	1.1948438441712983	
+-0.31889708557724544	9.008670909720589	-2.764663063754247	-1.1505435634648886	-4.853512609502083	3.1193665986700814	-8.609665433489507	-13.699088561021249	11.204852748631163	5.951870056506254	-0.7959209530584782	1.5705056411171083	5.130265084716655	3.0122985995296845	8.13656189686807	-0.6457858572820415	-13.413521454680494	-14.813610805378664	-7.147818426813131	1.3555733257993572	
+3.317373379395547	-0.35308870694047534	-2.125249913852944	4.654880795366641	7.50611825999636	-1.4845015031160382	1.154713777169338	-4.172132081361385	17.946158606924772	3.861595306196327	13.938151490991482	-2.648651853017879	9.099759961551664	-1.000017351568811	11.505347500001852	2.6793595642426227	-14.813610805378664	-23.190108933985933	-19.383320298136947	-3.918517328774691	
+7.375246015443432	4.189468074700836	-1.1107621770011904	-1.827688527858038	-1.7901349961144324	8.848851796557282	-4.258710215157683	-7.502098839607523	-5.1996392458601175	-1.1033051383755348	3.8686740072105708	-1.484618198075587	1.1595578673704205	8.872930598576078	7.401561340765318	2.7500026923163974	-7.147818426813131	-19.38332029813695	-7.849602701849909	-4.106904543690628	
+-4.462342198185778	-0.05940922643698173	-5.754240668805579	11.658679122601221	8.717935891631038	-4.409175747329235	-2.135446763110274	-5.939034409850929	1.1039269288135187	3.871798230027345	-2.5470221658238446	-3.756841403577882	6.5899418767020785	-1.8439687761935777	-6.575569523825783	1.1948438441712983	1.3555733257993567	-3.918517328774691	-4.106904543690628	-12.666423905978988	
+1.0	1.0	0.0	0.0	0.0	1.0	0.0	0.0	0.0	0.0	0.0	1.0	1.0	1.0	1.0	1.0	1.0	0.0	1.0	0.0	
\ No newline at end of file
diff --git a/examples/tuning_instances/tuningH020-100-2.in b/examples/tuning_instances/tuningH020-100-2.in
new file mode 100644
index 00000000..0c6dd4c5
--- /dev/null
+++ b/examples/tuning_instances/tuningH020-100-2.in
@@ -0,0 +1,23 @@
+20	111.404548	111.52133	True	0.1138	0.0023	2	0
+-4.1845078732903245	-15.670739911389322	11.806031532361901	-25.12316471343978	-33.10791471645785	11.48228396163336	-16.795651182453287	-19.886020293797987	-18.9456136939492	-6.047914269866042	22.833585012298688	10.085430374723316	19.677175235156184	-4.285236982774411	-25.608682183257322	-3.1017435138345224	2.2401101079982073	-40.08372933678163	26.706202605591525	22.19318034866919	
+22.831836234401848	3.385894211663593	5.114438304327338	-9.538167802652588	-2.3919819304044436	-6.559244994480537	6.4772406142522065	-3.7320611345420938	1.0447130372003195	-2.985287176418944	4.1176756920243545	0.47099939060714363	-9.605175103996277	-9.299289487113432	0.7502213664935786	-6.939287103006607	-2.0432925852345587	18.23731604594017	-2.0043429364555245	-3.6697114487662805	
+3.3858942116635924	-3.0017885155080335	7.453246105345561	-1.1116457971508686	-7.763864270358204	-1.5285499483107239	2.8933869176191704	6.764109517820109	9.223034573887857	-0.8499369917675251	-1.5787536122301886	1.343524347823304	4.79530424322684	0.8675668048362815	-6.883508053242805	-8.314538975192132	5.2867671229509705	1.9891822234521008	5.08732513653907	4.203103990892255	
+5.114438304327338	7.453246105345561	-9.05935586111793	1.7431987621181215	0.6139825982854	-11.225435596358686	-13.488091459350832	-8.788946719423286	-9.515598829604615	-10.516832482786	2.324424022827078	-1.520609416924713	-13.745854645412166	1.8408230254666238	4.190687348610639	5.505650783729915	-10.523815535227001	7.384814892153758	2.28518858203683	0.13474804501918414	
+-9.538167802652588	-1.1116457971508686	1.7431987621181209	7.609284904283105	-0.933026808166588	1.315570194654912	-0.4767295708815696	-2.645711957946193	-1.4264724710245167	1.6627701078757986	4.671329545027811	7.474821200967978	-2.0903018477100956	7.104779223157133	2.1923880288187405	6.451215480305987	4.41158315825581	4.294164371728248	0.13754029761389772	-8.120147057316446	
+-2.3919819304044436	-7.763864270358202	0.613982598285399	-0.933026808166588	-3.5983254043181887	6.074876175490481	12.93286489718839	9.6433651428003	14.688735798661089	11.481149082440721	-4.132454750179203	1.7021867259430363	8.42408959769624	3.45708670376416	0.16531657995182333	-12.76146270607066	8.425252779165568	-1.3038174686130628	2.984144641033478	-1.7023888649589345	
+-6.559244994480537	-1.5285499483107228	-11.225435596358686	1.3155701946549125	6.074876175490481	0.2376730659285659	-3.907246546566482	4.2728245779575325	1.8003889960991841	1.4821109888560735	-5.882169396906495	-1.9398612319139066	-2.61089097843541	-9.044110356144873	0.35332859221792073	-1.6473661648939875	-5.79960298987302	-8.06907135820019	-3.5095205444890176	-1.3303739117591997	
+6.477240614252206	2.8933869176191704	-13.488091459350832	-0.4767295708815696	12.93286489718839	-3.907246546566481	-6.9997025467088205	5.763165727511508	2.366005278120264	-4.569373989481018	-0.3454575128888046	-1.3394707313533396	-23.00888504788614	-2.626899212974808	5.066772909867418	4.307321298383114	-4.390780088610705	7.117897142426871	0.8379430332245389	5.040629061068047	
+-3.7320611345420938	6.764109517820109	-8.788946719423285	-2.645711957946193	9.6433651428003	4.2728245779575325	5.763165727511508	2.0589444300279807	-10.456443150667676	5.370031714676166	-3.226524739362926	-6.148356960323	4.569461277642177	0.05879142974399263	13.644249282937562	1.2616932166002175	-0.24562177032478955	-3.6141072795433895	0.2275995287446513	1.4076648030320333	
+1.044713037200319	9.223034573887857	-9.515598829604615	-1.4264724710245167	14.688735798661089	1.8003889960991846	2.366005278120264	-10.456443150667676	-24.00857491691304	1.1563642168042068	5.115484337250215	0.843284739271371	-9.390617642580386	-4.107988023328582	15.213923436620442	9.627459097006568	-12.314035455784989	0.8545521583532595	-7.899026813233726	-5.635182319183112	
+-2.985287176418943	-0.849936991767525	-10.516832482786	1.6627701078757984	11.481149082440721	1.4821109888560735	-4.569373989481019	5.370031714676165	1.1563642168042065	-2.0510685578525862	-7.469728143866231	-3.597511542887686	2.8837037499239337	-2.7677156669506187	9.641802412763475	1.8297996569461967	-4.556003658687535	-7.40782129398411	-1.8822370704110938	8.682177217353225	
+4.117675692024354	-1.5787536122301877	2.3244240228270785	4.671329545027811	-4.132454750179203	-5.882169396906496	-0.34545751288880455	-3.2265247393629255	5.115484337250215	-7.469728143866231	-12.24427667075903	-2.610500664239668	7.805623657306633	7.725226760348628	6.551758978038415	-4.733236546349163	-2.698451509952556	7.269054157613976	1.7070450124302061	9.756450306382472	
+0.47099939060714363	1.3435243478233043	-1.5206094169247126	7.474821200967979	1.7021867259430363	-1.939861231913907	-1.33947073135334	-6.148356960323	0.8432847392713712	-3.5975115428876863	-2.610500664239668	6.624788491493	-3.0980246192192378	3.9657994974373554	3.8796166920012993	-0.9757377698621275	-8.003390423691052	5.786543358697891	-6.252089973342517	-5.209877211599038	
+-9.605175103996277	4.79530424322684	-13.745854645412168	-2.0903018477100956	8.424089597696241	-2.61089097843541	-23.00888504788614	4.569461277642177	-9.390617642580386	2.8837037499239346	7.8056236573066355	-3.0980246192192373	-30.298118365475823	-5.213734390910763	-4.864685435487353	22.50272046302593	-7.428766608321807	-1.1676534112568704	4.190908395475071	-3.1825193522119153	
+-9.299289487113432	0.8675668048362812	1.8408230254666238	7.104779223157133	3.45708670376416	-9.044110356144873	-2.6268992129748083	0.05879142974399259	-4.107988023328583	-2.7677156669506187	7.725226760348628	3.9657994974373554	-5.213734390910763	3.948506740549046	3.7197879593485332	7.52712587824686	4.021626566174959	4.503095616058977	0.07874147985512564	-0.6077707136645502	
+0.7502213664935787	-6.883508053242804	4.190687348610639	2.1923880288187405	0.16531657995182203	0.35332859221791973	5.066772909867418	13.644249282937563	15.213923436620442	9.641802412763475	6.551758978038416	3.8796166920013	-4.864685435487353	3.7197879593485332	-2.222834052975435	-2.567539430308067	7.359120542588109	6.946083069217127	3.366872380443814	-2.8412736501442146	
+-6.939287103006607	-8.31453897519213	5.505650783729915	6.451215480305987	-12.76146270607066	-1.6473661648939875	4.307321298383115	1.261693216600218	9.627459097006568	1.8297996569461967	-4.733236546349164	-0.9757377698621273	22.502720463025927	7.527125878246862	-2.567539430308067	-8.284270020968163	9.016226608866951	-4.575106699887857	1.9944499786578918	-1.1032042569868237	
+-2.043292585234559	5.286767122950972	-10.523815535227001	4.41158315825581	8.425252779165568	-5.799602989873019	-4.390780088610705	-0.24562177032478955	-12.314035455784989	-4.556003658687535	-2.6984515099525557	-8.003390423691052	-7.428766608321806	4.021626566174958	7.3591205425881085	9.016226608866951	-4.154750020213765	1.7742296895662	-0.9124518194861604	3.5771970070465233	
+18.23731604594017	1.9891822234521004	7.384814892153758	4.294164371728248	-1.303817468613063	-8.069071358200189	7.11789714242687	-3.6141072795433895	0.8545521583532598	-7.40782129398411	7.269054157613977	5.786543358697891	-1.1676534112568697	4.503095616058977	6.946083069217127	-4.575106699887857	1.7742296895662	18.313358992808425	-1.4963861858852645	-1.4626761060855535	
+-2.004342936455525	5.087325136539071	2.2851885820368305	0.13754029761389902	2.984144641033478	-3.509520544489017	0.8379430332245389	0.2275995287446515	-7.899026813233726	-1.8822370704110924	1.7070450124302063	-6.252089973342516	4.190908395475071	0.07874147985512608	3.366872380443813	1.9944499786578918	-0.912451819486161	-1.4963861858852645	-2.0587169770433236	2.0553701827229114	
+-3.669711448766282	4.203103990892254	0.13474804501918392	-8.120147057316444	-1.7023888649589345	-1.3303739117591995	5.040629061068047	1.4076648030320333	-5.635182319183112	8.682177217353226	9.756450306382472	-5.2098772115990375	-3.1825193522119153	-0.6077707136645505	-2.8412736501442146	-1.1032042569868237	3.577197007046523	-1.462676106085554	2.055370182722911	-8.549414356527427	
+0.0	0.0	1.0	0.0	0.0	0.0	0.0	0.0	0.0	0.0	1.0	0.0	1.0	1.0	0.0	1.0	0.0	0.0	1.0	1.0	
\ No newline at end of file
diff --git a/examples/tuning_instances/tuningH020-100-3.in b/examples/tuning_instances/tuningH020-100-3.in
new file mode 100644
index 00000000..3572587d
--- /dev/null
+++ b/examples/tuning_instances/tuningH020-100-3.in
@@ -0,0 +1,23 @@
+20	180.264863	180.264863	True	0.0812	0.0027	3	4
+17.85727341275004	-2.7882031169192665	-7.282449830731318	9.067321345691457	-13.830633136327195	6.487104392328806	17.257968116803497	-23.824528575242176	50.03190811653174	-28.551065448186456	37.90665861574445	28.244146906251935	-14.278957332054631	10.773108742928258	-0.756004011868713	34.99191330459743	21.3878691733541	25.522323278930948	-8.753894193245289	37.47687511656294	
+-8.385280623112692	-3.871108303851967	-11.193100852961976	-0.6001552083709498	-1.7421624420195867	2.0907302743609004	18.762023921573693	3.752866127441269	0.28121639201866394	-6.278466836848595	0.3953742846744812	0.831439912951254	-5.428085578922676	11.402016754316275	5.655663256670048	-0.05867053106862268	5.515452406496386	4.541499501881036	-1.4332964567924191	-4.706571408475183	
+-3.8711083038519662	-28.246444918873443	-3.281895106671311	-3.5907138853108407	-2.4832564888058815	-4.177317499986683	7.603169417989829	9.461310045783199	-9.461579070382738	-7.207951172903883	-1.6195998498247035	-6.241006590232494	1.9762714033360405	-2.0525172111807826	-0.22817152128876578	4.22397893635232	8.484656860929912	-2.5323531608916894	13.572199077494327	-6.034081475589382	
+-11.193100852961976	-3.2818951066713105	-3.7077733474110603	-12.363375316686016	-0.4249219033612486	1.3761869509675937	10.50677384843301	0.5474155840502485	2.6897792390518256	3.739564407095735	-8.489937320477344	2.246951204202501	11.833258287679884	-1.3597396801444892	0.9132398212927778	3.8221878166705427	10.811174987758907	-3.3860861056001372	0.7673672410965121	2.61215980003476	
+-0.60015520837095	-3.5907138853108407	-12.363375316686017	14.646993952624141	9.805417397508837	-7.4963512820542935	-0.10731364184562357	5.810151850741357	-14.687389154906995	1.2942514446323732	2.3597074886270155	1.3401205474326139	10.015664888604963	-3.6461056473372953	9.728472366102737	-1.705293925643765	-1.322731469576755	7.456050537136911	1.6434485183446113	1.4462135365380577	
+-1.7421624420195871	-2.4832564888058815	-0.42492190336124847	9.805417397508837	3.5983339895583155	-6.185260137383191	-8.421020949773984	-3.4651920348516807	-4.687271661753705	8.365646416512169	-7.135378578830199	-2.452878575871855	3.684440876605959	-9.155315302115497	6.700645959111943	-4.944448952544983	-4.0727728553469	-1.7920742071392401	4.897836334881996	3.0439805615640245	
+2.090730274360901	-4.177317499986683	1.3761869509675935	-7.4963512820542935	-6.185260137383191	-3.3957698352067953	2.6715191271154177	2.3274362061995277	-0.6136314649467968	-1.9431776187576342	-1.1369148747614195	-4.880973322025064	-5.579472015049852	-4.432686942744128	5.2959521237463845	1.9610240678922823	-0.0981550931182134	-9.49530292589982	-1.9571466182632993	-1.42742166236624	
+18.762023921573693	7.603169417989827	10.506773848433008	-0.10731364184562366	-8.421020949773984	2.671519127115418	-12.90573090003799	1.5337349175494306	-5.633201536075995	-1.6395674168154641	3.732198693670462	7.091560717091014	-2.734096402805604	-3.121327535599854	-5.073057862217715	-7.861170715802762	-10.167679964534793	-1.3663956405279785	1.8929549575926732	-1.3182120966214756	
+3.7528661274412682	9.461310045783199	0.5474155840502484	5.810151850741356	-3.4651920348516807	2.3274362061995286	1.5337349175494317	-8.804609751716088	-1.9520727691940416	10.406799785115883	3.2634418131593934	1.7981824760713174	-4.812484166604429	8.646910454407582	0.11139381983609362	1.3602106591213912	-9.695643267498834	6.101906327416668	0.6473584904189225	-0.5755319040200291	
+0.28121639201866505	-9.461579070382736	2.6897792390518265	-14.687389154906995	-4.687271661753704	-0.6136314649467968	-5.633201536075995	-1.9520727691940416	-12.67353461195514	0.6650967131692817	-5.460874905036822	-10.343558571316906	11.934723443962762	-13.960991851539942	-1.421569136893587	-1.4791079968778875	0.5996120040146092	-16.47174717086853	2.272879995719939	0.2159097220222682	
+-6.278466836848595	-7.207951172903882	3.739564407095735	1.2942514446323732	8.365646416512169	-1.9431776187576344	-1.6395674168154641	10.406799785115883	0.6650967131692824	-4.1794394668456585	-2.567535066970246	-3.615880773314827	-2.6626835747215223	4.731598267735182	-9.550096367548518	5.62270500532086	1.8624706787518506	-0.4762221915071651	3.9277011598909057	-14.536852418124084	
+0.3953742846744809	-1.6195998498247033	-8.489937320477344	2.359707488627015	-7.135378578830198	-1.1369148747614195	3.732198693670462	3.2634418131593934	-5.460874905036822	-2.567535066970246	-17.145729354926097	-6.373485194021169	-1.681966302545306	-3.121367197476597	11.603007784929142	-9.08561991496747	-0.4845099229160576	-10.40500848939152	1.9965448129775931	-1.6054376037308222	
+0.831439912951254	-6.241006590232494	2.246951204202501	1.3401205474326139	-2.452878575871855	-4.8809733220250635	7.091560717091014	1.798182476071317	-10.343558571316905	-3.615880773314826	-6.373485194021169	-8.265686443513118	2.2325611587187812	1.7996899466393699	2.5085445706461487	2.8547364960523707	5.1754968571926305	-6.768732251390196	8.381249870847622	-5.798181387684865	
+-5.428085578922676	1.9762714033360405	11.833258287679884	10.015664888604963	3.6844408766059584	-5.579472015049852	-2.734096402805604	-4.812484166604429	11.934723443962762	-2.6626835747215223	-1.6819663025453064	2.232561158718782	-25.660005523817816	20.212199949101436	-1.9308923644751288	1.7823098308265315	-4.478642897226296	8.152398124381039	14.332405267589067	-10.597619658916907	
+11.402016754316275	-2.052517211180783	-1.3597396801444896	-3.6461056473372957	-9.155315302115495	-4.4326869427441284	-3.121327535599856	8.646910454407582	-13.960991851539944	4.731598267735182	-3.121367197476597	1.799689946639369	20.212199949101436	-21.84528388312185	-0.1028089709530873	-7.363659575819789	-2.285897430761721	-10.901044928716322	-6.596174078176603	1.0016518316670775	
+5.655663256670048	-0.22817152128876603	0.913239821292777	9.728472366102737	6.700645959111942	5.2959521237463845	-5.073057862217715	0.11139381983609428	-1.4215691368935885	-9.550096367548514	11.603007784929142	2.5085445706461487	-1.930892364475132	-0.1028089709530876	-17.644477596098625	-0.6001417658960464	-0.1161950965015385	12.070404217918304	-6.015429634137089	-9.562711112432622	
+-0.058670531068622384	4.223978936352319	3.8221878166705427	-1.705293925643765	-4.944448952544983	1.9610240678922826	-7.861170715802762	1.3602106591213912	-1.4791079968778882	5.62270500532086	-9.08561991496747	2.8547364960523707	1.7823098308265324	-7.363659575819791	-0.6001417658960454	-18.865852643705388	-7.821317224304395	-5.4929996302655955	0.18508863597529185	-3.8375806901353404	
+5.515452406496386	8.484656860929912	10.811174987758909	-1.3227314695767547	-4.0727728553469	-0.09815509311821427	-10.167679964534793	-9.695643267498834	0.5996120040146096	1.8624706787518497	-0.4845099229160575	5.175496857192631	-4.478642897226296	-2.2858974307617212	-0.11619509650153825	-7.821317224304395	-14.048458283499574	0.4736979273815786	5.680459381894895	0.2405514897188384	
+4.541499501881037	-2.5323531608916894	-3.3860861056001363	7.456050537136911	-1.7920742071392397	-9.49530292589982	-1.3663956405279796	6.1019063274166685	-16.47174717086853	-0.476222191507165	-10.40500848939152	-6.768732251390195	8.152398124381037	-10.90104492871632	12.070404217918306	-5.492999630265596	0.4736979273815788	-15.218935933358178	2.2196531221689333	0.2877111019414086	
+-1.4332964567924191	13.572199077494327	0.7673672410965122	1.6434485183446113	4.897836334881997	-1.9571466182632993	1.8929549575926736	0.6473584904189214	2.272879995719939	3.9277011598909057	1.9965448129775936	8.381249870847622	14.332405267589065	-6.596174078176603	-6.015429634137089	0.185088635975292	5.680459381894895	2.219653122168933	-15.510408290037052	-6.635375968305978	
+-4.706571408475184	-6.034081475589381	2.61215980003476	1.4462135365380577	3.0439805615640254	-1.42742166236624	-1.3182120966214765	-0.5755319040200291	0.2159097220222691	-14.536852418124083	-1.6054376037308216	-5.798181387684865	-10.597619658916907	1.0016518316670768	-9.562711112432623	-3.837580690135339	0.24055148971883913	0.2877111019414079	-6.635375968305977	-20.317266658083756	
+1.0	0.0	0.0	1.0	0.0	0.0	1.0	0.0	0.0	0.0	1.0	1.0	0.0	0.0347	1.0	0.1028	1.0	1.0	0.0108	0.7889	
\ No newline at end of file
diff --git a/examples/tuning_instances/tuningH020-100-4.in b/examples/tuning_instances/tuningH020-100-4.in
new file mode 100644
index 00000000..cdaf82d9
--- /dev/null
+++ b/examples/tuning_instances/tuningH020-100-4.in
@@ -0,0 +1,23 @@
+20	155.436723	155.436723	True	0.3686	0.002	4	2
+34.912753550449175	-2.4486645268655707	11.295416891861398	20.461948573357297	-35.498050185089056	-8.966188998125183	-14.289370548761738	13.46110400425205	3.0023653659964378	13.200946643297257	-19.306513533802985	10.483571050857847	20.96846851464423	10.094893992632265	-7.496449915162614	-4.474491762180591	7.887759942771549	13.553962204835692	-12.411149625360805	18.70803607343487	
+-9.713720321446315	3.11685805612748	-1.7175051077424937	-1.193601438114878	4.91117745177065	4.786794951142908	-7.000360789249227	-1.1896024298098313	10.19548713829485	-11.821012604626358	4.566769191276772	-0.1962624628158175	8.133777511498144	-4.155659602997879	7.165758593996782	6.411986045370064	-4.188267105653213	-11.633090078917558	2.9617294286387486	-6.190924797279009	
+3.11685805612748	6.136954359828934	5.754868191835574	0.7243184323111534	2.3238044515708576	1.3397740700720941	0.44488302883672287	-2.023047563983322	-0.4153191371278158	3.3722606705266753	1.3753920794095995	4.3212328683055805	-4.1716814654332985	6.606039506632164	-1.358563129212947	0.28343125452645884	1.121476413599371	-0.6074260946990185	5.3244023953649675	1.8054923779725567	
+-1.717505107742494	5.754868191835574	-13.975816098979013	-5.348972807315042	2.2589799623208284	6.421206629989648	1.8116743613208592	-7.265728557375272	6.232644542115855	-2.3804848097954068	1.6093529764204737	-11.325880885265724	13.461762198094116	-8.70223039142306	2.039674956812241	8.70110466660105	2.2876022192051755	-5.609666052473025	-0.1520128824366785	-10.238224847838753	
+-1.193601438114878	0.7243184323111528	-5.348972807315041	-5.963541894935321	-2.1048925021676754	-4.3345627958893775	-3.904630238346394	9.62055889889569	-5.140363519178407	-1.8048079826670451	2.108473870407637	-6.753292684798176	2.363712426428194	0.27767293825546585	7.562616540453672	4.599582339371074	1.6381341236386395	0.6133111614064298	-9.000840064345772	-4.559564834090023	
+4.91117745177065	2.3238044515708576	2.258979962320828	-2.1048925021676768	-7.090456704448198	-4.320964894097199	-1.2852911724255762	2.313259826166977	-1.8705933681176459	3.7442436862950697	-0.5761782165758005	6.676728720329918	-3.081280908426919	5.341764055641934	2.294389360796542	3.075209110785517	9.420457753522221	7.667452258470812	-4.42609339411227	5.383684157502734	
+4.786794951142908	1.3397740700720933	6.421206629989648	-4.334562795889377	-4.320964894097199	4.706400941239829	3.780788168888242	-3.9371243729369354	-4.5456367580827415	5.732931610438377	-2.9813772729809718	6.264039322876689	-7.994160935330726	3.3499106348857817	-0.2887000973781903	-8.942366023288644	-2.0505618317661716	6.421642656754009	6.477125942469207	10.933693419453839	
+-7.000360789249227	0.4448830288367232	1.8116743613208592	-3.904630238346394	-1.2852911724255762	3.7807881688882423	4.7157004866644945	1.0974408102075905	-0.0768974522728018	-4.447015026416779	1.8853628711280321	-1.3250161183792586	-0.21240300391970027	2.6496981899104624	3.9040982169490537	-2.3283910856781116	-4.850817172815263	-7.159071937882499	6.88330632051876	1.523879420125912	
+-1.1896024298098313	-2.023047563983322	-7.265728557375272	9.620558898895686	2.3132598261669766	-3.9371243729369354	1.0974408102075908	-0.04742409909894618	3.4027398523074317	-1.0163704480237286	-0.1490037240739171	-8.762125319769927	10.868090780479552	-6.44185927031445	-4.4835225587497325	6.380105514750868	-0.5487463866424127	-4.663041476485179	-4.330017693128371	-7.9457778960747145	
+10.195487138294851	-0.4153191371278158	6.232644542115856	-5.140363519178406	-1.870593368117646	-4.5456367580827415	-0.07689745227280186	3.4027398523074313	1.2333001816187936	2.0287175055157785	1.4336453405849068	7.772061378890113	-5.883508436824292	2.9851770670406754	2.574281645249749	-9.198841719769206	-1.795810303125594	1.7121978447696289	-0.9921583978318531	5.187866117640707	
+-11.821012604626358	3.3722606705266753	-2.3804848097954068	-1.8048079826670451	3.74424368629507	5.732931610438378	-4.447015026416779	-1.0163704480237286	2.0287175055157785	-8.96219280303848	4.019993469949689	0.7541132297566555	4.130373122247744	0.4271922203362262	8.372614609619445	3.5261892584294316	-5.623021364638421	-6.478977561032465	5.689071172602323	-1.1312023357522578	
+4.566769191276772	1.3753920794095997	1.6093529764204733	2.108473870407637	-0.5761782165758004	-2.981377272980972	1.885362871128032	-0.14900372407391732	1.4336453405849068	4.019993469949689	3.0471544811735884	-0.6477903654104138	-1.5077307280459933	4.114827127847029	-0.6124070643927335	-0.6954472091927202	2.026740500850526	-3.683707338199296	1.351483409995997	-1.8598748246254921	
+-0.1962624628158176	4.32123286830558	-11.325880885265725	-6.7532926847981765	6.676728720329918	6.26403932287669	-1.3250161183792584	-8.762125319769927	7.772061378890112	0.7541132297566551	-0.6477903654104138	-8.09739623793514	6.885781135828604	-5.552206574203914	-3.554419416590108	11.981922316333886	5.768661756360959	-1.262856117110325	-2.836670150117397	-8.210648723463661	
+8.133777511498144	-4.1716814654332985	13.461762198094116	2.3637124264281955	-3.0812809084269186	-7.994160935330727	-0.2124030039197008	10.868090780479552	-5.883508436824292	4.130373122247744	-1.5077307280459933	6.885781135828604	-9.750888688929399	7.099587437416332	-1.2662858263233994	-10.57704402234864	-2.6180522479334845	5.21879248134366	-1.230306709928468	6.3433074323115095	
+-4.15565960299788	6.606039506632164	-8.70223039142306	0.277672938255465	5.341764055641934	3.3499106348857817	2.649698189910463	-6.441859270314449	2.9851770670406754	0.42719222033622606	4.11482712784703	-5.552206574203914	7.099587437416332	0.16457618197853385	2.3091108006347305	6.279585577286547	-0.10994957477936262	-4.930092536837599	3.383190595926791	-6.93968649393352	
+7.165758593996782	-1.358563129212947	2.039674956812241	7.562616540453674	2.2943893607965418	-0.2887000973781897	3.904098216949054	-4.483522558749733	2.574281645249749	8.372614609619445	-0.6124070643927333	-3.554419416590109	-1.2662858263233991	2.3091108006347305	-10.004871380704053	-0.5298932589681561	4.115657793154512	-1.889205275831269	2.8219556320147183	-4.742261121446059	
+6.411986045370064	0.28343125452645884	8.70110466660105	4.599582339371074	3.075209110785517	-8.942366023288645	-2.3283910856781116	6.380105514750868	-9.198841719769206	3.5261892584294308	-0.6954472091927203	11.981922316333888	-10.57704402234864	6.279585577286547	-0.529893258968156	-7.035232104280679	-5.5249621935516995	7.717062272146012	-4.236609692869716	9.258819693277035	
+-4.188267105653213	1.1214764135993707	2.2876022192051764	1.6381341236386393	9.420457753522221	-2.050561831766171	-4.850817172815263	-0.5487463866424129	-1.795810303125595	-5.623021364638421	2.0267405008505266	5.768661756360959	-2.6180522479334845	-0.10994957477936243	4.115657793154512	-5.5249621935516995	-15.559443256327262	-5.308133928666249	0.8578322416558087	6.740280298139737	
+-11.633090078917558	-0.6074260946990192	-5.609666052473024	0.6133111614064295	7.667452258470812	6.421642656754009	-7.159071937882498	-4.663041476485179	1.7121978447696287	-6.4789775610324645	-3.683707338199297	-1.262856117110325	5.21879248134366	-4.930092536837599	-1.8892052758312687	7.717062272146012	-5.308133928666248	1.0221328854452314	-1.7745721042339664	2.684001572956976	
+2.9617294286387486	5.3244023953649675	-0.15201288243667835	-9.000840064345773	-4.42609339411227	6.477125942469206	6.88330632051876	-4.330017693128371	-0.9921583978318532	5.689071172602322	1.3514834099959974	-2.8366701501173965	-1.2303067099284681	3.383190595926792	2.8219556320147183	-4.236609692869717	0.8578322416558082	-1.7745721042339673	6.641078311014249	1.7839040229600545	
+-6.190924797279011	1.8054923779725567	-10.238224847838753	-4.559564834090023	5.383684157502735	10.93369341945384	1.523879420125912	-7.945777896074715	5.1878661176407075	-1.1312023357522583	-1.859874824625492	-8.21064872346366	6.3433074323115095	-6.93968649393352	-4.742261121446056	9.258819693277035	6.740280298139735	2.684001572956976	1.7839040229600553	-11.7587886954242	
+1.0	1.0	0.7891	1.0	0.0	0.0	0.0	1.0	1.0	1.0	0.0	1.0	1.0	1.0	1.0	1.0	0.1239	0.0	0.0	0.0	
\ No newline at end of file
diff --git a/examples/tuning_instances/tuningH020-100-5.in b/examples/tuning_instances/tuningH020-100-5.in
new file mode 100644
index 00000000..fb2da8d5
--- /dev/null
+++ b/examples/tuning_instances/tuningH020-100-5.in
@@ -0,0 +1,23 @@
+20	217.580634	217.580634	True	0.0413	0.002	5	2
+12.698418954325042	-1.7583736734363633	20.97888070078338	35.96397681627571	-12.601607399999297	-47.38132610444342	51.97606807816625	17.357426723596653	21.64579850733692	15.114008439145646	-16.795992192932086	-22.6602168679459	2.564718815184799	-0.5886986201741493	4.113728675095469	-16.53459461042289	17.2372807963731	-10.40865549433995	-49.61369700666051	19.330677878317665	
+-7.207007591961684	-9.95080707845184	-1.36744487444813	-3.295125234584952	7.062722591121803	6.2783129062900915	4.549384885052239	6.457204404078908	1.8414655559516138	2.0979438726449398	-5.6041971742671315	0.783173067650926	-1.8062468412454478	-7.949975696868199	-1.9823180200518267	2.2949064445645626	6.059985573007375	-7.818749986906228	0.45826348711812176	-0.1478304340487132	
+-9.95080707845184	-9.51634188879449	1.1911689185070944	-11.579463493529117	-4.233537553240539	0.03777510551677695	2.375209365093141	3.0179215039245877	-7.82526705601682	5.7075485931556225	-4.5726560618040795	-1.9966582083871576	-3.026394614997166	-0.5333829441859914	-2.7741430849989044	-2.774848939455629	5.304049096417221	-0.7881203725364824	4.0794094951378	-5.305153066270269	
+-1.36744487444813	1.1911689185070944	-4.052807684674899	-3.35588507472834	-1.6119772827994747	-2.63340009863109	-2.246345167035176	-2.853483275435406	-4.723409504935531	4.180015865382888	6.6881321302865775	-2.035854083486599	-4.2856771859459695	-4.018699730433107	-9.502731644739221	-1.554621113983274	-0.8920198759010604	-0.5291216760486805	-0.7563915261380372	-6.636860639342379	
+-3.2951252345849524	-11.579463493529117	-3.35588507472834	-2.376185493930712	-2.867849719899691	-3.053338538448589	1.67100638671961	1.5542980834262323	-1.8289705159129734	2.452210553095391	-3.9736316607275346	-9.93798727037023	-4.190030978856498	-0.23756377712019355	-9.756359024113003	-9.6292573234599	-0.5202874029310786	4.204421618721599	10.123274214778743	-12.027594262684955	
+7.062722591121803	-4.233537553240539	-1.6119772827994747	-2.8678497198996906	2.817252427422328	9.57164298240325	-9.325806585739496	-7.7071583941240185	3.1550719461121632	-5.8208184593383585	-4.398288183559246	-7.77964049263353	1.9798776138026146	7.032745587695053	1.430507958877123	4.028494129858865	-4.52449121579985	3.4485532292987116	20.19790032458752	-7.266344534865669	
+6.278312906290093	0.03777510551677662	-2.6334000986310904	-3.053338538448589	9.571642982403247	23.506273262486282	-14.044601647666926	-7.149687568349556	-3.2797682703651283	-5.334342889254989	1.849288851354397	11.617227941917246	-0.4703595867946275	-1.3076820620862613	3.920046827478729	15.417225748691804	-4.355333557896001	8.000021457618463	15.040664525294822	9.860968691305452	
+4.549384885052239	2.3752093650931423	-2.2463451670351766	1.67100638671961	-9.325806585739496	-14.044601647666926	9.525239337417492	-2.5566369396869293	8.613724733812177	1.3513205542683677	0.9342504493172028	-16.26286917616331	-2.456183650424681	6.811573905579045	-4.721285331227616	-9.149461360637273	3.876246846948933	2.275803553957038	-2.4620147687618497	-14.690795120760333	
+6.457204404078909	3.0179215039245872	-2.853483275435406	1.5542980834262328	-7.7071583941240185	-7.149687568349558	-2.5566369396869306	-18.426413565863793	-10.849628117666313	-1.3284130435885033	13.103913643697828	-3.966465951932717	1.9519525558095805	10.649386958843722	-6.677876986727078	6.045896029631385	-8.188967143615095	10.878824226030623	-2.773107144670199	-3.3394194939219313	
+1.8414655559516138	-7.82526705601682	-4.723409504935531	-1.8289705159129732	3.1550719461121624	-3.2797682703651296	8.613724733812177	-10.849628117666313	1.7671934188859721	7.04170943350588	1.376904633712621	-19.768837892005585	-4.870608084278647	-0.8729173820678978	-4.086807384029373	3.7149915063487606	10.544809409909767	0.1855295663128077	5.521932254473003	-8.868236143805678	
+2.0979438726449393	5.7075485931556225	4.180015865382888	2.452210553095391	-5.820818459338359	-5.334342889254988	1.3513205542683677	-1.3284130435885033	7.04170943350588	-0.9274675667961279	-3.6887165212711186	-7.290373985143532	9.490085210391799	6.305450936008061	4.3037432221509375	-0.7600282518515004	3.0213406840448824	-6.516373624405864	-5.4345538319344	-9.96758704692058	
+-5.604197174267131	-4.572656061804078	6.688132130286577	-3.973631660727533	-4.398288183559246	1.8492888513543988	0.934250449317203	13.103913643697826	1.3769046337126223	-3.6887165212711186	-8.697835893691636	-1.3146529527762871	1.692531606275819	-1.1870304566712058	8.001921870023068	-6.775323263075385	5.177451746152611	-2.8074178186777563	5.642396329698174	1.4324627997724082	
+0.783173067650926	-1.9966582083871567	-2.0358540834865995	-9.937987270370233	-7.779640492633528	11.617227941917246	-16.26286917616331	-3.966465951932717	-19.768837892005585	-7.290373985143533	-1.314652952776287	24.886271159221735	-0.2445367403517585	-3.907113542933981	0.19791503477498146	5.1009748421001655	-15.548594583841128	17.817410388847254	0.8118185012745844	20.11682326995492	
+-1.8062468412454478	-3.0263946149971663	-4.28567718594597	-4.190030978856498	1.9798776138026146	-0.4703595867946276	-2.456183650424681	1.9519525558095805	-4.870608084278649	9.4900852103918	1.6925316062758184	-0.24453674035175846	-10.19494600250399	-2.864495635475689	-2.137202453660139	0.5051549960024635	8.745239255805227	4.1947563550230225	-0.027394220943055315	-0.9104690662010214	
+-7.9499756968682	-0.5333829441859912	-4.018699730433107	-0.23756377712019378	7.032745587695052	-1.3076820620862615	6.811573905579044	10.64938695884372	-0.8729173820678973	6.30545093600806	-1.1870304566712047	-3.907113542933981	-2.8644956354756888	-5.93844582145062	-8.152475502470335	-9.473516134843406	4.836967837403357	-3.9474159411984435	0.6599618623304895	-9.131293906418847	
+-1.9823180200518271	-2.7741430849989044	-9.502731644739221	-9.756359024113001	1.430507958877123	3.920046827478729	-4.721285331227616	-6.677876986727078	-4.086807384029372	4.3037432221509375	8.001921870023068	0.19791503477498154	-2.1372024536601395	-8.152475502470335	-4.731073973307625	2.1154318207230696	-2.8976905059183076	2.7732040158065354	9.549983639605614	-3.2727961850243763	
+2.2949064445645635	-2.774848939455629	-1.554621113983274	-9.6292573234599	4.0284941298588635	15.417225748691802	-9.149461360637273	6.045896029631384	3.7149915063487606	-0.7600282518515004	-6.775323263075386	5.1009748421001655	0.505154996002463	-9.473516134843406	2.1154318207230687	6.457051860626646	1.0303729256521503	-2.9156251351588387	9.95538322887719	1.9020539703276533	
+6.059985573007373	5.304049096417221	-0.8920198759010605	-0.5202874029310784	-4.52449121579985	-4.355333557896	3.876246846948932	-8.188967143615093	10.544809409909766	3.0213406840448833	5.17745174615261	-15.548594583841128	8.745239255805226	4.836967837403357	-2.897690505918307	1.030372925652151	0.5348051932962998	-4.665792953723533	4.247988268691953	-14.124842598313139	
+-7.818749986906228	-0.7881203725364827	-0.5291216760486804	4.204421618721599	3.4485532292987116	8.00002145761846	2.2758035539570374	10.878824226030623	0.1855295663128072	-6.516373624405864	-2.8074178186777567	17.817410388847254	4.1947563550230225	-3.9474159411984444	2.7732040158065354	-2.9156251351588396	-4.665792953723534	5.434687275460379	-5.623887236649882	10.430110975658401	
+0.4582634871181217	4.0794094951378	-0.7563915261380365	10.123274214778743	20.19790032458752	15.040664525294822	-2.4620147687618497	-2.773107144670199	5.521932254473003	-5.4345538319344	5.642396329698174	0.8118185012745842	-0.027394220943055162	0.6599618623304897	9.549983639605614	9.95538322887719	4.247988268691953	-5.623887236649882	13.191041246602927	2.263567560198106	
+-0.14783043404871224	-5.305153066270267	-6.636860639342379	-12.027594262684955	-7.266344534865669	9.860968691305452	-14.690795120760333	-3.3394194939219313	-8.868236143805676	-9.967587046920581	1.4324627997724086	20.11682326995492	-0.9104690662010212	-9.131293906418847	-3.2727961850243763	1.9020539703276524	-14.124842598313139	10.4301109756584	2.263567560198106	5.915763295406628	
+1.0	0.0	1.0	1.0	0.0	0.0	1.0	0.5708	1.0	1.0	0.0	0.0	0.1413	1.0	0.0	0.0	1.0	0.0	0.0	0.0	
\ No newline at end of file
diff --git a/examples/tuning_instances/tuningH020-100-6.in b/examples/tuning_instances/tuningH020-100-6.in
new file mode 100644
index 00000000..93891370
--- /dev/null
+++ b/examples/tuning_instances/tuningH020-100-6.in
@@ -0,0 +1,23 @@
+20	190.208978	190.208978	True	0.0508	0.0031	6	0
+7.516315537601432	5.595329205246269	-12.500799213590792	16.308220273243666	4.1749976585145685	21.15023585421704	-17.165284455514538	-15.511110938172983	-0.9715280594578095	4.0111149193827975	19.740228284606292	-18.91928135321514	-3.8690387187121935	37.714923085309884	-14.960659468887542	-5.48045530511963	-0.26504971343432615	39.4254632986742	-49.07064550479592	-0.6089474917048765	
+-8.075404125776764	-1.3824364912666067	4.71148860898121	-9.959811151955467	-3.537237488716347	-4.220340070416237	-1.0366287536027556	7.383920187447704	-6.797644198007666	-9.473623159048572	2.8120544222389827	13.101733602990892	12.755370765549527	5.4091648662562495	12.20197460018218	-0.10198917447350138	-3.2135188601512388	-9.748907496813406	7.738884802635761	-6.311956400723128	
+-1.3824364912666067	11.269289448810541	4.944873093344262	-20.784565820501033	1.823705051930527	-6.381578776859946	-3.9715976321326902	12.909456596102556	-3.889121571956853	-1.4101268283073272	-2.9762520238301375	3.5472557968916356	-8.259540257984531	-8.544195008351995	2.9500868756383607	1.744731518632838	-4.301651894617768	-11.790941586289964	12.011169321001942	1.2281079929424699	
+4.71148860898121	4.944873093344262	-1.648478610216919	-2.157770827290106	-6.523594081310232	1.7864892140053197	3.457917586624488	4.962144401028326	-0.667973097458394	0.3731419387371748	-9.36774742017107	0.7911145952366154	-2.250206224455498	-19.00354931491198	-0.9402566759717031	4.247857916104994	-6.529882478869991	2.368082080610936	4.58444356652768	-9.932666893413233	
+-9.959811151955467	-20.784565820501033	-2.1577708272901055	0.38195310908846186	-0.8615795957237212	-8.122146812498764	1.370973355633725	-9.849786175968607	-7.5267217731837315	3.076258295675485	-4.551994407176337	1.7790036769325557	9.803622136545439	-6.67353278385725	2.9148986987698065	8.257256978405701	-2.1924268749479094	-3.018775115941648	-1.6082708336221765	1.1788776761597308	
+-3.537237488716348	1.8237050519305265	-6.523594081310232	-0.8615795957237217	4.182068379485822	10.333841974752701	3.880963735712005	4.2800440294573665	-9.222619274716102	-2.748251348983614	2.9589725888707235	-10.94496824170003	-0.00784764275083896	5.8299608085225145	7.2352456961002884	2.965769476348683	-6.83008939450769	-5.69631193271541	6.048027438559371	-9.90090755374634	
+-4.220340070416237	-6.381578776859947	1.7864892140053197	-8.122146812498764	10.333841974752701	14.533103799357635	-4.158143706773801	-5.34341103167494	-12.31306041816113	1.2722446696979208	-11.899596351127927	-7.726306099193339	7.572333104644341	3.119201491987476	3.2275353564765137	8.707561960230137	-1.7771565349046383	-3.0862827332630896	5.497284130417358	-12.401761389515208	
+-1.0366287536027554	-3.9715976321326902	3.457917586624487	1.370973355633724	3.880963735712004	-4.158143706773801	2.619469612372375	-3.510353370880105	-0.02139676236289742	-0.5850765068996132	2.438096784820716	4.009662145809765	1.0396898028684025	-10.992198811346812	9.895689024037546	-1.9114232504133015	-7.980787364281665	0.6566539416613769	-3.7935574643184333	1.2902588198710014	
+7.383920187447705	12.909456596102554	4.962144401028326	-9.849786175968607	4.2800440294573665	-5.343411031674939	-3.5103533708801056	10.953583106839295	5.734969152546807	-14.29008969817128	1.3093938293296872	11.879408660493604	0.43682963886421344	2.944557367265148	-7.158126799611636	1.8567296371318973	3.0684591013849603	-3.088602346146852	4.648256331816794	1.3014851336844295	
+-6.7976441980076645	-3.889121571956853	-0.6679730974583943	-7.5267217731837315	-9.2226192747161	-12.313060418161133	-0.021396762362897143	5.734969152546807	7.095911873153661	0.9443653987950196	8.1745589091665	4.582411005559366	2.725868074110834	-4.787811941405181	4.218362856223326	-3.547340812156445	9.201867541858523	-6.0548309168013885	7.570979493879875	6.893297086989026	
+-9.473623159048572	-1.4101268283073272	0.373141938737175	3.0762582956754856	-2.748251348983615	1.2722446696979217	-0.5850765068996133	-14.29008969817128	0.944365398795019	3.114773001233316	-2.576026056104827	1.8978439321735812	-6.692519817872601	-1.503325856434085	-6.794734913308022	5.918408366890314	9.726276147756185	7.5911655821765915	-3.8499713025189286	7.630480993959747	
+2.812054422238983	-2.9762520238301358	-9.367747420171069	-4.551994407176336	2.958972588870724	-11.899596351127927	2.4380967848207167	1.309393829329686	8.174558909166501	-2.5760260561048276	2.6884165141221774	-2.1218967465020784	-8.384103486378356	-16.799542857229223	4.205649150190799	-1.9131513033711933	-7.0643547865282175	-10.850211091417984	-2.3834781114479053	-0.9290975184865525	
+13.101733602990892	3.5472557968916347	0.7911145952366154	1.7790036769325555	-10.94496824170003	-7.726306099193338	4.009662145809766	11.879408660493603	4.582411005559366	1.8978439321735823	-2.121896746502077	12.171168047787715	4.9267396180131815	-6.836843798409845	0.19111790350249608	-5.441859520591564	1.146666413863834	-12.897209200952886	10.38464301601686	5.294933264968367	
+12.755370765549529	-8.25954025798453	-2.250206224455499	9.80362213654544	-0.007847642750838978	7.572333104644344	1.0396898028684025	0.43682963886421294	2.725868074110834	-6.692519817872602	-8.384103486378358	4.926739618013182	18.89413325076182	0.5272869927329747	-5.045963441902616	6.2017114307590235	1.8414850439456583	0.0816509109845037	2.4476246376117774	-3.1029460529839	
+5.4091648662562495	-8.544195008351993	-19.00354931491198	-6.67353278385725	5.8299608085225145	3.1192014919874755	-10.992198811346812	2.944557367265149	-4.787811941405182	-1.503325856434085	-16.799542857229223	-6.836843798409844	0.5272869927329757	-8.894233611364735	-13.814908933613935	15.686820061046095	-7.319246964191267	1.8572980752232495	4.265630868594838	-16.09336073227841	
+12.201974600182181	2.9500868756383603	-0.9402566759717039	2.9148986987698065	7.235245696100288	3.2275353564765146	9.895689024037546	-7.158126799611636	4.218362856223327	-6.794734913308022	4.205649150190799	0.19111790350249538	-5.045963441902616	-13.814908933613934	7.372412730136682	-1.0645108004454495	-0.08526728072562775	-5.6279859997189225	-3.6024693037214175	-0.04425568732669069	
+-0.10198917447350067	1.7447315186328378	4.247857916104994	8.2572569784057	2.965769476348683	8.707561960230136	-1.9114232504133015	1.8567296371318973	-3.547340812156446	5.918408366890314	-1.9131513033711933	-5.441859520591564	6.2017114307590235	15.686820061046095	-1.0645108004454493	-1.4106818363069376	-5.726270187596815	3.677387214702436	-2.3347884268735624	2.6659598396187474	
+-3.213518860151239	-4.301651894617768	-6.5298824788699905	-2.1924268749479094	-6.830089394507689	-1.7771565349046383	-7.980787364281665	3.0684591013849594	9.201867541858523	9.726276147756183	-7.0643547865282175	1.1466664138638336	1.8414850439456576	-7.319246964191267	-0.08526728072562731	-5.726270187596815	3.393210984371281	-0.3546006387505478	9.541785474101573	-5.359089460071046	
+-9.748907496813404	-11.790941586289964	2.368082080610937	-3.018775115941648	-5.696311932715411	-3.08628273326309	0.6566539416613774	-3.0886023461468533	-6.054830916801389	7.591165582176592	-10.850211091417986	-12.897209200952888	0.08165091098450364	1.85729807522325	-5.6279859997189225	3.677387214702436	-0.35460063875054804	-5.392494100795187	1.451747383144235	1.9189025519935154	
+7.738884802635761	12.011169321001942	4.584443566527681	-1.6082708336221792	6.048027438559372	5.497284130417358	-3.7935574643184338	4.648256331816795	7.570979493879874	-3.849971302518928	-2.3834781114479053	10.384643016016861	2.447624637611778	4.265630868594838	-3.6024693037214175	-2.334788426873562	9.541785474101571	1.4517473831442351	13.089923383206248	2.6357653248358504	
+-6.311956400723129	1.2281079929424707	-9.93266689341323	1.1788776761597308	-9.90090755374634	-12.401761389515208	1.2902588198710012	1.3014851336844306	6.893297086989026	7.630480993959747	-0.9290975184865524	5.294933264968367	-3.102946052983901	-16.093360732278413	-0.044255687326690274	2.6659598396187483	-5.359089460071044	1.918902551993516	2.6357653248358517	12.71696747714918	
+0.0	0.0	0.0	1.0	1.0	1.0	0.0	0.0	0.0	1.0	0.0	0.0	1.0	1.0	0.0	1.0	0.0	1.0	0.0	0.0	
\ No newline at end of file
diff --git a/examples/tuning_instances/tuningH020-100-7.in b/examples/tuning_instances/tuningH020-100-7.in
new file mode 100644
index 00000000..553a50f0
--- /dev/null
+++ b/examples/tuning_instances/tuningH020-100-7.in
@@ -0,0 +1,23 @@
+20	153.50106	146.312845	True	0.0423	0.0023	7	2
+-17.467183710512266	12.321637993646522	-2.5336821260237654	-17.88671747424595	4.733939665954583	1.7232018836183127	20.535198610476087	20.929559473944895	-33.44159108955688	-8.820671453115363	-30.243259762298614	-19.279812302669598	30.13427960593378	-5.102484562301747	-42.82831913053643	-1.0015602457729909	6.093616205297813	-9.953785574678546	19.71673605916554	-29.085366329651702	
+8.308408502971146	-9.086418526804636	1.1885087281653217	11.396285522207224	4.306982343659738	-9.454037920773926	-13.023149458498194	7.7314092171458855	6.490272958104134	6.8312776194330755	-0.2976533708275092	5.537641121141068	1.6905657834928836	6.574045029467604	3.9447101596909406	-1.342900926242761	-1.103048902997217	7.115275625873395	4.434761267943776	1.2093921652218804	
+-9.086418526804637	2.993746124782624	-5.79370910028273	-2.2023755602223	-5.394571053074837	6.820238672031046	15.455328768150196	-1.5896492927554429	-9.394248923747663	-5.9878836824107795	-1.1853169252655362	0.3925468466986003	4.42894076719787	1.8082041638425206	-4.425590305218325	6.105926594175768	8.730147077439586	2.298952251440705	2.338938683354973	-0.09858646730327889	
+1.1885087281653226	-5.7937091002827295	-10.040731837362857	0.09301747101690441	3.1479055621384484	-3.3919092263234147	-10.304386217637854	0.7639646592655274	4.660244576047981	3.6930016283013107	6.894005324079788	-1.8763262622944232	1.606123654349274	9.784524439548811	2.276614542524758	3.6203014280195833	-2.3791624851373254	-2.17901253432046	-4.6572670382519705	-0.06715977511533286	
+11.396285522207222	-2.202375560222299	0.09301747101690384	14.360810383863033	8.462081435242151	2.1728245276031437	-11.895370975548204	-4.479729340299061	4.951473940164977	3.9655618391438012	-4.781860199675753	2.8293486473394265	1.1091923787901992	-4.5266397015511854	1.4589078033245286	-2.1624800230649934	6.018148481828024	8.918960035134642	7.2650054682476055	-4.44549130399363	
+4.3069823436597385	-5.394571053074837	3.147905562138448	8.462081435242151	-5.440210918537464	-1.3803626292895683	11.705624790125288	6.267691493362783	-4.058257027319778	6.166619913216448	1.4330557956920797	10.545303160878882	0.1858635574916965	1.0397030701540315	-2.681630228943211	3.681359381193958	3.8319127722830926	-0.9824140281140418	-0.6659057131507814	1.4103748014028552	
+-9.454037920773926	6.820238672031046	-3.3919092263234143	2.1728245276031433	-1.380362629289568	4.322876970560573	12.43744756012212	11.592477405075485	-11.016176976618294	-1.9897017840166469	-7.325592759543408	-6.52757713595954	7.731976434276994	-4.496784271695248	-5.7702266149560435	2.9030171630806274	1.3121073893577697	12.44194602433277	4.779272321505651	-7.544092996334851	
+-13.023149458498194	15.455328768150196	-10.304386217637854	-11.895370975548204	11.705624790125288	12.43744756012212	8.1412902861277	-8.707299981627495	0.07385336939244529	-5.050983726146798	6.3753718761208376	-11.252164863256356	-6.410382411039695	-0.6270779223962536	-3.070167148847136	4.33575307208924	-2.901438587899648	-12.724019018280632	-2.871883766875706	-3.0817012408113476	
+7.7314092171458855	-1.5896492927554424	0.7639646592655274	-4.47972934029906	6.2676914933627845	11.592477405075485	-8.707299981627493	-15.601351136237549	14.47916035683912	-8.838012166464697	-2.1819801254710356	3.060683480967337	-7.980389115227025	-6.92956161735357	2.1346237507991406	0.12832041867704685	2.2393117649192456	-4.468347887591594	2.2630393593922133	-0.9488438318936213	
+6.490272958104134	-9.394248923747663	4.660244576047982	4.951473940164977	-4.058257027319778	-11.016176976618294	0.07385336939244466	14.479160356839122	-4.5954031465737915	4.708317695468635	-7.529103107072353	-1.3587967805113497	9.744624482053032	0.5194495671184169	1.828018907136217	1.0036646650833554	-0.4408344833173605	5.7951332438380545	4.802248263602302	7.11170471300753	
+6.8312776194330755	-5.987883682410779	3.6930016283013107	3.965561839143802	6.166619913216449	-1.9897017840166473	-5.050983726146798	-8.838012166464697	4.708317695468635	2.5964587797776866	-2.205627540339831	2.980250719720977	-0.8547756638222861	-6.434450740861204	8.116523312516593	-5.760918692884532	7.723249289864724	-7.329999874551062	6.337260790628973	1.2331926587150388	
+-0.29765337082750926	-1.1853169252655358	6.894005324079788	-4.781860199675754	1.4330557956920802	-7.325592759543408	6.3753718761208376	-2.1819801254710347	-7.529103107072352	-2.2056275403398313	-13.492808279842702	-1.3610971256623956	8.029372392193773	-4.751167506018768	-0.3903558527980388	2.73427887890102	8.349424562106528	1.5487175806315714	7.894159897819965	7.1078412332764795	
+5.5376411211410685	0.392546846698601	-1.8763262622944228	2.829348647339427	10.545303160878882	-6.527577135959539	-11.252164863256356	3.060683480967337	-1.3587967805113497	2.980250719720977	-1.3610971256623958	-11.230332256098844	5.687315768508168	6.1792443156611165	0.32688917583053034	1.0677770955458843	2.9434186368353554	0.030026474901813604	8.16456431416697	7.319947813087161	
+1.6905657834928831	4.42894076719787	1.6061236543492743	1.109192378790199	0.18586355749169614	7.731976434276993	-6.410382411039695	-7.980389115227025	9.744624482053032	-0.854775663822286	8.029372392193771	5.687315768508168	-13.212625198672718	-4.281796065699959	2.1667354180399405	-5.394000420907282	-8.018239990311896	-2.768453608650353	-8.481821700909066	-6.652094346436986	
+6.574045029467603	1.8082041638425208	9.784524439548811	-4.5266397015511854	1.0397030701540315	-4.496784271695248	-0.6270779223962538	-6.92956161735357	0.5194495671184172	-6.434450740861204	-4.751167506018768	6.179244315661116	-4.281796065699959	-16.8675003836336	4.252819843806894	-11.081669661155065	2.552566549627891	-8.72046040528261	13.12803292035299	4.750024309044484	
+3.9447101596909415	-4.425590305218324	2.276614542524758	1.4589078033245293	-2.6816302289432112	-5.7702266149560435	-3.070167148847136	2.13462375079914	1.8280189071362172	8.116523312516595	-0.3903558527980392	0.3268891758305307	2.1667354180399405	4.252819843806895	4.639731266451341	2.4985057286563	-2.51074727971363	-2.1657498587092943	-7.224627008983189	6.918843176649491	
+-1.3429009262427611	6.105926594175767	3.6203014280195833	-2.162480023064994	3.681359381193958	2.903017163080627	4.335753072089241	0.12832041867704697	1.003664665083356	-5.760918692884533	2.73427887890102	1.0677770955458843	-5.394000420907282	-11.081669661155065	2.4985057286563	-4.047414306379611	-1.5603587603621036	-7.144833256719528	5.874201794580518	0.29406692712366256	
+-1.1030489029972164	8.730147077439588	-2.3791624851373254	6.018148481828024	3.8319127722830926	1.31210738935777	-2.901438587899648	2.2393117649192447	-0.44083448331736064	7.723249289864724	8.349424562106528	2.9434186368353563	-8.018239990311896	2.552566549627891	-2.51074727971363	-1.5603587603621036	-7.21802688895628	-1.112221560688825	-7.799773544466336	-4.708148657948155	
+7.115275625873395	2.2989522514407037	-2.17901253432046	8.918960035134642	-0.9824140281140422	12.44194602433277	-12.724019018280632	-4.468347887591594	5.7951332438380545	-7.329999874551062	1.5487175806315716	0.030026474901812854	-2.7684536086503533	-8.72046040528261	-2.165749858709295	-7.144833256719528	-1.112221560688826	7.036161623097451	2.8465494609413677	-12.476535323035735	
+4.434761267943776	2.338938683354974	-4.657267038251971	7.265005468247606	-0.6659057131507805	4.779272321505651	-2.8718837668757065	2.263039359392212	4.802248263602301	6.337260790628973	7.894159897819965	8.164564314166968	-8.481821700909068	13.128032920352988	-7.224627008983189	5.874201794580517	-7.799773544466335	2.846549460941367	-9.47446225848668	0.3642440543751022	
+1.2093921652218809	-0.09858646730327865	-0.06715977511533273	-4.44549130399363	1.4103748014028548	-7.544092996334851	-3.081701240811348	-0.9488438318936218	7.111704713007531	1.2331926587150392	7.1078412332764795	7.319947813087162	-6.6520943464369875	4.750024309044484	6.918843176649492	0.2940669271236626	-4.708148657948155	-12.476535323035735	0.3642440543751023	10.707976567555427	
+0.0	1.0	0.0	0.0	1.0	1.0	1.0	1.0	0.0	0.0	0.0	0.0	0.7354	0.0	0.0	1.0	0.5609	0.0	1.0	0.0	
\ No newline at end of file
diff --git a/examples/tuning_instances/tuningH020-100-8.in b/examples/tuning_instances/tuningH020-100-8.in
new file mode 100644
index 00000000..4f1f7320
--- /dev/null
+++ b/examples/tuning_instances/tuningH020-100-8.in
@@ -0,0 +1,23 @@
+20	240.882708	240.882708	True	0.0483	0.0017	8	1
+0.4227179470155322	-13.808349032372865	32.82810178751545	6.365195028321349	25.066158580552948	11.896929240578503	5.387746672706333	23.19881688442233	13.487797830371896	3.417005696755414	19.729312647970005	27.689572171298742	-22.31934296727354	-12.404975083088232	-5.040598445571913	43.5703627433891	-0.7747901304679576	27.316455794452718	-33.43689299916737	-6.729254757022319	
+12.806478579375044	0.6463341784211206	-13.95892086603349	-0.5655839267469762	-3.6266653726682043	-0.3713119744523482	-4.68568023007388	5.3525010001347475	-13.595510834697215	5.6640901398169685	-1.9416809039822531	5.1007457431279875	4.737198978363992	-2.20687872440639	16.052308243188293	-18.8831462152466	9.252111531192156	-8.53388114376216	8.386151714513087	-5.263923547026181	
+0.6463341784211208	14.506411295557383	-3.613047276563965	6.095789422304506	6.1819416689936695	5.029738150059611	5.434052481944577	-1.327875885834136	2.829939856039798	-3.0336482509482803	-1.6201889515362207	6.077922902613123	-3.5845621959048555	13.167035259116409	-8.282209805239859	2.792639184902085	1.9359806161233422	0.0844638943070632	-0.842786226624753	4.954515329330778	
+-13.95892086603349	-3.613047276563965	5.630060051579637	12.465246056069873	-2.7390502828753687	3.684892320386805	-0.4510446235543744	-14.707027690059245	11.036190887788743	-9.706992869708104	-16.49336784202976	-6.952684959177828	-3.454726846224386	-1.1810815708922813	-7.16824982645246	3.2572070198161667	-9.42943057829365	9.334921773405707	-3.186562492990121	7.332965498653541	
+-0.5655839267469762	6.095789422304509	12.465246056069875	4.6015046469359975	-16.008050711055947	-7.1318542774934865	2.893388461094455	-11.634432368026463	-4.153873036970152	-6.687063959849551	-3.9888397118696846	-17.085680792745585	0.24260757885621523	-8.38075706986446	1.9532907686718772	-0.2692706500600974	-10.96897129258043	8.301317574269001	14.654616218075969	1.2380336575877724	
+-3.626665372668204	6.181941668993669	-2.7390502828753673	-16.008050711055947	-17.125436931778967	-5.36072988129237	-10.776257029145635	-12.339480216134241	2.1106320118196447	-11.34832507311546	3.6846857871718797	-10.298952782945518	0.9808197485316655	2.438220701695899	-8.845047371051963	-0.475203399939583	1.0380767540025497	-3.6649213104622897	4.3853566528661725	-8.63956874858003	
+-0.37131197445234865	5.029738150059611	3.684892320386806	-7.131854277493485	-5.36072988129237	5.691380027152862	6.733041923347789	-0.6028542645151886	2.8953356955737117	-14.603200975527315	-2.726168852531615	-1.7965161334183959	0.410750792073553	-8.798195601021801	3.276881260179938	-3.3318824653460566	1.4536534662990477	5.055746075370922	-2.496110397593398	1.217949499209547	
+-4.6856802300738805	5.434052481944578	-0.4510446235543744	2.8933884610944554	-10.776257029145635	6.73304192334779	-3.878052971832741	-5.013544931547557	-2.0446295921421784	-7.744660589097173	1.5367458248588541	2.2458423205700404	-1.6310642477024146	3.3219494881654286	-11.95548421213262	-5.08002303129827	-0.29866927840268104	-3.8482912126660103	-0.405068362087009	7.150928832538522	
+5.352501000134747	-1.327875885834136	-14.707027690059244	-11.634432368026463	-12.339480216134243	-0.6028542645151879	-5.013544931547557	-9.749507216390612	-4.250196017477325	-9.641334237373085	-3.655767840855621	-3.646020380758003	-3.870515305415113	-5.352755381212173	-3.782366045039878	-6.667960671601334	18.355136836021444	-16.09468989743787	1.0780821647008887	4.465185635261155	
+-13.595510834697215	2.8299398560397977	11.036190887788745	-4.153873036970152	2.1106320118196447	2.8953356955737113	-2.044629592142178	-4.250196017477325	17.790161238041772	-5.526483610197816	4.171801466578492	1.6633790802480226	-0.20787226865014125	-0.5000090507342523	-14.555530233986547	8.83859094416759	-7.933398828108901	3.6867522501976855	-13.55594194168687	3.6241249060368963	
+5.6640901398169685	-3.0336482509482794	-9.706992869708104	-6.68706395984955	-11.348325073115461	-14.603200975527317	-7.744660589097173	-9.641334237373085	-5.526483610197816	7.390743933542175	-1.2653240133784773	-7.192524890722128	3.533981011502816	2.681722821029996	2.512905554209703	-0.33375490269577596	4.058304318208498	-7.256537399021878	16.922235333061536	-15.543130825870255	
+-1.941680903982254	-1.620188951536221	-16.49336784202976	-3.988839711869685	3.684685787171881	-2.7261688525316154	1.536745824858855	-3.655767840855621	4.171801466578492	-1.2653240133784776	-16.17338548215736	-4.346168754259635	0.9883693901950434	10.407166135149696	-1.0147518417186276	-3.640204618636641	0.5528665533864203	-1.9384624925634069	2.7242747514914467	2.5912005681165398	
+5.100745743127989	6.077922902613122	-6.952684959177828	-17.08568079274558	-10.298952782945518	-1.7965161334183959	2.24584232057004	-3.646020380758003	1.663379080248023	-7.192524890722128	-4.346168754259635	-4.842682229784638	5.24566596101953	-7.969425521079618	-0.7726875880634537	-4.203688593452014	4.4349881144641055	-10.250423641642069	2.9691255453872243	4.749973207810685	
+4.737198978363991	-3.5845621959048546	-3.4547268462243874	0.24260757885621456	0.9808197485316656	0.4107507920735526	-1.6310642477024169	-3.870515305415113	-0.20787226865014097	3.533981011502817	0.9883693901950436	5.24566596101953	13.644973000891078	-8.420845466573214	-1.9904184137288325	-1.2253425013384456	6.222428935801153	-14.003689170573864	-0.7766510986982865	1.532516171626796	
+-2.20687872440639	13.167035259116409	-1.1810815708922808	-8.38075706986446	2.438220701695899	-8.798195601021801	3.321949488165428	-5.352755381212174	-0.5000090507342521	2.681722821029996	10.407166135149696	-7.969425521079616	-8.420845466573214	19.06928072833391	-15.507209281381018	5.460022856018071	5.297666187146259	-8.557420437464279	5.95886407616429	0.0827078998060265	
+16.052308243188293	-8.282209805239859	-7.16824982645246	1.9532907686718772	-8.845047371051962	3.2768812601799384	-11.95548421213262	-3.7823660450398773	-14.555530233986545	2.5129055542097025	-1.014751841718628	-0.7726875880634537	-1.9904184137288323	-15.50720928138102	23.762996135955692	-14.298315435473466	6.80489937033898	-2.2280184971548023	5.961863015419603	-2.604569634149264	
+-18.883146215246597	2.7926391849020846	3.257207019816167	-0.2692706500600995	-0.4752033999395828	-3.331882465346057	-5.0800230312982695	-6.667960671601334	8.838590944167589	-0.33375490269577657	-3.640204618636641	-4.203688593452015	-1.2253425013384447	5.46002285601807	-14.298315435473466	2.4512599199321525	-0.9562789762632327	-7.325398267354632	-6.9064676177632975	-5.344446159375588	
+9.252111531192154	1.935980616123342	-9.42943057829365	-10.96897129258043	1.03807675400255	1.4536534662990481	-0.2986692784026787	18.355136836021444	-7.933398828108901	4.058304318208497	0.5528665533864203	4.434988114464105	6.222428935801153	5.297666187146258	6.80489937033898	-0.9562789762632328	-0.4050077854813452	-4.156576031869877	0.9217517707107219	1.295365086565665	
+-8.53388114376216	0.08446389430706265	9.334921773405709	8.301317574269001	-3.6649213104622893	5.055746075370921	-3.8482912126660094	-16.094689897437867	3.6867522501976855	-7.256537399021878	-1.938462492563406	-10.25042364164207	-14.003689170573864	-8.557420437464279	-2.228018497154804	-7.325398267354632	-4.156576031869877	8.204206534390714	-4.893492170411783	6.370533063352927	
+8.386151714513085	-0.8427862266247529	-3.186562492990121	14.654616218075967	4.385356652866173	-2.496110397593398	-0.4050683620870067	1.0780821647008894	-13.55594194168687	16.922235333061536	2.7242747514914463	2.969125545387225	-0.7766510986982863	5.95886407616429	5.9618630154196035	-6.906467617763298	0.9217517707107223	-4.893492170411783	11.833358971727565	-0.22234900707383531	
+-5.26392354702618	4.954515329330778	7.332965498653541	1.2380336575877724	-8.63956874858003	1.2179494992095463	7.150928832538522	4.465185635261156	3.624124906036897	-15.543130825870255	2.5912005681165393	4.749973207810685	1.5325161716267965	0.08270789980602707	-2.6045696341492643	-5.344446159375589	1.2953650865656636	6.370533063352927	-0.2223490070738356	5.705787526261758	
+0.0	1.0	1.0	1.0	0.0	1.0	1.0	0.0	1.0	0.0	0.0	0.4414	0.0	0.0	0.0	1.0	0.0	1.0	0.0	1.0	
\ No newline at end of file
diff --git a/examples/tuning_instances/tuningH020-100-9.in b/examples/tuning_instances/tuningH020-100-9.in
new file mode 100644
index 00000000..d20b6f84
--- /dev/null
+++ b/examples/tuning_instances/tuningH020-100-9.in
@@ -0,0 +1,23 @@
+20	215.936172	215.936172	True	0.0445	0.0014	9	0
+-33.53344734750056	19.468791821181416	14.865445050541883	35.93211463665951	14.389170187775468	-28.576401443320854	-43.43485417118478	21.15442051943363	30.46171477461201	2.3764139039384062	-1.7552846247757223	-1.6413395735311944	0.6659373819373853	17.11894051368477	5.72832546950977	-11.637193805464026	14.322275056191927	-24.1765319157088	-10.80993361208101	9.872092877687793	
+16.395842686708985	-0.17056545712675752	-3.5880406168570946	2.121048359472073	-2.1211685559342413	-0.5890848780725475	-0.56215790789981	8.512605349747686	7.563168296852658	11.851479669820847	0.67511009962397	3.231640188502436	-8.827489379176486	6.039761342670168	0.3061210308028397	-4.771249789461711	5.877952986706178	-5.9331231714402906	-4.716853257162237	7.473079880127992	
+-0.1705654571267572	-11.074584240695375	5.182939984939894	-4.4178556976092604	-1.4418364023044155	2.60539945578725	4.996730477419456	-2.0491250124698936	-6.659064992587548	12.65927238407447	11.80212440924916	4.6476582488577565	2.050346398012679	-8.431251349964734	4.6866472431302535	-3.818084777907653	-8.759375550886464	13.004312463085183	4.600274731657355	-10.159708361205238	
+-3.588040616857094	5.182939984939893	11.400306359401151	-1.5483529782591952	8.244361111225421	2.0939148971424615	0.3328375106330613	0.1429888464226673	-4.4390593924889	8.619229051425737	-8.050406020052069	3.233707795146071	-4.866670682715871	-12.49419463088707	-11.733137479289748	-7.164681231031846	-5.1549050960787275	-4.101223018030924	-2.746062655262667	1.9521760218055078	
+2.1210483594720735	-4.4178556976092604	-1.5483529782591954	-0.4754778171789107	1.5559848799365084	1.1156767739476594	10.637929150977397	-7.763650074041112	-8.452857368284603	-16.276982187170486	-2.127998446455048	4.603429745729109	-5.798944014585297	-3.8086811697965652	-4.322771050646792	-5.904108775693813	-8.490236709556177	3.0377886245288366	-6.9368935893815395	0.9419178518161953	
+-2.1211685559342404	-1.441836402304415	8.244361111225423	1.5559848799365084	16.151155607918646	1.3052993295362585	8.02575760256621	-8.109343648090146	-8.23924706282598	-1.542414302096123	7.569895405354308	8.933010261363387	-1.6545203201637653	-9.45150054362434	-1.3047831049394953	-0.6263324537848838	-10.232939052430211	12.161030692906069	7.7609295886596685	-6.78125071777506	
+-0.5890848780725475	2.60539945578725	2.0939148971424615	1.1156767739476594	1.3052993295362585	1.5569837901388277	4.465777924119381	-2.346896257631548	-3.4841765605318047	5.585070092671018	-4.323950449942489	0.6394034643227192	-0.18494238623888842	-2.2626984042373715	-1.7519010979969791	0.4953153166125125	2.26168331707715	1.3463705143792946	-2.8543920816110164	4.63328628924035	
+-0.5621579078998091	4.9967304774194545	0.33283751063306133	10.637929150977396	8.02575760256621	4.46577792411938	3.774962230927023	11.61603894240969	9.647557921603362	4.473714585907245	-10.616263293190503	-4.335978906315027	9.879132398550142	7.5411769569911575	-7.378094708936303	6.953483360565118	12.48156269468532	-2.2084769132275373	-1.3615525272446485	6.021559612111025	
+8.512605349747687	-2.049125012469894	0.14298884642266702	-7.763650074041114	-8.109343648090146	-2.3468962576315477	11.616038942409691	-1.981128552880986	-13.030526531573239	-7.202832339533524	-0.886085176547859	-2.8892429330125986	-13.568720288667862	-7.175695389481354	0.45435165055292015	-8.77557200342363	-6.728836089059994	-0.8828226193069607	-7.313396213577499	7.066815185895207	
+7.563168296852658	-6.659064992587548	-4.4390593924889	-8.452857368284603	-8.23924706282598	-3.484176560531804	9.647557921603362	-13.030526531573239	-0.32053121699572873	-5.742075604145914	0.2703461351414015	9.659301612793627	-6.413545026807333	-5.49641444251138	-5.134569471156651	1.4490748309385493	-6.870009664533565	1.5311419665741244	-1.442639705450695	-3.553377326579234	
+11.851479669820845	12.65927238407447	8.619229051425737	-16.276982187170486	-1.5424143020961227	5.585070092671018	4.473714585907245	-7.202832339533523	-5.7420756041459144	10.515708336941648	-10.703527964196645	-8.771455872811389	-8.152143330365597	-9.059696070749855	-12.239775026090845	-4.957890903339976	-14.595742673684219	-4.524217278759868	-0.411212742887466	6.055313980943038	
+0.675110099623968	11.802124409249164	-8.050406020052069	-2.1279984464550497	7.569895405354306	-4.323950449942489	-10.616263293190501	-0.8860851765478581	0.2703461351414023	-10.703527964196644	6.372480743885037	-6.440694133587068	-4.550501809617471	12.114331155867077	9.041269295019623	2.3367428396159564	1.5180167189610236	-0.0893629379711406	4.31769891566897	4.286944164647431	
+3.231640188502436	4.6476582488577565	3.233707795146072	4.603429745729109	8.933010261363387	0.6394034643227188	-4.335978906315028	-2.889242933012597	9.659301612793627	-8.771455872811389	-6.440694133587068	6.077500712507203	-2.037444017317383	4.886831156320369	-8.826840946680603	0.9163332647987694	-2.501872981992126	-7.657737871282694	2.7852280442211073	-0.7456045093086234	
+-8.827489379176486	2.050346398012679	-4.866670682715872	-5.798944014585299	-1.6545203201637644	-0.18494238623888884	9.879132398550142	-13.568720288667862	-6.413545026807333	-8.152143330365597	-4.5505018096174705	-2.0374440173173833	17.62089046371501	3.4369976459751848	-4.004195427274664	11.566597227764452	-2.538966119532473	8.22883282760045	6.439032460880008	-3.795397703710569	
+6.039761342670168	-8.431251349964734	-12.49419463088707	-3.8086811697965652	-9.45150054362434	-2.2626984042373715	7.541176956991158	-7.175695389481354	-5.496414442511382	-9.059696070749855	12.114331155867077	4.886831156320368	3.4369976459751843	6.207399244106949	8.085235081094131	5.660109540806137	-4.095514650547073	14.222862105876656	4.550272172116443	-9.63775000940795	
+0.3061210308028392	4.6866472431302535	-11.73313747928975	-4.322771050646792	-1.3047831049394953	-1.7519010979969787	-7.378094708936303	0.45435165055292026	-5.134569471156652	-12.239775026090843	9.041269295019623	-8.826840946680603	-4.004195427274663	8.085235081094135	13.322332502404635	-0.03123578007102341	1.1228293256001187	4.697127939392089	-0.36151371567004154	0.19895981677301347	
+-4.771249789461711	-3.818084777907653	-7.164681231031846	-5.904108775693813	-0.6263324537848836	0.49531531661251205	6.953483360565118	-8.775572003423628	1.4490748309385484	-4.957890903339975	2.336742839615957	0.9163332647987695	11.566597227764452	5.660109540806136	-0.031235780071023223	18.120370267514215	0.3892470516929645	11.932044911169902	9.05484617567065	-7.108229086748281	
+5.877952986706179	-8.759375550886464	-5.1549050960787275	-8.490236709556179	-10.232939052430213	2.2616833170771504	12.48156269468532	-6.728836089059997	-6.870009664533565	-14.595742673684219	1.5180167189610236	-2.501872981992127	-2.538966119532473	-4.095514650547072	1.1228293256001178	0.3892470516929633	-4.967461080416213	6.523500054809656	-1.276034853080276	-3.6159507398054553	
+-5.9331231714402906	13.004312463085183	-4.101223018030925	3.0377886245288357	12.16103069290607	1.3463705143792948	-2.2084769132275377	-0.8828226193069612	1.5311419665741255	-4.524217278759868	-0.08936293797114084	-7.657737871282692	8.22883282760045	14.222862105876654	4.697127939392087	11.932044911169902	6.523500054809657	11.954355594290442	6.083608264507404	0.9161059258564341	
+-4.716853257162237	4.600274731657356	-2.746062655262667	-6.93689358938154	7.760929588659668	-2.8543920816110164	-1.3615525272446478	-7.3133962135775	-1.4426397054506952	-0.4112127428874661	4.317698915668969	2.7852280442211073	6.439032460880008	4.550272172116444	-0.36151371567004165	9.054846175670649	-1.2760348530802765	6.083608264507403	12.835285628786215	-4.509290472488551	
+7.473079880127992	-10.159708361205238	1.9521760218055078	0.9419178518161948	-6.78125071777506	4.63328628924035	6.021559612111024	7.066815185895207	-3.553377326579234	6.055313980943038	4.286944164647432	-0.7456045093086234	-3.7953977037105693	-9.637750009407949	0.19895981677301347	-7.108229086748281	-3.615950739805457	0.9161059258564345	-4.509290472488551	-0.4762560150868323	
+0.0	1.0	0.0	1.0	1.0	0.0	0.0	0.0	1.0	0.0	1.0	1.0	1.0	1.0	1.0	1.0	0.0	1.0	1.0	0.0	
\ No newline at end of file


Test patch:
diff --git a/ccvm_simulators/tests/unit/solvers/test_pumped_langevin_solver.py b/ccvm_simulators/tests/unit/solvers/test_pumped_langevin_solver.py
new file mode 100644
index 00000000..a18fdfcd
--- /dev/null
+++ b/ccvm_simulators/tests/unit/solvers/test_pumped_langevin_solver.py
@@ -0,0 +1,48 @@
+from unittest import TestCase
+from ccvm_simulators.solvers import PumpedLangevinSolver
+
+
+class TestLangevinSolver(TestCase):
+    def setUp(self):
+        pumped_solver = PumpedLangevinSolver(
+            device="cpu", batch_size=1000, problem_category="boxqp"
+        )
+
+    def test_set_parameter_key_with_valid_inputs(self):
+        """Test parameter_key sets given parameters when inputs are valid"""
+        # TODO: Implementation
+        pass
+
+    def test_set_parameter_key_with_invalid_keys(self):
+        """Test that parameter_key throws an error when invalid parameter keys are passed"""
+        # TODO: Implementation
+        pass
+
+    # TODO: Depending on the implementation, more test cases should be created.
+    def test_tune(self):
+        """Test that tune successfully tunes the parameters with no errors"""
+        # TODO: Implementation
+        pass
+
+    def test_calculate_grads_valid(self):
+        """Test that calculate_grads returns correct data when valid parameters are passed"""
+        # TODO: Implementation
+        pass
+
+    # TODO: More tests for calculate_grads may be required once it has implemented error handling.
+    def test_calculate_grads_invalid(self):
+        """Test that calculate_grads return raise the correct error when invalid parameters are passed"""
+        # TODO: Implementation
+        pass
+
+    # TODO: Depending on the implementation, more test cases should be created.
+    def test_solve_success(self):
+        """Test that solve will be successful when valid inputs are passed"""
+        # TODO: Implementation
+        pass
+
+    # TODO: More tests for solve may be required once it has implemented error handling.
+    def test_solve_failed(self):
+        """Test that solve return raise the correct error when invalid parameters are passed"""
+        # TODO: Implementation
+        pass