qiskit-community / qiskit-nature

Qiskit Nature is an open-source, quantum computing, framework for solving quantum mechanical natural science problems.
https://qiskit-community.github.io/qiskit-nature/
Apache License 2.0
301 stars 205 forks source link

Refactor FCIDump integration into `qiskit_nature.second_q.formats` #787

Closed mrossinek closed 2 years ago

mrossinek commented 2 years ago

What is the expected enhancement?

Adding support for the QCSchema introduced the new notion of "formats" in form of the qiskit_nature.second_q.formats module. The existing support for the FCIDump format (currently implemented as a driver) would fit into that module a lot more naturally than under its current location. This issue suggests, that the implementation be moved to become something along the lines of the following:

# qiskit_nature.second_q.formats.fcidump

@dataclass
class FCIDump:
    hij
    hij_b
    hijkl
    hijkl_ba
    hijkl_bb
    multiplicity
    num_electrons
    num_orbitals

    @classmethod
    def from_file(cls, fcidump: str | Path) -> FCIDump:
        """Constructs an FCIDump object from a file."""
        ...

    def to_file(self) -> None:
        """Dumps an FCIDump object to a file."""
        ...
mrossinek commented 2 years ago

Closed via #799