code: def _compose_fourier(
      dprv: DiscretePRV, num_self_composition: int
  ) -> DiscretePRV:
      if len(dprv) % 2 != 0:
          raise ValueError(
              "Can only compose evenly sized discrete PRVs"
          )
  
      composed_pmf = irfft(rfft(dprv.pmf) ** num_self_composition)
  
      m = num_self_composition - 1
      if num_self_composition % 2 == 0:
          m += len(composed_pmf) // 2
      composed_pmf = np.roll(composed_pmf, m)
  
      domain = dprv.domain.shift_right(
          dprv.domain.shifts * (num_self_composition - 1)
      )
  
      return DiscretePRV(pmf=composed_pmf, domain=domain)
  
file_path: opacus/opacus/accountants/analysis/prv/compose.py
imports: from typing import List
  import numpy
  from scipy.fft import irfft, rfft
  from scipy.signal import convolve
  from .prvs import DiscretePRV
label_desc: Use image node_id 1 for calling a global function with example usage: _compose_fourier(dprv, num__composition) and returns: DiscretePRV