pytreenet.ttns package

This submodule provides tree tensor network states (TTNS).

Submodules

pytreenet.ttns.ttns module

Provides a class representing tree tensor network states (TTNS)

pytreenet.ttns.ttns.TTNS

alias of TreeTensorNetworkState

class pytreenet.ttns.ttns.TreeTensorNetworkState

Bases: TreeTensorNetwork

A class representing a tree tensor network state (TTNS).

A TTNS is a TTN representing a quantum state. This means that every node has exactly one physical leg. That leg can be trivial, i.e. of dimension 1.

apply_operator(operator: TensorProduct)

Applies a tensor product operator to the TTNS.

Parameters:

operator (TensorProduct) – The operator to apply.

is_in_canonical_form(node_id: str | None = None) bool

Returns whether the TTNS is in canonical form.

If a node is specified, it will check as if that node is the orthogonalisation center. If no node is given, the current orthogonalisation center will be used.

Parameters:

node_id (Union[None,str], optional) – The node to check. If None, the current orthogonalisation center will be used. Defaults to None.

Returns:

Whether the TTNS is in canonical form.

Return type:

bool

operator_expectation_value(operator: TensorProduct | TreeTensorNetworkOperator) complex

Finds the expectation value of the operator specified, given this TTNS.

Parameters:

operator (Union[TensorProduct,TTNO]) – A TensorProduct representing the operator as many single site operators. Otherwise a a TTNO with the same structure as the TTNS.

Returns:

The resulting expectation value < TTNS | operator | TTNS>

Return type:

complex

scalar_product() complex

Computes the scalar product of this TTNS.

Returns:

The resulting scalar product <TTNS|TTNS>

Return type:

complex

single_site_operator_expectation_value(node_id: str, operator: ndarray) complex

The expectation value with regards to a single-site operator.

The single-site operator acts on the specified node.

Parameters:
  • node_id (str) – The identifier of the node, the operator is applied to.

  • operator (np.ndarray) – The operator of which we determine the expectation value. Note that the state will be contracted with axis/leg 1 of this operator.

Returns:

The resulting expectation value < TTNS| Operator| TTN >.

Return type:

complex