You can still use the
tenpy.networks.site.set_common_charges (the multi_sites_combine_charges is deprecated) to do that.
If you specify
new_charges='independent'
, it does exactly what you're asking for: it conserves the total charge on the f1 sites separate from the one of the f2 site.
I'm not sure what kind of couplings you want between those chains (is one e.g. twice as long as the other?), but I could e.g imagine to use a Ladder and then remove some sites such that one is say 3 times shorter than the other.
Minimal example:
Code: Select all
import tenpy
from tenpy.networks.site import FermionSite, set_common_charges
from tenpy.models.model import CouplingMPOModel
from tenpy.models.lattice import Ladder, IrregularLattice
import matplotlib.pyplot as plt
class DoubleChains(CouplingMPOModel):
default_lattice = "Ladder"
force_default_lattice = True
def init_sites(self, model_params):
f1 = FermionSite(conserve='N')
f2 = FermionSite(conserve='N')
set_common_charges([f1, f2], new_charges='independent')
return [f1, f2]
def init_lattice(self, model_params):
L = model_params["L"] # long chain
ratio_short_long = int(model_params.get("ratio_short_long", 2))
assert L % ratio_short_long == 0, "L should be commensurate with ratio_short_long"
model_params['irregular_remove'] = [(x, 1) for x in range(L) if x % ratio_short_long != 0]
lat = super().init_lattice(model_params)
return lat
def init_terms(self, model_params):
L = model_params["L"] # long chain
ratio_short_long = int(model_params.get("ratio_short_long", 2))
t1 = model_params.get('t1', 1.)
t2 = model_params.get('t2', 1.)
U = model_params.get('U', 2.)
self.add_coupling(t1, 0, 'Cd', 0, 'C', dx=[1], plus_hc=True) # NN hopping chain 1 (long)
self.add_coupling(t2, 1, 'Cd', 1, 'C', dx=[ratio_short_long], plus_hc=True) # NN hopping chain 2 (short)
self.add_coupling(U, 0, 'N', 1, 'N', dx=[0]) # interaction between chains
M = DoubleChains({'L': 12, "ratio_short_long": 3})
print(M.lat.unit_cell[0].leg.chinfo)
ax = plt.gca()
M.lat.plot_sites(ax)
M.lat.plot_coupling(ax, [(0, 0, [1])], color='r', label='t1')
M.lat.plot_coupling(ax, [(1, 1, [M.options['ratio_short_long']])], color='b', label='t2')
M.lat.plot_coupling(ax, [(0, 1, [0])], color='g', label='U')
ax.legend()
ax.set_aspect(1.)
plt.show()
Which yields a lattice looking like this:
- example.png (4.92 KiB) Viewed 14756 times