title: Speed up scipy minimize
body: <p>I have the minimum variance optimization problem in <code>scipy</code> with an additional constraint:</p>
  <pre class="lang-py prettyprint-override"><code>def min_variance_scipy(initial_point: np.array, 
                         covariance_matrix: np.array):
      start = time.time()
      n = covariance_matrix.shape[0]
      
      objective_function = lambda w, c: 1000 * w.dot(c).dot(w)
      A = np.array([[1] * n])
      ub = [1]
      lb = [1]
      bounds = Bounds([0] * n, [1] * n)
      diversification_target = {
          'type': 'ineq',
          'fun': lambda weights: (2 / n) - np.sum(weights**2)
      }
      constraints = [LinearConstraint(A, lb, ub), diversification_target]
      
      solution = minimize(fun=objective_function,
                          x0=initial_point,
                          method='trust-constr',
                          bounds=bounds,
                          constraints=constraints,
                          args=(covariance_matrix,),
                          tol=1e-6,
                          jac=lambda x, c: 2000 * x.T.dot(c.T),
                          hess=lambda x, c: 2000 * c.T,
                          options={'gtol': 1e-6})
                          # options={'verbose': 3, 'finite_diff_rel_step': 1e-5,})
       
      return solution.x
  </code></pre>
  <p>If I run this optimizer with:</p>
  <pre><code>initial_point: np.array of shape == (600, ).
  covariance_matrix: matrix of shape == (600, 600)
  </code></pre>
  <p>The execution time is +100 segs. I want to speed up this performance. I tested <code>cvxpy</code> but some constraints  are not DCP or DCCP if we use the DCCP optimizer. (I have more constraints to test).</p>
  <p>I also changed the method parameter to <code>SLSQP</code> but the <code>diversification_target</code> constraint is not being fulfilled.</p>