Reading determinants back from an external SCI solver: the format and index convention are unfixed

Open
#41 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
28/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend, data

Research direction

Read python/unrestricted_FCIDUMP.py, ci_to_mps.as_dets, and examples/python/mps/04-guess_from_determinants.py to trace the existing determinant conventions and chain constraints. Add format adapters that feed one internal converter, starting with SBD/Dice dets text, then gate the round trip with tests/python/test_unrestricted_fcidump.py. Done means the converted chain’s energy matches the same wavefunction contracted by PySCF, including index, phase, frozen-core, and orbital-order conventions.

Written by the indexing model from the issue text.

Description

The starting-guess round trip is half built. Outbound has a module: python/unrestricted_FCIDUMP.py
writes the active space for an external SCI solver. Inbound has nothing — the step from that
solver's determinant output to something ci_to_mps.as_dets accepts is currently the caller's
problem, with no fixed format and no documented target convention.

What has to be pinned

Each of these is a silent wrong energy if guessed, not a crash:

  • Index convention. unrestricted_FCIDUMP._interleaved writes 2*p + spin + 1 — SBD's
    _UHF indexing, spin alternating one spatial orbital at a time, deliberately not the
    Qiskit-fermions contiguous-alpha-then-beta block. So determinants come back over 2*ncas
    interleaved spin-orbitals, while our internal currency is ncas spatial occupations
    0/1/2/3 = empty/alpha/beta/doubly. Nothing folds one into the other.
  • Coefficient convention. as_dets expects PySCF's spin-grouped ordering (all a+ then all
    b+) and before the Li 2021 Eq. 13 phase, which ci_encoding applies. A list that arrives
    already phased, or in the solver's own ordering, converts without complaint.
  • Normalization. Accepted either way — from_ci folds the norm into site 0 — so an
    unnormalized list is not an error but shows up in canonical_error()[0] and nowhere else.
  • Frozen core. ci_to_dets/cisd_dets take ncore=; a solver's determinants may or may not
    include it.
  • Orbital order. Determinants name orbitals, the chain names sites. With reorder active the
    permutation must be passed (dets_to_chain(..., order=)) so the fermionic sign is carried;
    dropping it leaves every dimension right and moves the energy by ~1e-1 Ha.
  • The last-bond constraint. The final orbital must appear in all four occupations across the
    list, or mps_env_isometries refuses the chain (see
    examples/python/mps/04-guess_from_determinants.py). A truncated CI can easily violate this.
Shape

One adapter per input format, all funnelling into one converter to the internal encoding — the
same "one internal currency" split ci_guess already uses, so every format shares the tests
below it. Formats worth having: SBD/Dice dets text, and whatever else we actually feed it.

Home: beside the outbound half rather than in ci_to_mps. This is I/O and a convention, not MPS
algebra, and unrestricted_FCIDUMP.py is already the module that owns "the format an external
SCI solver speaks".

Gate it as a round trip: write an active space out, read a determinant file back, convert,
and check the energy of the resulting chain against the same wavefunction contracted by pyscf.
That is the only check that sees an index-convention error — tests/python/test_unrestricted_fcidump.py
already gates the outbound half that way.

Related: #34 (MPS storage, whose MPS half is #36). This is the CI/determinant path, not the MPS
file format.

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.