patrick-kidger / patrick-kidger/diffrax

SDE tests failing with complex inputs

Open
#422 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.1k
Forks
189
Avg merge
3d 18h
Merged PRs (30d)
1

Description

There are some tests for SDEs failing when adding complex inputs

 =========================== short test summary info ============================
FAILED test/test_integrate.py::test_sde_strong_order[complex128-ItoMilstein-any-0.5] - assert -0.2 < (Array(-0.00617573+0.01165244j, dtype=complex128) - 0.5)
FAILED test/test_integrate.py::test_sde_strong_order[complex128-SPaRK-any-0.5] - assert (Array(0.8286123-0.19839093j, dtype=complex128) - 0.5) < 0.2
FAILED test/test_integrate.py::test_sde_strong_order[complex128-GeneralShARK-any-0.5] - assert (Array(0.79761363-0.21382705j, dtype=complex128) - 0.5) < 0.2
FAILED test/test_integrate.py::test_sde_strong_order[complex128-StratonovichMilstein-com-1] - assert (Array(1.21753621+0.37906851j, dtype=complex128) - 1) < 0.2
FAILED test/test_integrate.py::test_sde_strong_order[complex128-SPaRK-com-1] - assert (Array(1.21429825+0.13029023j, dtype=complex128) - 1) < 0.2

Note that not all instances of this test are failing, so the problem is likely in the specific solvers.
I'd love to look into it, but I'm not an expert on stochastic SDEs, and some guidance would be appreciated. Specifically, are there any "usual suspects" regarding what could go wrong? Is there a toy example worth starting from?
Also, can the order be complex or is it itself a problem? If it is, should we take the abs or the real part for comparison?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing parametrizations in test/test_integrate.py::test_sde_strong_order, comparing the listed complex128 cases with passing solver instances. Read the changes referenced by pull request 418 and inspect ItoMilstein, SPaRK, GeneralShARK, and StratonovichMilstein. Done means identifying the solver-specific cause and making the affected strong-order tests pass with an appropriate complex-valued comparison.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.