7.1. tnpy.model.utils#

Functions

boundary_vectors(row, col)

The boundary vectors on two ends are usually just certain row and column in the Matrix Product Operator (MPO).

minors_if_no_penalty(row, col)

If the model definition comes with penalty term, but the user set the penalty strength to zero, that means there are a lots of unnecessary zeros presenting in the Matrix Product Operator (MPO).

tnpy.model.utils.boundary_vectors(row, col)[source]#

The boundary vectors on two ends are usually just certain row and column in the Matrix Product Operator (MPO). This decorator is used to specified which row and column are the boundary vectors.

Parameters
  • row (int) – By which row in MPO is the boundary vector on the left end.

  • col (int) – By which column in MPO is the boundary vector on the right end.

Return type

Callable

Returns:

tnpy.model.utils.minors_if_no_penalty(row, col)[source]#

If the model definition comes with penalty term, but the user set the penalty strength to zero, that means there are a lots of unnecessary zeros presenting in the Matrix Product Operator (MPO). This decorator can help to eliminate the zeros row and column, without touching the definition of penalty MPO.

Parameters
  • row (int) – By which row in MPO is the penalty term.

  • col (int) – By which column in MPO is the penalty term.

Return type

Callable

Returns: