TwoBodyTerm Class

Nearest-neighbor two-body Hamiltonian contributions and correlator measurements on lattice models.

class edlgt.modeling.twobody_term.TwoBodyTerm(axis, op_list, op_names_list, **kwargs)[source]

Bases: QMBTerm

Nearest-neighbor two-body term along a selected lattice axis.

Initialize a two-body term definition.

Parameters:
  • axis (str) – Lattice axis along which neighboring pairs are selected.

  • op_list (list) – Two local operators defining the two-body term.

  • op_names_list (list) – Human-readable names corresponding to op_list.

  • **kwargs – Additional keyword arguments forwarded to QMBTerm.

Return type:

None

get_hamiltonian(strength, add_dagger=False, mask=None)[source]

Build the two-body Hamiltonian contribution.

Parameters:
  • strength (scalar) – Coupling constant multiplying the two-body term.

  • add_dagger (bool, optional) – If True, add the Hermitian conjugate of the constructed term.

  • mask (numpy.ndarray, optional) – Boolean lattice mask selecting the sites where the term is applied.

Returns:

Return type depends on the current workflow:

  • if self.sector_configs is None: sparse matrix Hamiltonian term;

  • otherwise: (row_list, col_list, value_list) as three NumPy arrays in the symmetry-reduced basis.

Return type:

scipy.sparse.spmatrix or tuple

Raises:
  • TypeError – If strength is not scalar.

  • NotImplementedError – If add_dagger=True is requested in an unsupported momentum-basis pair mode.

get_Hamiltonian(strength, add_dagger=False, mask=None)

Build the two-body Hamiltonian contribution.

Parameters:
  • strength (scalar) – Coupling constant multiplying the two-body term.

  • add_dagger (bool, optional) – If True, add the Hermitian conjugate of the constructed term.

  • mask (numpy.ndarray, optional) – Boolean lattice mask selecting the sites where the term is applied.

Returns:

Return type depends on the current workflow:

  • if self.sector_configs is None: sparse matrix Hamiltonian term;

  • otherwise: (row_list, col_list, value_list) as three NumPy arrays in the symmetry-reduced basis.

Return type:

scipy.sparse.spmatrix or tuple

Raises:
  • TypeError – If strength is not scalar.

  • NotImplementedError – If add_dagger=True is requested in an unsupported momentum-basis pair mode.

get_expval(psi)[source]

Compute the two-point correlator matrix for the selected operator pair.

Parameters:

psi (QMB_state) – Quantum many-body state used for the measurement.

Returns:

The correlator matrix is stored in self.corr.

Return type:

None

Raises:

TypeError – If psi is not a QMB_state instance.

print_nearest_neighbors()[source]

Log nearest-neighbor correlator values along the configured axis.

Return type:

None