class_docstr: Distribution of electrons on a sphere.
  
  Problem no 2 from COPS collection [2]_. Find
  the equilibrium state distribution (of minimal
  potential) of the electrons positioned on a
  conducting sphere.
  
  References
  ----------
  .. [1] E. D. Dolan, J. J. Mor'{e}, and T. S. Munson,
         "Benchmarking optimization software with COPS 3.0.",
          Argonne National Lab., Argonne, IL (US), 2004.
class_docstr_tok: ["Distribution","of","electrons","on","a","sphere",".","Problem","no","2","from","COPS","collection","[","2","]","_",".","Find","the","equilibrium","state","distribution","(","of","minimal","potential",")","of","the","electrons","positioned","on","a","conducting","sphere",".","References","--","--","--","--","--","..","[","1","]","E.","D.","Dolan",",","J.","J.","Mor","'","{","e","}",",","and","T.","S.","Munson",",","``","Benchmarking","optimization","software","with","COPS","3.0",".","``",",","Argonne","National","Lab.",",","Argonne",",","IL","(","US",")",",","2004","."]
code: def __init__(
      self,
      n_electrons=200,
      random_state=0,
      constr_jac=None,
      constr_hess=None,
  ):
      self.n_electrons = n_electrons
      self.rng = np.random.RandomState(random_state)
      # Initial Guess
      phi = self.rng.uniform(0, 2 * np.pi, self.n_electrons)
      theta = self.rng.uniform(-np.pi, np.pi, self.n_electrons)
      x = np.cos(theta) * np.cos(phi)
      y = np.cos(theta) * np.sin(phi)
      z = np.sin(theta)
      self.x0 = np.hstack((x, y, z))
      self.x_opt = None
      self.constr_jac = constr_jac
      self.constr_hess = constr_hess
      self.bounds = None
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  import pytest
  from scipy.linalg import block_diag
  from scipy.sparse import csc_matrix
  from numpy.testing import TestCase, assert_array_almost_equal, assert_array_less, assert_allclose, assert_
  from pytest import raises
  from scipy.optimize import NonlinearConstraint, LinearConstraint, Bounds, minimize, BFGS, SR1
  from scipy._lib._numpy_compat import suppress_warnings
label_desc: Use image node_id 1 to create a new Elec object  with example: obj = Elec(n_electrons, random_state, constr_jac, constr_hess)