Menu

Variable bond weights in Ising model

Technical
2014-09-29
2018-12-11
  • Hadayat Seddiqi

    Hadayat Seddiqi - 2014-09-29

    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

     
    • Michael L Wall

      Michael L Wall - 2014-09-29

      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:

      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

      Variable bond weights in Ising model
      https://sourceforge.net/p/openmps/discussion/tech/thread/36c527d5/?limit=25#5a58


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/openmps/discussion/tech/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • MrModern

        MrModern - 2015-10-30

        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!

         
  • Weijie Huang

    Weijie Huang - 2018-12-09

    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,

     
  • Weijie Huang

    Weijie Huang - 2018-12-11

    Hi Daniel,

    It works well- thanks for all your help very much!

    Best,
    Weijie

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.