Qiskit / qiskit-tutorials

A collection of Jupyter notebooks showing how to use the Qiskit SDK
Apache License 2.0
2.28k stars 1.28k forks source link

Refer to Trotter Evolution in the video "Time Evolution with Qiskit Nature & Opflow" #1452

Closed OuCheng-Fu closed 1 year ago

OuCheng-Fu commented 1 year ago

Dear Everyone,

 I asked about how to implement Quantum Imaginary Time Evolution on IBM Qiskit, and I tried to implement Trotter Time Evolution by referencing this video ([Time Evolution with Qiskit Nature & Opflow - YouTube](https://www.youtube.com/watch?v=PY6PWondOeQ&list=LL&index=1)). At 7:23 of this video, the author tries to implement the trotter evolution of Ising model by the codes in the first picture; however, when I try to implement it on qiskit, it raises two errors: one is for time range: int object is not iterable and another one is "name 'param_bind' is not defined", like the latter 2 pictures I attached. What may be wrong in this process?

                                                                   Sincerely,

                                                                   Ou, Cheng-Fu

                                                                   2023/5/13

Trotter Evolution Code Error 1 Error 2

Raghav-Bell commented 1 year ago

As per documentation bind_parameters({parameter: parameter_value}) bind_parameters takes dictionary as input.Here param_bind refers to dictionary. ref: Qiskit documentation . As per tutorial notebook param_bind is initialized in cell 11 as follow: param_bind = { tau: 1, tau_def: 0.5 } please check if you forgot to initialize it.

OuCheng-Fu commented 1 year ago

Thank you. I have checked it and solved this issue.