4.1. tnpy.model.RandomHeisenberg#

class tnpy.model.RandomHeisenberg(n, h, penalty=0, s_target=0, offset=0, trial_id=None, seed=None)[source]#

Bases: tnpy.model.model_1d.Model1D

The Hamiltonian

\[H = \sum_{i=0}^{N-1} \mathbf{S}_i\cdot\mathbf{S}_{i+1} + h_i S_i^z\]

with \(h_{i} \in [-h, h)\) are sampled uniformly.

If the penalty strength \(\lambda \neq 0\), a penalty term will be taken into account

\[H \rightarrow H + \lambda \left(\sum_{n=0}^{N-1} S_n^z - S_{target}\right)^2\]

If the offset \(\epsilon \neq 0\), the Hamiltonian will be shifted by an amount

\[H \rightarrow H - \epsilon\]
Parameters
  • n (int) – System size.

  • h (float) – Disorder strength.

  • penalty (float) – Penalty strength (of Lagrangian multiplier).

  • s_target (int) – The targeting total Sz charge sector.

  • offset (float) – An overall constant to shift the spectrum.

  • trial_id (str) – ID of the current disorder trial.

  • seed (int) – Random seed used to initialize the pseudo-random number generator.

__init__(n, h, penalty=0, s_target=0, offset=0, trial_id=None, seed=None)[source]#

The Hamiltonian

\[H = \sum_{i=0}^{N-1} \mathbf{S}_i\cdot\mathbf{S}_{i+1} + h_i S_i^z\]

with \(h_{i} \in [-h, h)\) are sampled uniformly.

If the penalty strength \(\lambda \neq 0\), a penalty term will be taken into account

\[H \rightarrow H + \lambda \left(\sum_{n=0}^{N-1} S_n^z - S_{target}\right)^2\]

If the offset \(\epsilon \neq 0\), the Hamiltonian will be shifted by an amount

\[H \rightarrow H - \epsilon\]
Parameters
  • n (int) – System size.

  • h (float) – Disorder strength.

  • penalty (float) – Penalty strength (of Lagrangian multiplier).

  • s_target (int) – The targeting total Sz charge sector.

  • offset (float) – An overall constant to shift the spectrum.

  • trial_id (Optional[str]) – ID of the current disorder trial.

  • seed (Optional[int]) – Random seed used to initialize the pseudo-random number generator.

Methods

__init__(n, h[, penalty, s_target, offset, ...])

The Hamiltonian

Attributes

h

mpo

Return matrix product operator (mpo) as a property of the model.

n

offset

penalty

s_target

seed

trial_id

__init__(n, h, penalty=0, s_target=0, offset=0, trial_id=None, seed=None)[source]#

The Hamiltonian

\[H = \sum_{i=0}^{N-1} \mathbf{S}_i\cdot\mathbf{S}_{i+1} + h_i S_i^z\]

with \(h_{i} \in [-h, h)\) are sampled uniformly.

If the penalty strength \(\lambda \neq 0\), a penalty term will be taken into account

\[H \rightarrow H + \lambda \left(\sum_{n=0}^{N-1} S_n^z - S_{target}\right)^2\]

If the offset \(\epsilon \neq 0\), the Hamiltonian will be shifted by an amount

\[H \rightarrow H - \epsilon\]
Parameters
  • n (int) – System size.

  • h (float) – Disorder strength.

  • penalty (float) – Penalty strength (of Lagrangian multiplier).

  • s_target (int) – The targeting total Sz charge sector.

  • offset (float) – An overall constant to shift the spectrum.

  • trial_id (Optional[str]) – ID of the current disorder trial.

  • seed (Optional[int]) – Random seed used to initialize the pseudo-random number generator.

property h: float#
property penalty: float#
property s_target: int#
property offset: float#
property trial_id: str | None#
property seed: int | None#