pytreenet.time_evolution.tdvp_algorithms package¶
This submodule provides all potentially abstract TDVP algorithms.
It should mostly be used to create new variations of the TDVP algorithms.
Submodules¶
pytreenet.time_evolution.tdvp_algorithms.firstorderonesite module¶
Implementation of the first order one site TDVP algorithm.
- class pytreenet.time_evolution.tdvp_algorithms.firstorderonesite.FirstOrderOneSiteTDVP(initial_state: TreeTensorNetworkState, hamiltonian: TreeTensorNetworkOperator, time_step_size: float, final_time: float, operators: TensorProduct | List[TensorProduct], config: TTNTimeEvolutionConfig | None = None)¶
Bases:
OneSiteTDVPThe first order one site TDVP algorithm.
- This means we have first order Trotter splitting for the time evolution:
exp(At+Bt) approx exp(At)*exp(Bt)
Has the same attributes as the TDVP-Algorithm class
- run_one_time_step()¶
Runs one time step of the first order one site TDVP algorithm.
This means we do one sweep through the tree, updating each site once.
pytreenet.time_evolution.tdvp_algorithms.onesitetdvp module¶
Implements the mother class for all one-site TDVP algorithms.
This class mostly contains functions to calculate the effective Hamiltonian and to update the link tensors.
- class pytreenet.time_evolution.tdvp_algorithms.onesitetdvp.OneSiteTDVP(initial_state: TreeTensorNetworkState, hamiltonian: TreeTensorNetworkOperator, time_step_size: float, final_time: float, operators: TensorProduct | List[TensorProduct], config: TTNTimeEvolutionConfig | None = None)¶
Bases:
TDVPAlgorithmThe mother class for all One-Site TDVP algorithms.
This class contains the functions to calculate the effective Hamiltonian and to update the link tensors.
Has the same attributes as the TDVP-Algorithm class, but must still be extended with a time step running method, defining the order of the Trotter decomposition.
- static create_link_id(node_id: str, next_node_id: str) str¶
Creates the identifier of a link node after a split happened.
pytreenet.time_evolution.tdvp_algorithms.secondorderonesite module¶
- class pytreenet.time_evolution.tdvp_algorithms.secondorderonesite.SecondOrderOneSiteTDVP(initial_state: TreeTensorNetworkState, hamiltonian: TreeTensorNetworkOperator, time_step_size: float, final_time: float, operators: TensorProduct | List[TensorProduct], config: TTNTimeEvolutionConfig | None = None)¶
Bases:
OneSiteTDVPThe first order one site TDVP algorithm.
- This means we have second order Trotter splitting for the time evolution:
exp(At+Bt) approx exp(At/2)*exp(Bt/2)*exp(Bt/2)*exp(At/2)
Has the same attributes as the TDVP-Algorithm clas with two additions.
- backwards_update_path¶
The update path that traverses backwards.
- Type:
List[str]
- backwards_orth_path¶
The orthogonalisation paths for the backwards run.
- Type:
List[List[str]]
- backward_sweep()¶
Perform the backward sweep through the state.
- forward_sweep()¶
Perform the forward sweep through the state.
- run_one_time_step()¶
Run a single second order time step.
This mean we run a full forward and a full backward sweep through the tree.
pytreenet.time_evolution.tdvp_algorithms.secondordertwosite module¶
Implements the class for the second order two-site TDVP algorithm.
- class pytreenet.time_evolution.tdvp_algorithms.secondordertwosite.SecondOrderTwoSiteTDVP(initial_state: TreeTensorNetworkState, hamiltonian: TreeTensorNetworkOperator, time_step_size: float, final_time: float, operators: TensorProduct | List[TensorProduct], truncation_parameters: SVDParameters, config: TTNTimeEvolutionConfig | None = None)¶
Bases:
TwoSiteTDVP- backwards_sweep()¶
Performs the full backwards sweep through the state.
- complete_two_site_forward_update(target_node_id: str, update_index: int)¶
Performs the forward evolution of both sites and the backwards evolution of the next node, while automatically determining the next node.
- Parameters:
target_node_id (str) – The identifier of the first site.
update_index (int) – The index of the update.
- complete_two_site_update(target_node_id: str, next_node_id: str)¶
Performs the forward evolution of both sites and the backwards evolution of the next node.
- Parameters:
target_node_id (str) – The identifier of the first site.
next_node_id (str) – The identifier of the second site.
- final_forward_update()¶
Perform the final forward update.
The final forward update is a special case, as it both last sites are updated at the same time.
- first_backwards_update()¶
Perform the first backwards update.
Here the first two sites are updated, but no backwards time evolution of the second node is performed.
- first_forward_update()¶
Perform the first forward update.
- forward_sweep()¶
Perform the full forward sweep through the state.
- normal_backwards_update(update_index: int)¶
Perform a normal backwards update.
This means, moving the orthogonality center to the correct site, evolving it backwards in time, and then updating both tensors forward in time.
- Parameters:
update_index (int) – The index of the update.
- normal_forward_update(node_id: str, update_index: int)¶
Perform a normal forward update.
- Parameters:
node_id (str) – The identifier of the first site.
next_node_id (str) – The identifier of the second site.
update_index (int) – The index of the update.
- run_one_time_step(**kwargs)¶
Run one time step of the secondo order two-site TDVP algorithm.
This means running a full forward sweep and a full backwards sweep.
pytreenet.time_evolution.tdvp_algorithms.tdvp_algorithm module¶
Implements the time-dependent variational principle (TDVP) for tree tensor networks.
- Reference:
- [1] D. Bauernfeind, M. Aichhorn; “Time Dependent Variational Principle for Tree
Tensor Networks”, DOI: 10.21468/SciPostPhys.8.2.024
- class pytreenet.time_evolution.tdvp_algorithms.tdvp_algorithm.TDVPAlgorithm(initial_state: TreeTensorNetworkState, hamiltonian: TreeTensorNetworkOperator, time_step_size: float, final_time: float, operators: TensorProduct | List[TensorProduct], config: TTNTimeEvolutionConfig | None = None)¶
Bases:
TTNTimeEvolutionThe general abstract class of a TDVP algorithm.
Subclasses the general time evolution for tree tensor networks.
- initial_state¶
The initial state of the system.
- Type:
- hamiltonian¶
The Hamiltonian under which to time-evolve the system.
- Type:
TTNO
- time_step_size¶
The size of one time-step.
- Type:
float
- final_time¶
The final time until which to run the evolution.
- Type:
float
- operators¶
Operators to be measured during the time-evolution.
- Type:
Union[TensorProduct, List[TensorProduct]]
- update_path¶
The order in which the nodes are updated.
- Type:
List[str]
- orthogonalisation_path¶
The path along which the TTNS has to be orthogonalised between each node update.
- Type:
List[List[str]]
- partial_tree_cache¶
A dictionary to hold already contracted subtrees of the TTNS.
- Type:
PartialTreeCacheDict
- update_tree_cache(node_id: str, next_node_id: str)¶
Updates a tree tensor for given node identifiers.
Updates the tree cache tensor that ends in the node with identifier node_id and has open legs pointing towards the neighbour node with identifier next_node_id.
- Parameters:
node_id (str) – The identifier of the node to which this cache corresponds.
next_node_id (str) – The identifier of the node to which the open legs of the tensor point.
pytreenet.time_evolution.tdvp_algorithms.twositetdvp module¶
Implements the mother class for all two-site TDVP algorithms.
This class mostly contains functions to contract the effective Hamiltonian and to update the sites in the two site scheme.
- class pytreenet.time_evolution.tdvp_algorithms.twositetdvp.TwoSiteTDVP(initial_state: TreeTensorNetworkState, hamiltonian: TreeTensorNetworkOperator, time_step_size: float, final_time: float, operators: TensorProduct | List[TensorProduct], svd_parameters: SVDParameters | None = None, config: TTNTimeEvolutionConfig | None = None)¶
Bases:
TDVPAlgorithmThe two site TDVP algorithm.
It contracts two sites and updates them at the same time before splitting them using an SVD with truncation.
- svd_parameters¶
Contains values for the SVD truncation.
- static create_two_site_id(node_id: str, next_node_id: str) str¶
Create the identifier of a two site node obtained from contracting the two note with the input identifiers.