qojulia / qojulia/QuantumInputOutput.jl

bug: effective_input_mode uses target coupling in i>2 cross term

Open
#71 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
7
Forks
0
Avg merge
7h 15m
Merged PRs (30d)
26

Description

Problem

A theory/documentation audit of the multimode virtual-cavity recursion found a likely correctness bug in effective_input_mode for nonzero chains with i > 2.

The current implementation defines gui_t = gu_i(t) and accumulates

coupling_sum += gui_t' * α[k]

for every preceding cavity k < j.

For the three-input case, the explicit derivation in Kiilerich & Mølmer, Phys. Rev. A 102, 023717 (2020), Appendix, gives

\dot\alpha_{u_3}^{(2)}
= -g_{u_2}\left(u_3-g_{u_1}^*\alpha_{u_3}^{(1)}\right)
+ \frac{|g_{u_2}|^2}{2}\alpha_{u_3}^{(2)},

so the cross term must use the coupling of each preceding cavity, g_{u_k}^*, not the target coupling g_{u_i}^*.

The source already notes two typographical errors in the paper's compact general Eq. (A15)/(49): the final sign and the self-coupling index. The explicit two- and three-mode equations also disambiguate the cross-term index.

Current coverage

test/test_utils.jl exercises:

  • nonzero effective_input_mode(..., i=2);
  • i=3 only with all couplings set to zero.

That means the i>2 cross-coupling path is not currently regression-tested.

Likely fix

Inside multiple_inputs_α!, the sum should use the preceding coupling corresponding to k, e.g.

coupling_sum += gu_buf[k]' * α[k]

rather than gui_t' * α[k].

Add a nonzero three-input regression against the explicit recursive equations before changing the implementation.

This was discovered while restructuring the manual/theory in PR #69; that PR should remain documentation-focused.

Contributor guide

No contributing guide indexed for this repository

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 test/test_utils.jl and the multiple_inputs_α! implementation that supports effective_input_mode. Run the existing i=2 tests, then add a nonzero three-input case based on the explicit recursive equations in the issue. Done means the regression passes and the i>2 cross-coupling path uses the preceding cavities' couplings.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.