Skip to content

nlft_qsp.solvers.nlfft

Module for the inverse NLFT based on the nonlinear fast Fourier transform algorithm.

Functions:

Name Description
inlft

Computes the inverse nonlinear Fourier transform using the nonlinear fast Fourier transform algorithm (arXiv:2505.12615).

inlft(a: Polynomial, b: Polynomial) -> NonLinearFourierSequence

Computes the inverse nonlinear Fourier transform using the nonlinear fast Fourier transform algorithm (arXiv:2505.12615).

Parameters:

Name Type Description Default
a Polynomial

The pair \((a, b)\) is the NLFT we want to compute the sequence for.

required
b Polynomial

The pair \((a, b)\) is the NLFT we want to compute the sequence for.

required
Note

\(a\) must be outer. To generate an outer complementary polynomial, you can use weiss.complete.

Returns:

Type Description
NonLinearFourierSequence

A sequence whose NLFT is equal to \((a, b)\) (up to working precision).

Source code in nlft_qsp/solvers/nlfft.py
def inlft(a: Polynomial, b: Polynomial) -> NonLinearFourierSequence:
    """Computes the inverse nonlinear Fourier transform using the nonlinear fast Fourier transform algorithm ([arXiv:2505.12615](https://arxiv.org/abs/2505.12615)).

    Args:
        a (Polynomial): The pair $(a, b)$ is the NLFT we want to compute the sequence for.
        b (Polynomial): The pair $(a, b)$ is the NLFT we want to compute the sequence for.

    Note:
        $a$ must be outer. To generate an outer complementary polynomial, you can use `weiss.complete`.

    Returns:
        A sequence whose NLFT is equal to $(a, b)$ (up to working precision).
    """
    if len(a.support()) != len(b.support()) or a.support().stop != 1:
        return ValueError("(a, b) must be in the image of the NLFT.")

    sup_start = b.support_start
    b = b.shift(-sup_start)

    F, _, _ = nlfft_recurse(a.conjugate(), b)
    return NonLinearFourierSequence(F.coeffs, support_start=sup_start)