Page 1 of 1

unable to change the model parameters from the command line

Posted: 02 Nov 2022, 12:50
by luca_tagliacozzo
Hallo there, I am trying to play around with the simulation class of tenpy.

I have defined my custom module, and everything works ok if I just specify the parameters of the model in the yml file (attached below)
However if I try to specify the parameters on the command line as suggested in the documentation I get the following error

Code: Select all

Traceback (most recent call last):
  File "/home/luca/anaconda3/envs/tenpy/bin/tenpy-run", line 10, in <module>
    sys.exit(console_main())
  File "/home/luca/anaconda3/envs/tenpy/lib/python3.9/site-packages/tenpy/__init__.py", line 89, in console_main
    set_recursive(options, key, val, insert_dicts=True)
NameError: name 'set_recursive' is not defined
I run the simulation from the command line with

Code: Select all

tenpy-run -i model_ising_uniform_staggerd_charge config_DMRG.yml -o model_params.h 1.0 


running just

Code: Select all

tenpy-run -i model_ising_uniform_staggerd_charge config_DMRG.yml
works just fine



The configuration file config_DMRG.yml

Code: Select all

#!/usr/bin/env -S python -m tenpy 

simulation_class : GroundStateSearch

directory: results
output_filename : Z2_staggered_charges_DMRG.h5

model_class :  ising_staggered_charge
model_params :
    L : 2
    bc_MPS : infinite
    J: -1. 
    l: 0.
    h: 0.
    conserve: 'yes'


initial_state_params:
    method : lat_product_state
    product_state : [['uod'],['dou']]

algorithm_class: TwoSiteDMRGEngine
algorithm_params:
    mixer : False
    trunc_params:
        svd_min: 1.e-8
        chi_max: 100

Re: unable to change the model parameters from the command line

Posted: 04 Nov 2022, 14:22
by Johannes
This should be fixed in the latest github version. I'll release a new version 0.10 (that can be installed with pip/conda) shortly. (Sorry, I didn't update the official releases for over a year, so there have a few fixes accumulated....)

Re: unable to change the model parameters from the command line

Posted: 04 Nov 2022, 19:52
by luca_tagliacozzo
Thanks Johannes looking forward to it,
Luca