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

Aperta
#41 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, data

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C++
Stelle
3
Fork
0
Merge medio
2g 8h
PR unite (30g)
31

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Algorithmiq/exa-dmrg

Tutte le issue di Algorithmiq/exa-dmrg

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.