seemps.hamiltonians.ConstantNNHamiltonian#
- class seemps.hamiltonians.ConstantNNHamiltonian#
Bases:
NNHamiltonianNearest-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:
- site
int First site of two (site and site+1) on which this interaction term acts.
- op1
Operator - op2
Operator,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
- site
- Returns:
ConstantNNHamiltonianThis same object.
- add_local_term(site: int, operator: Operator) ConstantNNHamiltonian[source]#
Upgrade this Hamiltonian with a local term acting on site.
- Parameters:
- site
int The site on which this operator acts.
- operator
Operator The operator in dense or sparse form
- site
- Returns:
ConstantNNHamiltonianThis same object, modified to account for this extra term.