tnpy.matrix_product_state.Environment
1.3. tnpy.matrix_product_state.Environment#
- class tnpy.matrix_product_state.Environment(mpo, mps)[source]#
Bases:
objectThe effective environment for
MatrixProductState-based algorithms.- Parameters
mpo (MatrixProductOperator) – Input
MatrixProductOperator.mps (MatrixProductState) – Input
MatrixProductState.
- __init__(mpo, mps)[source]#
The effective environment for
MatrixProductState-based algorithms.- Parameters
mpo (tnpy.operators.MatrixProductOperator) – Input
MatrixProductOperator.mps (tnpy.matrix_product_state.MatrixProductState) – Input
MatrixProductState.
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()orupdate_right()depending on the givendirection.update_left(site)Update the left environment at
site.update_mps(site, data)update_right(site)Update the right environment at
site.variance()Attributes
Get a dictionary where left environments are stored on the respective site.
Get a dictionary where right environments are stored on the respective site.
- __init__(mpo, mps)[source]#
The effective environment for
MatrixProductState-based algorithms.- Parameters
mpo (tnpy.operators.MatrixProductOperator) – Input
MatrixProductOperator.mps (tnpy.matrix_product_state.MatrixProductState) – Input
MatrixProductState.
- 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(site, direction)[source]#
Alias to
update_left()orupdate_right()depending on the givendirection.- Parameters
site (int) –
direction (tnpy.matrix_product_state.Direction) –
Returns:
- update_mps(site, data)[source]#
- Parameters
site (int) –
data (numpy.ndarray) –
- split_tensor(site, direction)[source]#
- Parameters
site (int) –
direction (tnpy.matrix_product_state.Direction) –
- one_site_full_matrix(site)[source]#
Construct the effective matrix for variational solver, with one site remained un-contracted.
- Parameters
site (int) –
- Return type
Returns: