Menu

Issues with Quantum Trajectory Simulation

Technical
2022-02-03
2022-02-16
  • Pablo Pinedo

    Pablo Pinedo - 2022-02-03

    Attached is a simplification of the main script I have been using. Listed are some issues that I have encountered:

    1. The output files have extra spaces which lead to errors when reading the observables. I added a few lines of code to fix this issue, but I think it's important to take note that this is happening.
    2. I can't seem to find a way to specify the number of trajectories over which the code is running. Along with this, running the code multiple times gives the exact same results. This to me indicated that the random seed in the QT evolution is instead fixed. I may have missed where the number of trajectories or seed is specified, either way some clarification would be appreciated.
    3. This point assumes the 2 qubit Hamiltonian H=B(sigma1_z+sigma2_z)+J(sigma1_x+sigma2_x). Running the code give kyrlov errors unless the dissipation rate is nonzero. Along with this, the dissipation does not seem to be occurring.

    Thank you for any help with these questions.

     
    • Daniel Jaschke

      Daniel Jaschke - 2022-02-03

      Hi Pablo,

      the quick feedback is:

      1) Use TDVP, do not use Krylov.
      2) There is no key-value pair in the parameter dictionary for the "QT", see
      at the end of the function description
      https://openmps.sourceforge.io/pyautodoc/tools.html?highlight=writefiles#tools.WriteFiles
      3) There are no Lindblad operators defined, i.e., we have pure Hamiltonian
      dynamics. The seed is for each trajectory different and you do not have to
      run the script multiple time. It is done internally once (2) is set.
      4) An MPS with two sites was creating problems in the past, which I think
      are fixed. But if you keep getting strange errors, I would try if you get
      the same error with 4 sites.

      Bests,

      Daniel

      On Thu, Feb 3, 2022 at 3:33 AM Pablo Pinedo ppinedo@users.sourceforge.net
      wrote:

      Attached is a simplification of the main script I have been using. Listed
      are some issues that I have encountered:

      1. The output files have extra spaces which lead to errors when
        reading the observables. I added a few lines of code to fix this issue, but
        I think it's important to take note that this is happening.
      2. I can't seem to find a way to specify the number of trajectories
        over which the code is running. Along with this, running the code multiple
        times gives the exact same results. This to me indicated that the random
        seed in the QT evolution is instead fixed. I may have missed where the
        number of trajectories or seed is specified, either way some clarification
        would be appreciated.
      3. This point assumes the 2 qubit Hamiltonian H=B
        (sigma1_z+sigma2_z)+J(sigma1_x+sigma2_x). Running the code give
        kyrlov errors unless the dissipation rate is nonzero. Along with this, the
        dissipation does not seem to be occurring.

      Thank you for any help with these questions.

      Issues with Quantum Trajectory Simulation
      https://sourceforge.net/p/openmps/discussion/tech/thread/4cb4b4fd52/?limit=25#6a21


      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/

       
      • Pablo Pinedo

        Pablo Pinedo - 2022-02-16

        Thanks for the help Daniel!

        I believe I made all of your suggested changes. I added the QT key-value pair to the parameter dictionary, but when the number of trajectories is greater than 1 I get the following error:

        Execute_MPSMain testwrite/testB_1.0Main.nml 2
         running with           0           0           1
        At line 21081 of file /openmps/MPSFortLib/Mods/ObsOps.f90 (unit = 18)
        Fortran runtime error: Cannot open file 'testwrite//testB_1.00ObsMPO_1.dat': No such file or directory
        
        Error termination. Backtrace:
        #0  0x7fd017a98f81 in already_open
                at /home/rdonnelly/mc/conda-bld/compilers_linux-64_1534627447954/work/.build/x86_64-conda_cos6-linux-gnu/src/gcc/libgfortran/io/open.c:704
        #1  0x556f3d187384 in ???
        #2  0x556f3d199cba in ???
        #3  0x556f3d300726 in ???
        #4  0x556f3d33d85a in ???
        #5  0x556f3d345899 in ???
        #6  0x556f3ced36e4 in ???
        #7  0x7fd01569e82f in ???
        #8  0x556f3ced3714 in ???
                at ../sysdeps/x86_64/elf/start.S:103
        Traceback (most recent call last):
          File "quantum_trajectory_short.py", line 82, in <module>
            mps.runMPS(MainFiles)
          File "/conda/envs/openmps/lib/python3.7/site-packages/MPSPyLib/tools.py", line 398, in runMPS
            raise MPSFortLibError(ret_val)
        MPSPyLib.tools.MPSFortLibError: MPSFortLib quit with fatal return code 2!
        

        I'm not quite sure what the exact error is and wanted to see if you had experienced something like this before. Attached is my code.

        Thanks again for your help,
        Pablo

         
        • Daniel Jaschke

          Daniel Jaschke - 2022-02-16

          Hi Pablo,

          a few points:

          • You have no Lindblad operators defined, so you cannot expect any decay.
          • The default initial state for the time evolution is the ground state of
            the Hamiltonian. Then, you evolve under the same Hamiltonian, i.e., you
            will stay in the eigenstate.
          • The time step you set is taken as-is by OSMPS. A time-step dt=1 is a bit
            big, especially TDVP will have problems.

          Suggestions:
          - Switch off J for the ground state search, your initial state will be a
          product state of all spins aligned.
          - Switch on J for the time evolution and switch off B; you will see Rabi
          oscillations.
          - Then, add a Lindblad term: H.AddMPOTerm('lind1', 'sminus',
          hparam='gamma', weight=1.0). The Rabi oscillations will be in an envelope
          with an exponential decay.

          Once you have verified that this is working, you should think how to
          initialize your initial state (either as a ground state or just as input
          file). For open systems, you need a Lindblad term in your MPO (the Lindblad
          term will be neglected during the ground state search; I think there is a
          steady-state search, too; but that sounds not like it would help in your
          problem.)

          Bests,

          Daniel

          On Wed, Feb 16, 2022 at 1:35 AM Pablo Pinedo ppinedo@users.sourceforge.net
          wrote:

          Thanks for the help Daniel!

          I believe I made all of your suggested changes. I added the QT key-value
          pair to the parameter dictionary, but when the number of trajectories is
          greater than 1 I get the following error:

          Execute_MPSMain testwrite/testB_1.0Main.nml 2
          running with 0 0 1At line 21081 of file /openmps/MPSFortLib/Mods/ObsOps.f90 (unit = 18)Fortran runtime error: Cannot open file 'testwrite//testB_1.00ObsMPO_1.dat': No such file or directory
          Error termination. Backtrace:#0 0x7fd017a98f81 in already_open
          at /home/rdonnelly/mc/conda-bld/compilers_linux-64_1534627447954/work/.build/x86_64-conda_cos6-linux-gnu/src/gcc/libgfortran/io/open.c:704#1 0x556f3d187384 in ???#2 0x556f3d199cba in ???#3 0x556f3d300726 in ???#4 0x556f3d33d85a in ???#5 0x556f3d345899 in ???#6 0x556f3ced36e4 in ???#7 0x7fd01569e82f in ???#8 0x556f3ced3714 in ???
          at ../sysdeps/x86_64/elf/start.S:103Traceback (most recent call last):
          File "quantum_trajectory_short.py", line 82, in <module>
          mps.runMPS(MainFiles)
          File "/conda/envs/openmps/lib/python3.7/site-packages/MPSPyLib/tools.py", line 398, in runMPS
          raise MPSFortLibError(ret_val)MPSPyLib.tools.MPSFortLibError: MPSFortLib quit with fatal return code 2!</module>

          I'm not quite sure what the exact error is and wanted to see if you had
          experienced something like this before. Attached is my code.

          Thanks again for your help,
          Pablo

          Attachments:


          Issues with Quantum Trajectory Simulation
          https://sourceforge.net/p/openmps/discussion/tech/thread/4cb4b4fd52/?limit=25#6a21/fec7/40ab


          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/

           

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.