Skip to content

Commit

Permalink
rename arg and add type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Jun 15, 2024
1 parent 7bce12d commit dbc2371
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/ffsim/hamiltonians/molecular_hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import dataclasses
import itertools
import os

import numpy as np
import pyscf.ao2mo
Expand Down Expand Up @@ -53,13 +54,13 @@ class MolecularHamiltonian:
constant: float = 0.0

@staticmethod
def from_fcidump(filename) -> MolecularHamiltonian:
def from_fcidump(file: str | bytes | os.PathLike) -> MolecularHamiltonian:
"""Initialize a MolecularHamiltonian from an FCIDUMP file.
Args:
filename: The FCIDUMP file name or path.
file: The FCIDUMP file path.
"""
data = pyscf.tools.fcidump.read(filename, verbose=False)
data = pyscf.tools.fcidump.read(file, verbose=False)
return MolecularHamiltonian(
one_body_tensor=data["H1"],
two_body_tensor=pyscf.ao2mo.restore(1, data["H2"], data["NORB"]),
Expand Down

0 comments on commit dbc2371

Please sign in to comment.