Repository: scipy/scipy

Issue:
hess option does not work in minimize function

#### issue
i traied use hess= {2-point’, ‘3-point’, ‘cs’, HessianUpdateStrategy} according  to doc,but it failed.
![image](https://user-images.githubusercontent.com/33288114/128112269-6be48092-a516-4ff7-acda-d38c7673a9a7.png)

#### Reproducing code example: 

```python
import numpy as np
from scipy.optimize import minimize,show_options,SR1
import sys
def rosen(x):
    """The Rosenbrock function"""
    return sum(100.0*(x[1:]-x[:-1]**2.0)**2.0 + (1-x[:-1])**2.0)

def rosen_der(x):
    xm = x[1:-1]
    xm_m1 = x[:-2]
    xm_p1 = x[2:]
    der = np.zeros_like(x)
    der[1:-1] = 200*(xm-xm_m1**2) - 400*(xm_p1 - xm**2)*xm - 2*(1-xm)
    der[0] = -400*x[0]*(x[1]-x[0]**2) - 2*(1-x[0])
    der[-1] = 200*(x[-1]-x[-2]**2)
    return der


x0 = np.array([1.3, 0.7, 0.8, 1.9, 1.2])
minimize(rosen, x0, method='Newton-CG',
               options={'disp': False},jac=rosen_der,hess='cs')
```

#### Error message:
![image](https://user-images.githubusercontent.com/33288114/128112078-19dc6164-a9f2-487e-b9e8-a2298c884eda.png)


#### Scipy/Numpy/Python version information:
```
1.5.4 1.19.2 sys.version_info(major=3, minor=8, micro=5, releaselevel='final', serial=0)
```



Discussion:
Thanks @CatNofishing. I think this is just a phrasing issue as it also says:

```
Available quasi-Newton methods implementing this interface are:

BFGS;
SR1.
```

Meaning `Newton-CG` is not compatible here. There could be a validation here as well.

Is this correct @andyfaff?
@tupui  Sorry, I still do not understand the description in the document, I suggest to provide a few examples of the use of the hess option parameter。  I set hess=‘2-point’/‘3-point’/’cs’ to all the solvers that provide the hess option, all of them do not work。
> @tupui Sorry, I still do not understand the description in the document, I suggest to provide a few examples of the use of the hess option parameter。 I set hess=‘2-point’/‘3-point’/’cs’ to all the solvers that provide the hess option, all of them do not work。

All the trust methods (except exact as the doc states) are working fine. It's true that `'newton-cg', 'dogleg'` do not work.

Ex.
```python
minimize(rosen, x0, method='trust-krylov',
         jac=rosen_der, hess='cs')
```

Any improvement to the doc is always welcome if you want to help.
@andyfaff this goes on the pile for the general rework of the interface. We should really plan this for SciPy 2.
I am a new contributor and want to share my opinion

 minimize function needs to somehow get to  know what frequencies and response are. Need to modify minimize function so that it takes those two parameters in, and then add an argument in your call to minimize to include those arguments. 

Resolving patch:
diff --git a/scipy/optimize/_minimize.py b/scipy/optimize/_minimize.py
--- a/scipy/optimize/_minimize.py
+++ b/scipy/optimize/_minimize.py
@@ -59,7 +59,7 @@ def minimize(fun, x0, args=(), method=None, jac=None, hess=None,
         specify the function.
     x0 : ndarray, shape (n,)
         Initial guess. Array of real elements of size (n,),
-        where 'n' is the number of independent variables.
+        where ``n`` is the number of independent variables.
     args : tuple, optional
         Extra arguments passed to the objective function and its
         derivatives (`fun`, `jac` and `hess` functions).
@@ -84,7 +84,7 @@ def minimize(fun, x0, args=(), method=None, jac=None, hess=None,
               see below for description.
 
         If not given, chosen to be one of ``BFGS``, ``L-BFGS-B``, ``SLSQP``,
-        depending if the problem has constraints or bounds.
+        depending on whether or not the problem has constraints or bounds.
     jac : {callable,  '2-point', '3-point', 'cs', bool}, optional
         Method for computing the gradient vector. Only for CG, BFGS,
         Newton-CG, L-BFGS-B, TNC, SLSQP, dogleg, trust-ncg, trust-krylov,
@@ -114,14 +114,14 @@ def minimize(fun, x0, args=(), method=None, jac=None, hess=None,
 
             ``hess(x, *args) -> {LinearOperator, spmatrix, array}, (n, n)``
 
-        where x is a (n,) ndarray and `args` is a tuple with the fixed
+        where ``x`` is a (n,) ndarray and ``args`` is a tuple with the fixed
         parameters. LinearOperator and sparse matrix returns are only allowed
-        for 'trust-constr' method. Alternatively, the keywords
-        {'2-point', '3-point', 'cs'} select a finite difference scheme
-        for numerical estimation. Or, objects implementing the
-        `HessianUpdateStrategy` interface can be used to approximate
-        the Hessian. Available quasi-Newton methods implementing
-        this interface are:
+        for 'trust-constr' method. Alternatively (not available for Newton-CG
+        or dogleg), the keywords {'2-point', '3-point', 'cs'} select a finite
+        difference scheme for numerical estimation. Or, objects implementing
+        the `HessianUpdateStrategy` interface can be used to approximate the
+        Hessian. Available quasi-Newton methods implementing this interface
+        are:
 
             - `BFGS`;
             - `SR1`.
@@ -141,8 +141,8 @@ def minimize(fun, x0, args=(), method=None, jac=None, hess=None,
 
             ``hessp(x, p, *args) ->  ndarray shape (n,)``
 
-        where x is a (n,) ndarray, p is an arbitrary vector with
-        dimension (n,) and `args` is a tuple with the fixed
+        where ``x`` is a (n,) ndarray, ``p`` is an arbitrary vector with
+        dimension (n,) and ``args`` is a tuple with the fixed
         parameters.
     bounds : sequence or `Bounds`, optional
         Bounds on variables for Nelder-Mead, L-BFGS-B, TNC, SLSQP, Powell, and
@@ -153,7 +153,7 @@ def minimize(fun, x0, args=(), method=None, jac=None, hess=None,
                is used to specify no bound.
 
     constraints : {Constraint, dict} or List of {Constraint, dict}, optional
-        Constraints definition (only for COBYLA, SLSQP and trust-constr).
+        Constraints definition. Only for COBYLA, SLSQP and trust-constr.
 
         Constraints for 'trust-constr' are defined as a single object or a
         list of objects specifying constraints to the optimization problem.


Test patch: