+
    –°³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]])
iÑR  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   &&&& ÚR/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/quasirandom.pyÚ__init__ÚSobolEngine.__init__2   s  € Ø—{‘{Ô" i°!¤mÜð*Ø*.¯+©+¨°að9óð ð
 Œ	Ø ŒØ"Œä�lŠl˜5Ó!ˆäŸ+š+Ø—{‘{¨3´e·j±jô
ˆŒô 	×-Ò-¨d¯o©o¸t¿~¹~ÔNà�}�}ˆ}ÜŸš T§^¡^¸CÄuÇzÁzÔRˆD�Jà�N‰NÔà—Z‘Z×%Ñ%´E×4KÑ4KÐ%ÓLˆŒ
Ø!ŸZ™Z¨!¨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à×Ñ Ô"Ø�AŒvØ×*Ñ*×-Ñ-¨eÓ4‘ä%*×%=Ò%=Ø—J‘JØ˜•EØ—O‘OØ—N‘NØ×&Ñ&Øô&Ñ"�œ
ô Ÿš D×$5Ñ$5×$8Ñ$8¸Ó$?ÀÐ#HÈbÔQ‘ä!&×!9Ò!9Ø—
‘
ØØ—‘Ø—‘Ø×"Ñ" QÕ&Øô"ÑˆF”Jð 	×Ò˜aÕÕàŠ?Ø�N‰N˜6Ó"×(Ñ(¨Ô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‡   € ð$ ˆq�DˆØ×$Ñ$ qÕ(ˆØ Q�;Õ'¨1Ô,Üð)Ø)-×);Ñ);Ð(<ð =1Ø15×1CÑ1CÐ0DÀDÈÈÈ1ÈWÈIð V0ð0óð ð �y‰y˜1¨UˆyÓ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^ 8X  d   V # 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–   € ð �Œ6ØˆKØ×Ñ Ô"Ü×#Ò#Ø—
‘
˜A �E 4§?¡?°D·N±NÀD×DVÑDVõô ×#Ò#Ø—
‘
˜AŸ™°·±À×@RÑ@RÐUVÕ@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ß   € Ø$(ˆØ�9‰9Ò Ü—’Ó!ˆAØ�M‰M˜$Ÿ)™)Ô$ä�lŠl˜5Ó!ˆô —]’]Ø�—‘ §¡Ð,°Sô
ˆ
ô —X’XØœŸ	š	 !¤U§\¢\°!°T·[±[ÈÔ%MÓNó
ˆŒ
ð
 —N‘N D§K¡K°·±Ð=ˆÜ�mŠm˜A˜x¸qÔA×FÑFÓHˆä×%Ò% d§o¡o°s¿N¹NÖ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Ø�9‰9Ò Ø˜U 4§9¡9 +Ð.Ð/Õ/ˆJØ�~‰~×&Ñ&¨Õ,¨t¯y©y¸Ó/DÕDÀsÕ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   ðó ÷TKó TKr$   