Skip to content

Commit c030c0c

Browse files
authored
add round-trip note to relevant fft pairs
1 parent be6330a commit c030c0c

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

spec/API_specification/array_api/fourier_transform_functions.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from ._types import Tuple, Union, Sequence, array, Optional, Literal
22

3+
34
def fft(x: array, /, *, n: Optional[int] = None, axis: int = -1, norm: Literal['backward', 'ortho', 'forward'] = 'backward') -> array:
45
"""
56
Computes the one-dimensional discrete Fourier transform.
@@ -42,6 +43,9 @@ def ifft(x: array, /, *, n: Optional[int] = None, axis: int = -1, norm: Literal[
4243
"""
4344
Computes the one-dimensional inverse discrete Fourier transform.
4445
46+
.. note::
47+
Applying the one-dimensional inverse discrete Fourier transform to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``ifft(fft(x)) == x``), provided that the transform and inverse transform are performed with the same normalization mode.
48+
4549
Parameters
4650
----------
4751
x: array
@@ -77,9 +81,8 @@ def fftn(x: array, /, *, s: Sequence[int] = None, axes: Sequence[int] = None, no
7781
"""
7882
Computes the n-dimensional discrete Fourier transform.
7983
80-
8184
.. note::
82-
Applying the n-dimensional inverse discrete Fourier transform to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``ifftn(fftn(x)) == x``), provided that the transform and inverse transform are performed with the same normalization mode..
85+
Applying the n-dimensional inverse discrete Fourier transform to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``ifftn(fftn(x)) == x``), provided that the transform and inverse transform are performed with the same normalization mode.
8386
8487
Parameters
8588
----------
@@ -121,6 +124,9 @@ def ifftn(x: array, /, *, s: Sequence[int] = None, axes: Sequence[int] = None, n
121124
"""
122125
Computes the n-dimensional inverse discrete Fourier transform.
123126
127+
.. note::
128+
Applying the n-dimensional inverse discrete Fourier transform to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``ifftn(fftn(x)) == x``), provided that the transform and inverse transform are performed with the same normalization mode.
129+
124130
Parameters
125131
----------
126132
x: array
@@ -156,9 +162,8 @@ def rfft(x: array, /, *, n: Optional[int] = None, axis: int = -1, norm: Literal[
156162
"""
157163
Computes the one-dimensional discrete Fourier transform for real-valued input.
158164
159-
160165
.. note::
161-
Applying the one-dimensional inverse discrete Fourier transform for real-valued input to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``irfft(rfft(x), n=x.shape[axis]) == x``), provided that the transform and inverse transform are performed with the same normalization mode..
166+
Applying the one-dimensional inverse discrete Fourier transform for real-valued input to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``irfft(rfft(x), n=x.shape[axis]) == x``), provided that the transform and inverse transform are performed with the same normalization mode.
162167
163168
Parameters
164169
----------
@@ -195,6 +200,9 @@ def irfft(x: array, /, *, n: Optional[int] = None, axis: int = -1, norm: Literal
195200
"""
196201
Computes the one-dimensional inverse of ``rfft``.
197202
203+
.. note::
204+
Applying the one-dimensional inverse discrete Fourier transform for real-valued input to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``irfft(rfft(x), n=x.shape[axis]) == x``), provided that the transform and inverse transform are performed with the same normalization mode.
205+
198206
Parameters
199207
----------
200208
x: array
@@ -230,7 +238,6 @@ def rfftn(x: array, /, *, s: Sequence[int] = None, axes: Sequence[int] = None, n
230238
"""
231239
Computes the n-dimensional discrete Fourier transform for real-valued input.
232240
233-
234241
.. note::
235242
Applying the n-dimensional inverse discrete Fourier transform for real-valued input to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``irfftn(rfftn(x), n=x.shape[axis]) == x``), provided that the transform and inverse transform are performed with the same normalization mode.
236243
@@ -269,6 +276,9 @@ def irfftn(x: array, /, *, s: Sequence[int] = None, axes: Sequence[int] = None,
269276
"""
270277
Computes the n-dimensional inverse of ``rfftn``.
271278
279+
.. note::
280+
Applying the n-dimensional inverse discrete Fourier transform for real-valued input to the output of this function must return the original (i.e., non-transformed) input array within numerical accuracy (i.e., ``irfftn(rfftn(x), n=x.shape[axis]) == x``), provided that the transform and inverse transform are performed with the same normalization mode.
281+
272282
Parameters
273283
----------
274284
x: array

0 commit comments

Comments
 (0)