I have been looking through the code to try and find a way to make the 'weight' argument vary over different bond and field sites in an Ising model. I was wondering if this was at all possible with openmps, and how it could be done.
Thanks,
Had
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can introduce site-dependent Hamiltonian parameters to any model by
passing numpy arrays instead of scalars in your parameters dictionary. For
'bond' terms the array should be of length L-1 and for 'site' terms it
should have length L. Note that no change to the definition of the
Hamiltonian in AddMPOTerm is necessary.
To use this functionality, you will want to get the most recent OpenMPS
from the repository. You can get it from the svn as
I have been looking through the code to try and find a way to make the
'weight' argument vary over different bond and field sites in an Ising
model. I was wondering if this was at all possible with openmps, and how it
could be done.
In a previous post you wrote that AddMPO function in 'site' and 'bond' modes accepts numpy arrays of parameters (length L and L-1, respectively).
We are trying to pass numpy arrays in 'FiniteFunction' mode as well. It seems to accept arrays, and reacts to some values but we could not work out how exactly those arrays are used. Could anyone explain, please, or point to some documentation.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As for the lsing model in the example .I only change codes
J=1.0 to J= np.array([1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0])
the result is
Traceback (most recent call last):
File "01_IsingStatics.py", line 105, in <module>
main(PostProcess=Post)
File "01_IsingStatics.py", line 65, in main
PostProcess=PostProcess)
File "/usr/local/lib/python2.7/dist-packages/MPSPyLib/tools.py", line 1242, in WriteFiles
append_hash2map(p, GsHash)
File "/usr/local/lib/python2.7/dist-packages/MPSPyLib/tools.py", line 1307, in append_hash2map
raise ValueError("Cannot rerun simulation with different params!")
ValueError: Cannot rerun simulation with different params!</module>
It confuses me ,I want to solve this problem.
Thanks,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have been looking through the code to try and find a way to make the 'weight' argument vary over different bond and field sites in an Ising model. I was wondering if this was at all possible with openmps, and how it could be done.
Thanks,
Had
Hello Had,
You can introduce site-dependent Hamiltonian parameters to any model by
passing numpy arrays instead of scalars in your parameters dictionary. For
'bond' terms the array should be of length L-1 and for 'site' terms it
should have length L. Note that no change to the definition of the
Hamiltonian in AddMPOTerm is necessary.
To use this functionality, you will want to get the most recent OpenMPS
from the repository. You can get it from the svn as
svn checkout svn://svn.code.sf.net/p/openmps/code/
-Michael
On Mon, Sep 29, 2014 at 6:40 AM, Hadayat Seddiqi hadsed@users.sf.net
wrote:
Dear Michael, Dear All,
In a previous post you wrote that AddMPO function in 'site' and 'bond' modes accepts numpy arrays of parameters (length L and L-1, respectively).
We are trying to pass numpy arrays in 'FiniteFunction' mode as well. It seems to accept arrays, and reacts to some values but we could not work out how exactly those arrays are used. Could anyone explain, please, or point to some documentation.
Thanks!
As for the lsing model in the example .I only change codes
J=1.0 to J= np.array([1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0])
the result is
Traceback (most recent call last):
File "01_IsingStatics.py", line 105, in <module>
main(PostProcess=Post)
File "01_IsingStatics.py", line 65, in main
PostProcess=PostProcess)
File "/usr/local/lib/python2.7/dist-packages/MPSPyLib/tools.py", line 1242, in WriteFiles
append_hash2map(p, GsHash)
File "/usr/local/lib/python2.7/dist-packages/MPSPyLib/tools.py", line 1307, in append_hash2map
raise ValueError("Cannot rerun simulation with different params!")
ValueError: Cannot rerun simulation with different params!</module>
It confuses me ,I want to solve this problem.
Thanks,
The error "Cannot rerun simulation with different params!" is answered in another topic https://sourceforge.net/p/openmps/discussion/users/thread/49b7ed30/
Hi Daniel,
It works well- thanks for all your help very much!
Best,
Weijie