class_docstr: Generates a new quasirandom Sobol' vector with each call.
  
  Parameters
  ----------
  skip : int
      Skipped seed number.
  
  randomize : bool, default=False
      When set to True, random shift is applied.
  
  Notes
  -----
  Sobol' sequences [1]_ provide :math:`n=2^m` low discrepancy points in
  :math:`[0,1)^{dim}`. Scrambling them makes them suitable for singular
  integrands, provides a means of error estimation, and can improve their
  rate of convergence.
  
  There are many versions of Sobol' sequences depending on their
  'direction numbers'. Here, the maximum number of dimension is 40.
  
  The routine adapts the ideas of Antonov and Saleev [2]_.
  
  .. warning::
  
     Sobol' sequences are a quadrature rule and they lose their balance
     properties if one uses a sample size that is not a power of 2, or skips
     the first point, or thins the sequence [5]_.
  
     If :math:`n=2^m` points are not enough then one should take :math:`2^M`
     points for :math:`M>m`. When scrambling, the number R of independent
     replicates does not have to be a power of 2.
  
     Sobol' sequences are generated to some number :math:`B` of bits. Then
     after :math:`2^B` points have been generated, the sequence will repeat.
     Currently :math:`B=30`.
  
  References
  ----------
  .. [1] I. M. Sobol. The distribution of points in a cube and the accurate
     evaluation of integrals. Zh. Vychisl. Mat. i Mat. Phys., 7:784-802,
     1967.
  
  .. [2] Antonov, Saleev,
     USSR Computational Mathematics and Mathematical Physics,
     Volume 19, 1980, pages 252 - 256.
  
  .. [3] Paul Bratley, Bennett Fox,
     Algorithm 659:
     Implementing Sobol's Quasirandom Sequence Generator,
     ACM Transactions on Mathematical Software,
     Volume 14, Number 1, pages 88-100, 1988.
  
  .. [4] Bennett Fox,
     Algorithm 647:
     Implementation and Relative Efficiency of Quasirandom
     Sequence Generators,
  
  .. [5] Art B. Owen. On dropping the first Sobol' point. arXiv 2008.08051,
     2020.
docstr: Generates a new quasirandom Sobol' vector with each call.
  
  Parameters
  ----------
  dim_num : int
    Number of spatial dimensions.
    `dim_num` must satisfy 1 <= DIM_NUM <= 40.
  
  seed : int
    the `seed` for the sequence.
    This is essentially the index in the sequence of the quasirandom
    value to be generated. On output, `seed` has been set to the
    appropriate next value, usually simply `seed`+1.
    If `seed` is less than 0 on input, it is treated as though it were 0.
    An input value of 0 requests the first (0-th) element of
    the sequence.
  
  Returns
  -------
  vector, seed : np.array (n_dim,), int
      The next quasirandom vector and the seed of its next vector.
docstr_tok: ["Generates","a","new","quasirandom","Sobol","'","vector","with","each","call",".","Parameters","--","--","--","--","--","dim_num",":","int","Number","of","spatial","dimensions",".","`","dim_num","`","must","satisfy","1","<","=","DIM_NUM","<","=","40.","seed",":","int","the","`","seed","`","for","the","sequence",".","This","is","essentially","the","index","in","the","sequence","of","the","quasirandom","value","to","be","generated",".","On","output",",","`","seed","`","has","been","set","to","the","appropriate","next","value",",","usually","simply","`","seed","`","+1",".","If","`","seed","`","is","less","than","0","on","input",",","it","is","treated","as","though","it","were","0",".","An","input","value","of","0","requests","the","first","(","0-th",")","element","of","the","sequence",".","Returns","--","--","--","-","vector",",","seed",":","np.array","(","n_dim",",",")",",","int","The","next","quasirandom","vector","and","the","seed","of","its","next","vector","."]
code: def _sobol(self, dim_num, seed):
      """Generates a new quasirandom Sobol' vector with each call.
  
      Parameters
      ----------
      dim_num : int
        Number of spatial dimensions.
        `dim_num` must satisfy 1 <= DIM_NUM <= 40.
  
      seed : int
        the `seed` for the sequence.
        This is essentially the index in the sequence of the quasirandom
        value to be generated. On output, `seed` has been set to the
        appropriate next value, usually simply `seed`+1.
        If `seed` is less than 0 on input, it is treated as though it were 0.
        An input value of 0 requests the first (0-th) element of
        the sequence.
  
      Returns
      -------
      vector, seed : np.array (n_dim,), int
          The next quasirandom vector and the seed of its next vector.
  
      """
      #  Things to do only if the dimension changed.
      if dim_num != self.dim_num_save:
          self.init(dim_num)
  
      seed = int(np.floor(seed))
  
      if seed < 0:
          seed = 0
  
      pos_lo0 = 1
      if seed == 0:
          self.lastq = np.zeros(dim_num)
  
      elif seed == self.seed_save + 1:
          #  Find the position of the right-hand zero in SEED.
          pos_lo0 = _bit_lo0(seed)
  
      elif seed <= self.seed_save:
          self.seed_save = 0
          self.lastq = np.zeros(dim_num)
  
          for seed_temp in range(int(self.seed_save), int(seed)):
              pos_lo0 = _bit_lo0(seed_temp)
              for i in range(1, dim_num + 1):
                  self.lastq[i - 1] = np.bitwise_xor(
                      int(self.lastq[i - 1]),
                      int(self.v[i - 1, pos_lo0 - 1]),
                  )
  
          pos_lo0 = _bit_lo0(seed)
  
      elif self.seed_save + 1 < seed:
          for seed_temp in range(int(self.seed_save + 1), int(seed)):
              pos_lo0 = _bit_lo0(seed_temp)
              for i in range(1, dim_num + 1):
                  self.lastq[i - 1] = np.bitwise_xor(
                      int(self.lastq[i - 1]),
                      int(self.v[i - 1, pos_lo0 - 1]),
                  )
  
          pos_lo0 = _bit_lo0(seed)
  
      #  Check that the user is not calling too many times!
      if self.maxcol < pos_lo0:
          raise ValueError(
              f"I4_SOBOL - Fatal error!\n"
              f" Too many calls!\n"
              f" MAXCOL = {self.maxcol}\n"
              f" L =      {pos_lo0}\n"
          )
  
      #  Calculate the new components of QUASI.
      quasi = np.zeros(dim_num)
      for i in range(1, dim_num + 1):
          quasi[i - 1] = self.lastq[i - 1] * self.recipd
          self.lastq[i - 1] = np.bitwise_xor(
              int(self.lastq[i - 1]), int(self.v[i - 1, pos_lo0 - 1])
          )
  
      self.seed_save = seed
      seed += 1
  
      return [quasi, seed]
  
file_path: scikit-optimize/skopt/sampler/sobol.py
imports: from __future__ import division
  import warnings
  import numpy
  from .base import InitialPointGenerator
  from ..space import Space
  from sklearn.utils import check_random_state
label_desc: Use image node_id 4 for calling the Sobol obj's underlying member method code with example usage: obj._sobol(dim_num, seed) and returns: list