1.3. tnpy.matrix_product_state.Environment#

class tnpy.matrix_product_state.Environment(mpo, mps)[source]#

Bases: object

The effective environment for MatrixProductState-based algorithms.

Parameters
__init__(mpo, mps)[source]#

The effective environment for MatrixProductState-based algorithms.

Parameters

Methods

__init__(mpo, mps)

The effective environment for MatrixProductState-based algorithms.

close()

Delete the underlying data of left and right environments.

one_site_full_matrix(site)

Construct the effective matrix for variational solver, with one site remained un-contracted.

one_site_matvec(site)

Construct the effective linear operator (matrix-vector product) for variational solver, with one site remained un-contracted.

split_tensor(site, direction)

update(site, direction)

Alias to update_left() or update_right() depending on the given direction.

update_left(site)

Update the left environment at site.

update_mps(site, data)

update_right(site)

Update the right environment at site.

variance()

Attributes

left

Get a dictionary where left environments are stored on the respective site.

mpo

mps

n_sites

right

Get a dictionary where right environments are stored on the respective site.

__init__(mpo, mps)[source]#

The effective environment for MatrixProductState-based algorithms.

Parameters
close()[source]#

Delete the underlying data of left and right environments.

Returns:

property mpo: tnpy.operators.MatrixProductOperator#
property mps: tnpy.matrix_product_state.MatrixProductState#
property n_sites: int#
property left: Dict[int, quimb.tensor.tensor_core.Tensor]#

Get a dictionary where left environments are stored on the respective site.

Returns:

property right: Dict[int, quimb.tensor.tensor_core.Tensor]#

Get a dictionary where right environments are stored on the respective site.

Returns:

update_left(site)[source]#

Update the left environment at site.

Parameters

site (int) –

Returns:

update_right(site)[source]#

Update the right environment at site.

Parameters

site (int) –

Returns:

update(site, direction)[source]#

Alias to update_left() or update_right() depending on the given direction.

Parameters

Returns:

update_mps(site, data)[source]#
Parameters
split_tensor(site, direction)[source]#
Parameters
variance()[source]#
Return type

float

one_site_full_matrix(site)[source]#

Construct the effective matrix for variational solver, with one site remained un-contracted.

Parameters

site (int) –

Return type

numpy.ndarray

Returns:

one_site_matvec(site)[source]#

Construct the effective linear operator (matrix-vector product) for variational solver, with one site remained un-contracted.

Parameters

site (int) –

Return type

scipy.sparse.linalg._interface.LinearOperator

Returns: