seemps.hamiltonians.ConstantNNHamiltonian#

class seemps.hamiltonians.ConstantNNHamiltonian#

Bases: NNHamiltonian

Nearest-neighbor 1D Hamiltonian with constant terms.

Parameters:
size: int

Number of quantum systems that this model is formed of.

dimension: int | list[int]

Either an integer denoting the dimension for all quantum subsystems, or a list of dimensions for each of the size objects.

add_interaction_term(i: int, op1: Operator, op2: TypeAliasForwardRef('~seemps.typing.Operator') | None = None) ConstantNNHamiltonian[source]#

Add an interaction term to this Hamiltonian, acting in ‘site’ and ‘site+1’. If ‘op2’ is None, then ‘op1’ is interpreted as an operator acting on both sites in matrix form. If ‘op1’ and ‘op2’ are both provided, the operator is np.kron(op1, op2).

Parameters:
siteint

First site of two (site and site+1) on which this interaction term acts.

op1Operator
op2Operator, optional

(Default value = None) If op2 is not supplied, then op1 is the complete Hamiltonian \(h_{i,i+1}\). Otherwise, the Hamiltonian is the Kronecker product of op1 and op2

Returns:
ConstantNNHamiltonian

This same object.

add_local_term(site: int, operator: Operator) ConstantNNHamiltonian[source]#

Upgrade this Hamiltonian with a local term acting on site.

Parameters:
siteint

The site on which this operator acts.

operatorOperator

The operator in dense or sparse form

Returns:
ConstantNNHamiltonian

This same object, modified to account for this extra term.

dimension(i: int) int[source]#

Return the physical dimension of the i-th quantum system.

interaction_term(i: int, t: float = 0.0) Operator[source]#

Return the same interaction term for sites i and i+1.