Skip to content

Commit

Permalink
remove MolecularChain class
Browse files Browse the repository at this point in the history
  • Loading branch information
bartandrews committed Nov 12, 2024
1 parent e25a1d1 commit 1e6858e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 38 deletions.
2 changes: 0 additions & 2 deletions python/ffsim/tenpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
sym_cons_basis,
)
from ffsim.tenpy.circuits.lucj_circuit import lucj_circuit_as_mps
from ffsim.tenpy.hamiltonians.lattices import MolecularChain
from ffsim.tenpy.hamiltonians.molecular_hamiltonian import MolecularHamiltonianMPOModel
from ffsim.tenpy.util import product_state_as_mps

Expand All @@ -33,7 +32,6 @@
"apply_orbital_rotation",
"givens_rotation",
"lucj_circuit_as_mps",
"MolecularChain",
"MolecularHamiltonianMPOModel",
"num_interaction",
"num_num_interaction",
Expand Down
2 changes: 1 addition & 1 deletion python/ffsim/tenpy/circuits/gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def apply_diag_coulomb_evolution(
"""

# extract norb
norb, _ = mat.shape
_, norb, _ = mat.shape

# unpack alpha-alpha and alpha-beta matrices
mat_aa, mat_ab = mat
Expand Down
2 changes: 0 additions & 2 deletions python/ffsim/tenpy/hamiltonians/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@

"""Classes for converting Hamiltonians to TeNPy MPOModel objects."""

from ffsim.tenpy.hamiltonians.lattices import MolecularChain
from ffsim.tenpy.hamiltonians.molecular_hamiltonian import MolecularHamiltonianMPOModel

__all__ = [
"MolecularChain",
"MolecularHamiltonianMPOModel",
]
31 changes: 0 additions & 31 deletions python/ffsim/tenpy/hamiltonians/lattices.py

This file was deleted.

14 changes: 12 additions & 2 deletions python/ffsim/tenpy/hamiltonians/molecular_hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
from __future__ import annotations

import numpy as np
from tenpy.models.lattice import Lattice
from tenpy.models.model import CouplingMPOModel
from tenpy.networks.site import SpinHalfFermionSite

from ffsim.hamiltonians.molecular_hamiltonian import MolecularHamiltonian
from ffsim.tenpy.hamiltonians.lattices import MolecularChain

# ignore lowercase variable checks to maintain TeNPy naming conventions
# ruff: noqa: N806
Expand All @@ -34,7 +34,17 @@ def init_lattice(self, params):
L = params.get("L", 1)
norb = params.get("norb", 4)
site = self.init_sites(params)
lat = MolecularChain(L, norb, site, basis=[[norb, 0], [0, 1]])
basis = np.array(([norb, 0.0], [0, 1]))
pos = np.array([[i, 0] for i in range(norb)])
lat = Lattice(
[L, 1],
[site] * norb,
order="default",
bc="open",
bc_MPS="finite",
basis=basis,
positions=pos,
)
return lat

def init_terms(self, params):
Expand Down

0 comments on commit 1e6858e

Please sign in to comment.