code: def test_complex_rosenbrock(self):
      complex_dim = 5
  
      f_re = rosenbrock(jnp)
      init_re = jnp.zeros((2 * complex_dim,), dtype=complex)
      expect_re = jnp.ones((2 * complex_dim,), dtype=complex)
  
      def f(z):
          x_re = jnp.concatenate([jnp.real(z), jnp.imag(z)])
          return f_re(x_re)
  
      init = init_re[:complex_dim] + 1.0j * init_re[complex_dim:]
      expect = expect_re[:complex_dim] + 1.0j * expect_re[complex_dim:]
  
      @jit
      def min_op(z0):
          result = jax.scipy.optimize.minimize(
              f,
              z0,
              method="l-bfgs-experimental-do-not-rely-on-this",
              options=dict(gtol=1e-6),
          )
          return result.x
  
      jax_res = min_op(init)
      self.assertAllClose(jax_res, expect, atol=2e-5)
  
imports: from absl.testing import absltest
  import numpy
  import scipy
  import scipy.optimize
  from jax import numpy
  from jax._src import test_util
  from jax import jit
  from jax import config
  import jax.scipy.optimize
label_desc: Use image node_id 3 for calling the TestLBFGS obj's underlying member method code with example usage: obj.test_complex_rosenbrock() and returns: f_re, result