Canonical Fiedler vector in degenerate eigenspaces

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

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp, python
Domain
backend, testing

Research direction

Start with the degenerate prototypes in tests/test_orbital_reordering.py and the sol.reorder handling at fcisolver.py:843. Review the projector and fallback proposal, then make the reordering test pass an explicit non-identity permutation so it independently checks the pull-back. Done means degenerate prototypes return a build-independent order, the warning remains when unresolved, and UnrestrictedReordering still checks the pull-back.

Written by the indexing model from the issue text.

Description

bug
What happened, and what did you expect?

🤖 AI text below 🤖

#121 made the order from fiedler_order independent of the LAPACK build for near-ties
between components (PR #). That fix cannot help when the Fiedler vector itself is
not unique: if λ2 = λ3 (or nearly), the eigenvector can be any vector of the eigenspace,
and the build picks one. The engine now warns on stderr when (λ2 − λ1)/‖L‖ or
(λ3 − λ2)/‖L‖ is below 1e-4, and returns the order anyway.

Proposal: define a canonical vector in that case.

  • f = P·r / ‖P·r‖, with P the projector on the eigenspace of the cluster containing
    λ2 (it does not depend on the basis the solver returns) and r_i = i − (n−1)/2 the
    centred ramp.
  • Conditions: the gap at the edges of the cluster is at least 1e-4·‖L‖, and
    ‖P·r‖/‖r‖ ≥ 1e-4.
  • Fallbacks if they fail: r_i = (i − c)², then unit vectors.

On every degenerate prototype checked, this gives a unique order.

It was left out of #121 because, on a uniform mutual information, the projector gives
the identity order, and UnrestrictedReordering.test_reordering_actually_reordered
rejects it. That guard exists because an identity permutation would make the other
assertions pass without exercising the pull-back. So this needs:

  1. A design review of the projector and its fallbacks.
  2. A guard that does not depend on the engine's choice: pass an explicit non-identity
    permutation as reorder (sol.reorder accepts a list through _reorder_setting,
    fcisolver.py:843).

Acceptance:

  • The order is unique, and the same on every build, for the degenerate prototypes.
  • UnrestrictedReordering still checks that a non-identity order is pulled back.
  • The warning stays for the cases the projector cannot resolve.

Refs: #121, PR #160 .

How to reproduce it

🤖 AI text below 🤖

Not a crash: the order of the orbitals changes with the build when the Fiedler vector
is degenerate, so there is no single failing command.

Where to see it: the degenerate prototypes in tests/test_orbital_reordering.py (the
tests that expect the warning [compop] WARNING: the Fiedler vector is degenerate,
added in PR #160 ). With reorder="fiedler" or "fiedler-mi", on an active space
whose weight matrix has a degenerate second eigenvalue, the engine prints that warning
and the returned order depends on the LAPACK build and core type.

Expected: one order, the same on every build.

Severity

None

Dominant language
C++
Stars
3
Forks
0
Avg merge
2d 8h
Merged PRs (30d)
31

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from Algorithmiq/exa-dmrg

All issues in Algorithmiq/exa-dmrg

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.