Hamiltonians#
In addition to states, we provide some convenience classes to represent quantum Hamiltonians acting on composite quantum systems. These Hamiltonians can be constant, time-dependent or translationally invariant. They can be converted to matrices, tensors or matrix-product operators.
Nearest-neighbor Hamiltonians#
The basic class is NNHamiltonian,
an abstract object representing a sum of nearest-neighbor operators \(H = \sum_{i=0}^{N-2} h_{i,i+1}\)
where each \(h_{i,i+1}\) acts on a different, consecutive pair of quantum
objects. This class is extended by different convenience classes that simplify
the construction of such models, or provide specific, well-known ones:
Abstract class representing a Hamiltonian for a 1D system with nearest-neighbor interactions. |
|
Nearest-neighbor 1D Hamiltonian with constant terms. |
|
Translationally invariant Hamiltonian with constant nearest-neighbor interactions. |
|
Nearest-neighbor Hamiltonian with constant Heisenberg interactions over 'size' S=1/2 spins. |
As example of use, we provide the HeisenbergHamiltonian class,
which creates the model \(\sum_i \vec{S}_i\cdot\vec{S}_{i+1}\) more or less
like this:
>>> SdotS = 0.25 * (sp.kron(σx, σx) + sp.kron(σy, σy) + sp.kron(σz, σz))
>>> ConstantTIHamiltonian(size, SdotS)
These classes are required for algorithms such as TEBD and Trotter evolution (see TEBD Time evolution) that need access to the individual nearest-neighbor interaction terms.
General Hamiltonian construction#
The more advanced class is InteractionGraph, an
object that can record all types of interactions in a quantum system and produce
both the MPO and sparse matrix representation for it.
Unlike typical DMRG libraries, all SeeMPS algorithms work with matrix product
operators, so this class provides a convenient way to construct MPOs from
physical models.
Proxy object to help in the construction of MPOs from local terms and arbitrary interactions. |
The class works by collecting interacting terms in a database. This database is then used to create an artificial MPS that represents all the interactions and local terms. The MPS is brought into the simplest form possible with a compression stage, and it is then used to recreate the final MPO. This technique allows the algorithm to discover that nearest neighbor interactions \(\sum_i J_i\sigma^z_i\sigma^z_{i+1}\) can be written with bond dimension two, and other interesting simplifications.
Supported interaction types#
InteractionGraph supports three types of terms:
Local terms: \(\sum_i h_i O_i\)
Nearest-neighbor interactions: \(\sum_i J_i O_i O_{i+1}\)
Long-range interactions: \(\sum_{ij} J_{ij} O_i O_j\)
Example: Heisenberg model#
The Heisenberg model \(H = \sum_i \vec{S}_i \cdot \vec{S}_{i+1}\) can be created as:
>>> ig = InteractionGraph(dimensions=[2] * 10)
>>> for O in [σx, σy, σz]:
... ig.add_nearest_neighbor_interaction(O, O)
>>> mpo = ig.to_mpo()
Example: Long-range Ising model#
Any kind of long-range interactions can be created:
>>> L = 10
>>> long_range_Ising = InteractionGraph(dimensions=[2] * L)
>>> J = np.random.normal(size=(L, L))
>>> long_range_Ising.add_long_range_interaction(J, σx, σx)
>>> mpo = long_range_Ising.to_mpo()
Example: Transverse-field Ising model#
Combining local and interaction terms:
>>> L = 10
>>> h = 0.5 # transverse field strength
>>> J = 1.0 # coupling strength
>>> tfim = InteractionGraph(dimensions=[2] * L)
>>> tfim.add_identical_local_terms(h * σx) # transverse field
>>> tfim.add_nearest_neighbor_interaction(σz, σz, weights=J)
>>> mpo = tfim.to_mpo()
Hermiticity preservation#
By applying the simplification stage onto the internal MPS representation and not the MPO directly, the algorithm ensures that Hermiticity is preserved, even if the final operator is within machine precision of the desired Hamiltonian.
See also#
Density-Matrix Renormalization Group - Ground state search using MPO Hamiltonians
TEBD Time evolution - Time evolution for nearest-neighbor Hamiltonians
Quantum registers - Quantum circuits using Hamiltonian evolution layers