.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/QuantumIsing_2d_quench.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_QuantumIsing_2d_quench.py: Quench of the quantum Ising model in 2d. ======================================== .. GENERATED FROM PYTHON SOURCE LINES 16-85 .. code-block:: Python # pylint: disable=invalid-name import qtealeaves as qtl from qtealeaves.models import get_quantum_ising_2d def main(tn_type=5, output_folder=None, timesteps=160): """ Main method for the simulation of the dynamics of a 2d quantum Ising model. **Arguments** tn_type : int, optional Choose 5 for python-TTN, 6 for python-MPS. Default to 5. output_folder : str | None, optional Output folder. Default to None. timesteps : int, optional NUmber of timesteps. Default to 160. """ if output_folder is None: output_folder = lambda params: "QI2dDyn_L%d" % (params["L"]) model, my_ops = get_quantum_ising_2d() my_conv = qtl.convergence_parameters.TNConvergenceParameters( max_iter=5, max_bond_dimension=32 ) my_obs = qtl.observables.TNObservables() # Dynamics quench = qtl.DynamicsQuench([0.05] * timesteps, time_evolution_mode=2) quench["g"] = lambda tt, params: 1 - tt / 8.0 simulation = qtl.QuantumGreenTeaSimulation( model, my_ops, my_conv, my_obs, tn_type=tn_type, folder_name_output=output_folder, store_checkpoints=False, ) params = [] params.append( { "L": 4, "g": 1.0, "J": 0.0, "Quenches": [quench], "exclude_from_hash": ["Quenches"], } ) simulation.run(params, delete_existing_folder=True) print(f"\nExample `{__file__}` ran successfully; no asserts implemented.") return if __name__ == "__main__": main() .. _sphx_glr_download_auto_examples_QuantumIsing_2d_quench.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: QuantumIsing_2d_quench.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: QuantumIsing_2d_quench.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: QuantumIsing_2d_quench.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_