+
    &j                     "    ^ RI t  ! R R4      tR# )    Nc                   z   a  ] tR t^t o Rt^tRtRR ltRV 3R lR lltRV 3R lR llt	R	 t
R
 tR tR tRtV tR# )SobolEnginea  
The :class:`torch.quasirandom.SobolEngine` is an engine for generating
(scrambled) Sobol sequences. Sobol sequences are an example of low
discrepancy quasi-random sequences.

This implementation of an engine for Sobol sequences is capable of
sampling sequences up to a maximum dimension of 21201. It uses direction
numbers from https://web.maths.unsw.edu.au/~fkuo/sobol/ obtained using the
search criterion D(6) up to the dimension 21201. This is the recommended
choice by the authors.

References:
  - Art B. Owen. Scrambling Sobol and Niederreiter-Xing points.
    Journal of Complexity, 14(4):466-489, December 1998.

  - 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.

Args:
    dimension (Int): The dimensionality of the sequence to be drawn
    scramble (bool, optional): Setting this to ``True`` will produce
                               scrambled Sobol sequences. Scrambling is
                               capable of producing better Sobol
                               sequences. Default: ``False``.
    seed (Int, optional): This is the seed for the scrambling. The seed
                          of the random number generator is set to this,
                          if specified. Otherwise, it uses a random seed.
                          Default: ``None``

Examples::

    >>> # xdoctest: +SKIP("unseeded random state")
    >>> soboleng = torch.quasirandom.SobolEngine(dimension=5)
    >>> soboleng.draw(3)
    tensor([[0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
            [0.5000, 0.5000, 0.5000, 0.5000, 0.5000],
            [0.7500, 0.2500, 0.2500, 0.2500, 0.7500]])
iR  Nc                   WP                   8  g   V^8  d   \        RV P                    R24      hW0n        W n        Wn        \
        P                  ! R4      p\
        P                  ! WP                  V\
        P                  R7      V n
        \
        P                  ! V P                  V P                  4       V P                  '       g8   \
        P                  ! V P                  V\
        P                  R7      V n        MV P                  4        V P                  P                  \
        P                  R7      V n        V P                   ^V P                  ,          ,          P#                  ^R4      V n        ^ V n        R# )   z9Supported range of dimensionality for SobolEngine is [1, ]cpu)devicedtype)memory_formatN)MAXDIM
ValueErrorseedscramble	dimensiontorchr	   zerosMAXBITlong
sobolstate_sobol_engine_initialize_state_shift	_scrambleclonecontiguous_formatquasireshape_first_pointnum_generated)selfr   r   r   r   s   &&&& i/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/quasirandom.py__init__SobolEngine.__init__2   s   {{"i!m**.++a9 
 	 "ll5!++{{3ejj
 	--doot~~N}}}T^^CuzzRDJNNZZ%%E4K4K%L
!ZZ!T[[.8AA!RH    c                   < V ^8  d   QhRS[ RS[P                  R,          RS[P                  R,          RS[P                  /# )   noutNr
   returnintr   Tensorr
   )format__classdict__s   "r!   __annotate__SobolEngine.__annotate__M   sI     3 33 \\D 3 {{T!	3
 
3r$   c           	        Vf   \         P                  ! 4       pV P                  ^ 8X  d   V^8X  d   V P                  P	                  V4      pM\         P
                  ! V P                  V^,
          V P                  V P                  V P                  VR7      w  q@n        \         P                  ! V P                  P	                  V4      V3RR7      pMR\         P
                  ! V P                  VV P                  V P                  V P                  ^,
          VR7      w  q@n        V ;P                  V,          un        Ve#   VP                  V4      P                  V4       V# V# )a  
Function to draw a sequence of :attr:`n` points from a Sobol sequence.
Note that the samples are dependent on the previous samples. The size
of the result is :math:`(n, dimension)`.

Args:
    n (Int, optional): The length of sequence of points to draw.
                       Default: 1
    out (Tensor, optional): The output tensor
    dtype (:class:`torch.dtype`, optional): the desired data type of the
                                            returned tensor.
                                            Default: ``None``
)r
   )dim)r   get_default_dtyper   r   to_sobol_engine_drawr   r   r   cat
resize_as_copy_)r    r'   r(   r
   results   &&&& r!   drawSobolEngine.drawM   s   & =++-E"Av**--e4%*%=%=JJEOONN&&&"
 D$5$5$8$8$?#HbQ!&!9!9

""Q&"FJ 	a?NN6"((0Jr$   c                   < V ^8  d   QhRS[ RS[P                  R,          RS[P                  R,          RS[P                  /# )r&   mr(   Nr
   r)   r*   )r-   r.   s   "r!   r/   r0      sI     4 44 \\D 4 {{T!	4
 
4r$   c                    ^V,          pV P                   V,           pWU^,
          ,          ^ 8X  g-   \        RV P                    RV P                    RV RV R2	4      hV P                  WBVR7      # )a  
Function to draw a sequence of :attr:`2**m` points from a Sobol sequence.
Note that the samples are dependent on the previous samples. The size
of the result is :math:`(2**m, dimension)`.

Args:
    m (Int): The (base2) exponent of the number of points to draw.
    out (Tensor, optional): The output tensor
    dtype (:class:`torch.dtype`, optional): the desired data type of the
                                            returned tensor.
                                            Default: ``None``
zFThe balance properties of Sobol' points require n to be a power of 2. z0 points have been previously generated, then: n=z+2**=zH. If you still want to do this, please use 'SobolEngine.draw()' instead.)r'   r(   r
   )r   r   r;   )r    r>   r(   r
   r'   total_ns   &&&&  r!   
draw_base2SobolEngine.draw_base2   s    $ qD$$q(Q;'1,))-););(< =1151C1C0DD1WI V00  yy1Uy33r$   c                ^    V P                   P                  V P                  4       ^ V n        V # )z6
Function to reset the ``SobolEngine`` to base state.
)r   r9   r   r   )r    s   &r!   resetSobolEngine.reset   s'     	

$r$   c                ~   V P                   ^ 8X  dK   \        P                  ! V P                  V^,
          V P                  V P
                  V P                   4       MH\        P                  ! V P                  WP                  V P
                  V P                   ^,
          4       V ;P                   V,          un         V # )z
Function to fast-forward the state of the ``SobolEngine`` by
:attr:`n` steps. This is equivalent to drawing :attr:`n` samples
without using the samples.

Args:
    n (Int): The number of steps to fast-forward by.
)r   r   _sobol_engine_ff_r   r   r   )r    r'   s   &&r!   fast_forwardSobolEngine.fast_forward   s     "##

AE4??DNNDDVDV ##

A@R@RUV@V 	ar$   c                   R pV P                   e1   \        P                  ! 4       pVP                  V P                   4       \        P                  ! R4      p\        P
                  ! ^V P                  V P                  3W!R7      p\        P                  ! V\        P                  ! ^\        P                  ! ^ V P                  VR7      4      4      V n        V P                  V P                  V P                  3p\        P
                  ! ^WBVR7      P                  4       p\        P                  ! V P                  WPP                  4       R # )Nr   )r	   	generator)r	   )r   r   	Generatormanual_seedr	   randintr   r   mvpowaranger   tril_sobol_engine_scramble_r   )r    gr   
shift_intsltm_dimsltms   &     r!   r   SobolEngine._scramble   s    $(99 !AMM$))$ll5! ]],S

 XX		!U\\!T[[%MN


 NNDKK=mmAxqAFFH%%doosNNKr$   c                   R V P                    2.pV P                  '       d   VR.,          pV P                  e   VRV P                   2.,          pV P                  P                  R,           RP                  V4      ,           R,           # )z
dimension=zscramble=Truezseed=(z, ))r   r   r   	__class____name__join)r    
fmt_strings   & r!   __repr__SobolEngine.__repr__   sv    "4>>"234
===?++J99 U499+.//J~~&&,tyy/DDsJJr$   )r   r   r   r   r   r   r   r   )FN)r   NN)NN)r^   
__module____qualname____firstlineno____doc__r   r   r"   r;   rB   rE   rI   r   ra   __static_attributes____classdictcell__)r.   s   @r!   r   r      sM     &P FF63 3j4 4<(L,K Kr$   r   )r   r    r$   r!   <module>rj      s    RK RKr$   