Skip to content

Return none spin summed rdms #52

Open

Description

@ncrubin

RDMs returned from pyscf are spin summed. Use https://sunqm.github.io/pyscf/_modules/pyscf/fci/direct_spin1.html#FCISolver.make_rdm12s

to return non-spin summed versions. Recombine spin-separated RDMs like run_psi4 to get spin-orbital rdms before returning to OpenFermion.

Activity

  1. anishbhujbal7 commented on Sep 1, 2026

    @anishbhujbal7

    Hi @ncrubin,

    I’m interested in working on this issue if it is still available.
    I came across the issue while looking for a contribution related to OpenFermion and quantum chemistry. I noticed that the PySCF direct_spin1.py link referenced in the original issue is no longer available at that URL, so I wanted to check whether the proposed approach is still the preferred way to obtain the non-spin-summed RDMs with the current PySCF API.

    If the issue is still relevant, I’d be happy to investigate the current PySCF implementation, update the approach as needed, and work on the corresponding tests.

    Would it be possible to assign this issue to me if no one is currently working on it?

    Thanks!

  2. ncrubin commented on Sep 1, 2026

    @ncrubin
    CollaboratorAuthor

    Hi, Sure! I see the link is broken. The new link is probably here (http://github.com/pyscf/pyscf/blob/master/pyscf/fci/direct_spin1.py) though it has been awhile since I looked. The goal was to get spinorbital RDMs. You can probably also use the example

    http://github.com/pyscf/pyscf/blob/master/examples/fci/31-apply_2nd_quantized_op.py

    but it will be much slower

  3. anishbhujbal7 commented on Sep 2, 2026

    @anishbhujbal7

    Hi @ncrubin,

    I've finished implementing this using direct_spin1.make_rdm12s to get the non-spin-summed RDMs.
    I also fixed the slicing in test_accessing_rdm() to properly account for the cross-spin blocks ($\alpha\beta\beta\alpha$ and $\beta\alpha\alpha\beta$), and all tests are passing locally now.
    Should I go ahead and open a PR for review?
    Thanks!

  4. ncrubin commented on Sep 2, 2026

    @ncrubin
    CollaboratorAuthor

    sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions