quimb.tensor.tn2dinf.tebd ========================= .. py:module:: quimb.tensor.tn2dinf.tebd .. autoapi-nested-parse:: Local Hamiltonians and imaginary-time simple update for infinite, translation-invariant 2D tensor networks (``tn2dinf``). Classes ------- .. autoapisummary:: quimb.tensor.tn2dinf.tebd.LocalHamInfinite2D quimb.tensor.tn2dinf.tebd.SimpleUpdateInfinite2D Module Contents --------------- .. py:class:: LocalHamInfinite2D(geometry_or_edges, H2, H1=None) Bases: :py:obj:`quimb.tensor.tnag.tebd.LocalHamGen` A local Hamiltonian on an infinite 2D lattice, defined per ``bond_type`` and ``site_type`` (translation classes) rather than per concrete bond/site. Single-site terms are absorbed evenly into the covering two-site terms and operations on the terms (matrix exponential, etc.) are cached. The Hamiltonian carries its own ``GeometryInfinite2D`` which may differ from a wavefunction's geometry as long as the ``site_types`` match (e.g. a longer-range Hamiltonian on a nearest-neighbor PEPS). :param geometry_or_edges: The Hamiltonian's geometry (or edges to build one from). :type geometry_or_edges: GeometryInfinite2D or sequence of edges :param H2: The two-site interaction terms. A single array is used as the default term for every ``bond_type``. A dict gives per-``bond_type`` terms, with ``None`` as an optional default. Keys may be given in either orientation (canonicalized via ``geometry.get_bond_type``, flipping the operator if needed). :type H2: array_like or dict[bond_type, array_like] :param H1: The one-site term(s), absorbed evenly into the covering two-site terms. A single array is the default for every ``site_type``. A dict gives per-``site_type`` terms, with ``None`` as an optional default. :type H1: array_like or dict[site_type, array_like], optional .. attribute:: terms The total effective local term for each ``bond_type``. :type: dict[bond_type, array_like] .. attribute:: geometry The Hamiltonian's geometry. :type: GeometryInfinite2D .. py:attribute:: _op_cache .. py:attribute:: terms .. py:attribute:: _site_type_to_covering .. py:property:: site_types The unique site_types in the unit cell. .. py:property:: bond_types The unique bond_types in the unit cell. .. py:property:: nsites The number of site_types in the unit cell. .. py:method:: get_gate(where) Get the local term for the ``bond_type`` of ``where``, cached. .. py:method:: get_auto_ordering(order='sort', group=False, **kwargs) Ordering of ``bond_types`` into commuting (non site_type-overlapping) groups, delegated to the geometry. .. py:method:: draw(*args, **kwargs) Draw the Hamiltonian's geometry. .. py:method:: __repr__() .. py:class:: SimpleUpdateInfinite2D(psi0, ham, *args, compute_energy_per_site=True, **kwargs) Bases: :py:obj:`quimb.tensor.tnag.tebd.SimpleUpdateGen` Imaginary-time simple update for an infinite 2D PEPS. Drives a ``PEPSInfinite2D`` state under a ``LocalHamInfinite2D``, reusing quimb's ``SimpleUpdateGen`` for all loop logic (tau schedule, gate ordering, periodic gauge equilibration, energy history and convergence). The state provides the simple-update surface the driver calls into (``gate_simple_``, ``gauge_all_simple_``, ``normalize_simple``, ``gauge_simple_insert``, ``compute_local_expectation_cluster``), keyed by translation class so updates are shared across the lattice. Parameters mirror ``quimb.tensor.tnag.tebd.SimpleUpdateGen``, e.g.:: su = SimpleUpdateInfinite2D(psi, ham, D=4) su.evolve(100, tau=0.3) su.evolve(100, tau=0.1) psi_final, gauges = su.get_state(absorb_gauges="return") .. rubric:: Notes - The loop energy is the ``max_distance=0`` cluster estimate; ``PEPSInfinite2D`` also offers larger clusters (more accurate) and generalized-loop expansions (cheaper than the equivalent-size cluster, but less accurate) for measuring the final state. - Only ``update="sequential"`` is reliable: the inherited sweep groups gates into layers by literal site, whereas the translation-invariant conflict rule is by ``site_type``, so ``update="parallel"`` (and per-layer equilibration) are not supported yet. .. py:method:: compute_local_expectation_cluster(terms=None, **kwargs) Cluster expectation of ``terms`` on the current state, inserting the driver's current gauges as the environment. ``terms`` defaults to the Hamiltonian and ``gauges`` to ``self.gauges``, so a bare ``su.compute_local_expectation_cluster()`` measures the energy per unit cell. Forwards to :meth:`PEPSInfinite2D.compute_local_expectation_cluster`, so ``max_distance``, ``return_all``, etc. pass straight through. Returns the summed (per unit cell) value, not per-site; divide by ``self.ham.nsites`` to compare with :attr:`energy`. For a meaningful estimate the gauges should be equilibrated with the current tensors, with no pending imaginary-time gate, e.g. straight after :meth:`evolve` or via :meth:`equilibrate`. .. py:method:: compute_local_expectation_gloop_expand(terms=None, gloops=None, **kwargs) Generalized-loop-expansion expectation of ``terms`` on the current state, inserting the driver's current gauges. ``terms`` defaults to the Hamiltonian and ``gauges`` to ``self.gauges``. Forwards to :meth:`PEPSInfinite2D.compute_local_expectation_gloop_expand`. See :meth:`compute_local_expectation_cluster` for the per-cell return convention and the equilibration note.