For a description on how to use the most important functionality, please checkout the tutorials and the API documentation.
The following example code shows how to use most of the functionality of the tempo.file_formats
module. This code is suplementary to the documentation and also includes functionality that is only relevant to the inner workings of the TimeEvolvingMPO package. Sections that show example code that is not part of the API is marked with three asterix ***
.
Contents:
import sys
sys.path.insert(0,'..')
import numpy as np
import matplotlib.pyplot as plt
import time_evolving_mpo as tempo
# tempo.file_formats.assert_tempo_dynamics_file("../tests/data/test_v1_0_good_file_C.tempoDynamics")
tempo.file_formats.check_tempo_dynamics_file("../tests/data/test_v1_0_good_file_C.tempoDynamics")
True
# tempo.file_formats.assert_tempo_dynamics_file("../tests/data/test_v1_0_bad_file_A.tempoDynamics")
tempo.file_formats.check_tempo_dynamics_file("../tests/data/test_v1_0_bad_file_A.tempoDynamics")
False
tempo.file_formats.print_tempo_dynamics_file("../tests/data/test_v1_0_good_file_C.tempoDynamics")
Tempo Dynamics: version = 1.0 name = Ralph description = wonderful description_dict = dict: alpha : 0.3 omega : 4.0 times = steps:4, min:0.0, max:0.4 states = shape:(4, 5, 5)
# tempo.file_formats.assert_process_tensor_file("../tests/data/test_v1_0_good_file_C.processTensor")
tempo.file_formats.check_process_tensor_file("../tests/data/test_v1_0_good_file_C.processTensor")
True
# tempo.file_formats.assert_process_tensor_file("../tests/data/test_v1_0_bad_file_A.processTensor")
tempo.file_formats.check_process_tensor_file("../tests/data/test_v1_0_bad_file_A.processTensor")
False
tempo.file_formats.print_process_tensor_file("../tests/data/test_v1_0_good_file_D.processTensor")
Process Tensor: version = 1.0 name = Eve description = The initial state description_dict = dict: alpha : 0.3 epsilon : 3.3e-07
tempo.file_formats.print_process_tensor_file("/data/git/tempo_py/example.processTensor")
Process Tensor: version = 1.0 name = temp description = - description_dict = dict: