Skip to content

BUG: lqmn(1,1,0) and lqmn(1,1,0j) return incompatible derivatives #23589

@jorenham

Description

@jorenham

Describe your issue.

I'm also able to repro this with xsf @ f8218da (via xsf-rust). But I thought it might help to report it here for the sake of visibility. Otherwise there's also a dusty "transfer issue" button somewhere around here that might be fun to use.

Reproducing Code Example

>>> import scipy
>>> scipy.__version__
'1.16.1'
>>> scipy.special.lqmn(1, 1, 0)[1]
array([[ 1.,  0.],
       [ 0., -2.]])
>>> scipy.special.lqmn(1, 1, 0j)[1]
array([[3.13577798e-315+0.j, 0.00000000e+000+0.j],
       [0.00000000e+000+0.j, 0.00000000e+000+0.j]])

Error message

1 != 0 and -2 != 0

SciPy/NumPy/Python version and system information

uv run --with scipy --with pyyaml python
Installed 3 packages in 20ms
Python 3.13.7 (main, Aug 18 2025, 19:20:03) [Clang 20.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info); scipy.show_config()
1.16.1 2.3.3 sys.version_info(major=3, minor=13, micro=7, releaselevel='final', serial=0)
Build Dependencies:
  blas:
    detection method: pkgconfig
    found: true
    include directory: /opt/_internal/cpython-3.13.5/lib/python3.13/site-packages/scipy_openblas32/include
    lib directory: /opt/_internal/cpython-3.13.5/lib/python3.13/site-packages/scipy_openblas32/lib
    name: scipy-openblas
    openblas configuration: OpenBLAS 0.3.28 DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=64
    pc file directory: /project
    version: 0.3.28
  lapack:
    detection method: pkgconfig
    found: true
    include directory: /opt/_internal/cpython-3.13.5/lib/python3.13/site-packages/scipy_openblas32/include
    lib directory: /opt/_internal/cpython-3.13.5/lib/python3.13/site-packages/scipy_openblas32/lib
    name: scipy-openblas
    openblas configuration: OpenBLAS 0.3.28 DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=64
    pc file directory: /project
    version: 0.3.28
  pybind11:
    detection method: config-tool
    include directory: unknown
    name: pybind11
    version: 3.0.0
Compilers:
  c:
    commands: cc
    linker: ld.bfd
    name: gcc
    version: 10.2.1
  c++:
    commands: c++
    linker: ld.bfd
    name: gcc
    version: 10.2.1
  cython:
    commands: cython
    linker: cython
    name: cython
    version: 3.1.2
  fortran:
    commands: gfortran
    linker: ld.bfd
    name: gcc
    version: 10.2.1
  pythran:
    include directory: ../../tmp/build-env-0fmy4m5d/lib/python3.13/site-packages/pythran
    version: 0.18.0
Machine Information:
  build:
    cpu: x86_64
    endian: little
    family: x86_64
    system: linux
  cross-compiled: false
  host:
    cpu: x86_64
    endian: little
    family: x86_64
    system: linux
Python Information:
  path: /tmp/build-env-0fmy4m5d/bin/python
  version: '3.13'

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.special

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions