I'm currently trying to run a DMRG ground state calculation on a triangular lattice with open boundaries, and with an arbitrarily shaped geometry.
To create the arbitrary geometry, I start with a rhombus shaped triangular lattice, generated with the model.lattice.Triangular class, and modify it by adding and removing sites using the models.lattice.IrregularLattice(reg_lat, remove=lat_idx) function.
This lattice initialisation step is done in an init_lattice(self, model_params) functions in the class SpinModel_triangular_finite(CouplingMPOModel) that generates the model.
The sites are initialised using:
Python: Select all
def init_sites(self, model_params):
S = model_params.get('S', 0.5)
conserve = None
sort_charge = model_params.get('sort_charge', None)
site = SpinHalfSite(conserve, sort_charge)
return site
I then run DMRG in the following way:
Python: Select all
myModel = SpinModel_triangular_finite(model_params)
product_state = ["down"] * N_sites
psi0 = MPS.from_product_state(myModel.lat.mps_sites(), product_state)
info = dmrg.run(psi0, myModel, dmrg_params, orthogonal_to = orthogonal_to)
Python: Select all
File "/Users/emmanuel.gottlob/materials_old/nbs/Examples/clock_phase_rydberg_hexagon.py", line 390, in spin_solver_tenpy_finite_r6_lowest_states
info = dmrg.run(psi, myModel, dmrg_params)#, orthogonal_to = orthogonal_to)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emmanuel.gottlob/miniforge3/envs/emu/lib/python3.12/site-packages/tenpy/algorithms/dmrg.py", line 97, in run
engine = TwoSiteDMRGEngine(psi, model, options, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/emmanuel.gottlob/miniforge3/envs/emu/lib/python3.12/site-packages/tenpy/algorithms/dmrg.py", line 210, in __init__
super().__init__(psi, model, options, **kwargs)
File "/Users/emmanuel.gottlob/miniforge3/envs/emu/lib/python3.12/site-packages/tenpy/algorithms/mps_common.py", line 135, in __init__
super().__init__(psi, model, options, **kwargs)
File "/Users/emmanuel.gottlob/miniforge3/envs/emu/lib/python3.12/site-packages/tenpy/algorithms/algorithm.py", line 95, in __init__
consistency_check(N_sites_per_ring, self.options, 'max_N_sites_per_ring', 18,
File "/Users/emmanuel.gottlob/miniforge3/envs/emu/lib/python3.12/site-packages/tenpy/tools/misc.py", line 978, in consistency_check
if not compare_func(value, threshold):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'NoneType' and 'int'
Many thanks!