"""
Fortran module input_reader:
File_ID: UIR
Reading input for aTTN algorithm
\par Purpose:
Ther purpose of the model is reading user input under the condition
that it is type independent with regard to the tensor. Single precisions,
double precisions, and double complex can be handled here. Thus, the
original description applies as possible under this restriction and
certain types have been moved to the input processing module, which
allows any type specific classes.
Thus, the new parameterized models are defined via integer indices,
where the list of operators is defined separately. Hopefully, this
choice leads to a better modularization, where new code can be built
with the current type without propagatig the tensor class dependency.
Previous support for 2D systems has been removed, these terms are
easier to support via the python side, especially once we start
modifying parameters.
01/03/2018 13:04:53 - Timo Felser: Created
August 2021 - Daniel Jaschke: remove type dependencies, error handling
**Authors**
* \par REVISION HISTORY:
"""
[docs]
class string():
"""
No documentation extracted.
"""
[docs]
class task():
"""
No documentation extracted.
**Class variables**
tn_type = 1 : integer
tree : 1, aTTN : 2
tensor_backend = 1 : integer
AbelianSymTensor : 1, Tensor : 2
version_input_processor = 1 : integer
version input processor (original : 1, generic features : 2,
parameterized model : 3). Only 3 supported at this stage
time_evolution_mode = 1 : integer
time evolution mode: 1 : tdvp onesite,
2 : tdvp expansion (two site)
oqs_mode = 0 : integer
open quantum system mode: 0 : closed system,
1 : quantum trajectories
2 : quantum trajectories (norm only)
seed : integer, dimension(4)
Seed the random number generator.
mpo_mode = -1 : integer
Setting for the iTPO (and MPO selection more generally)
-1: auto-select
0: TPO, 1: iTPO, 2: iTPO w/ update,
3: iTPO w/ compression (restrictions apply)
10: sparse MPO (restrictions apply)
magic_number = 0 : integer
For debugging and development. Using prime numbers to encode
special settings during debugging or development, i.e., when
it is necessary to pass a parameters from python to fortran
which does not exist.
Should not be used in production code.
log_file : character(len=:), allocatable
Control the log file: path to logfile
log_unit = 6 : integer
unit for log file
has_log_file = .false. : logical
flag if logfile
store_checkpoints = .true. : logical
Flag to control if checkpoints are stored (can avoid hard-disk
limitations)
"""
[docs]
class checkpoints():
"""
No documentation extracted.
**Class variables**
do_load : logical
Flag if a previous checkpoint can be loaded.
do_store : logical
Flag if checkpoints should be stored (copy of input parameters).
do_create_file : logical
Flag if the file indicating the existing of a checkpoing
still has to be created.
output_folder : character(len=512)
String containing the output folder.
last : character(len=512)
String to the last checkpoint which has to be deleted
upon creating a new checkpoint. An empty string signals
no previous checkpoints.
"""
[docs]
class plocal_type():
"""
No documentation extracted.
**Class variables**
site_ind : integer
Apply term to this site (-1 equals to all sites)
operator_id : integer
reference to the operator via integer id
parameter_id : integer
reference to parameter via integer
prefactor : double precision
weight / pre-factor
"""
[docs]
def plocal_d_next(self):
"""
fortran-subroutine - August 2021 (dj)
Method to iterate over the local terms. Returns next_idx=-1 if
no term is left.
**Arguments**
this : class(plocal_type), intent(in)
iterate over this instance
next_idx : integer, intent(inout)
index of the next term. Set to 1 for first
call, exit loop when index is set to -1. Increment is done
within this subroutine
ll : integer, intent(in)
system size of the 1d system
next_site : integer, intent(out)
index of the site
next_op : integer, intent(out)
integer id of the operator
next_param : integer, intent(out)
integer id of the parameter
next_weight : double precision, intent(out)
corresponding weight
error : class(error_type), allocatable, intent(out), optional
Instance for error tracking.
"""
return
[docs]
def plocal_read(self):
"""
fortran-subroutine - August 2021 (dj)
Read plocal term from an open unit.
"""
return
[docs]
def plocal_s_next(self):
"""
fortran-subroutine - October 2022 (dj)
Method to iterate over the local terms. Returns next_idx=-1 if
no term is left. Version with `next_weight` as single precision.
**Details**
See d_plocal_next
"""
return
[docs]
class pinteraction_type():
"""
No documentation extracted.
**Class variables**
num_terms : integer
number of terms in order to combine terms with equal number of
operators
num_operators : integer
number of operators (not number of sites spanned by the terms)
site_inds : integer, dimension(:, :), allocatable
Site indices for the operators. Array will have size of
num_operators x num_terms
operator_ids : integer, dimension(:, :), allocatable
reference to the operators via integers (the list with operators
will be passed seperately). The array has a size of
num_operators x num_terms
parameter_ids : integer, dimension(:), allocatable
reference to parameters via integers (organized seperately).
The array size is num_terms
prefactors : double precision, dimension(:), allocatable
weight factors / pre-factors of size num_terms
"""
[docs]
def pinteraction_d_next(self):
"""
fortran-subroutine - August 2021 (dj)
Method to iterate over the interaction terms. Returns next_idx=-1 if
no term is left.
**Arguments**
this : class(pinteraction_type), intent(in)
iterate over this instance
next_idx : integer, intent(inout)
index of the next term. Set to 1 for
first call, exit loop when index is set to -1. Increment
is done within this subroutine
ll : integer, intent(in)
system size of the 1d system
next_sites : integer, dimension(:), allocatable, intent(out)
index of the site
next_ops : integer, dimension(:), allocatable, intent(out)
integer id of the operator
next_param : integer, intent(out)
integer id of the parameter
next_weight : double precision, intent(out)
corresponding weight
error : class(error_type), allocatable, intent(out), optional
Instance for error tracking.
"""
return
[docs]
def pinteraction_read(self):
"""
fortran-subroutine - August 2021 (dj)
Read pinteraction term from an open unit.
**Arguments**
this : class(pinteraction_type), intent(inout)
fill this instance of a local term
unit : integer, intent(in)
open io-unit to read from.
error : class(error_type), allocatable, intent(out), optional
instance for error tracking
"""
return
[docs]
def pinteraction_s_next(self):
"""
fortran-subroutine - October 2022 (dj)
Method to iterate over the interaction terms. Returns next_idx=-1 if
no term is left. Version with `next_weight` as single precision.
**Details**
See d_pinteraction_next
"""
return
[docs]
class pmodel_type():
"""
No documentation extracted.
**Class variables**
params_file : character(:), allocatable
file containing the parameterization
spmodel_file : character(:), allocatable
file containing the filename of the sparse MPO file
num_local : integer
number of local terms
local : type(plocal_type), dimension(:), allocatable
the local terms as a list.
num_inter : integer
number of interaction terms
inter : type(pinteraction_type), dimension(:), allocatable
the interaction terms as a list.
num_local_lindblad : integer
number of local Lindblads
local_lindblad : type(plocal_type), dimension(:), allocatable
the Lindblads as a list.
"""
[docs]
def pmodel_read(self):
"""
fortran-subroutine - August 2021 (dj)
Read a parameterized model from file.
**Arguments**
this : class(pmodel_type), intent(out)
fill this model with data
filename : character(len=*), intent(in)
input file with the model.
error : class(error_type), allocatable, intent(out), optional
instance for error tracking.
"""
return
[docs]
class parameterization_type():
"""
No documentation extracted.
**Class variables**
is_real : logical
Flag if entries are real-valued
number_parameters : integer
Number of parameters
number_datapoints : integer
Number of data points
params : double precision, dimension(:, :), allocatable
Parameters chaning over the time / during the algorithm
params_c : complex(kind=ZT_ELEM_KIND), dimension(:, :), allocatable
Parameters chaning over the time / during the algorithm (complex)
dts : double precision, dimension(:), allocatable
dts allocated as time-step size dt for number_datapoints > 1
"""
[docs]
def parameterization_read(self):
"""
fortran-subroutine - Reading the parameterization_type.
"""
return
[docs]
class pobs_local_type():
"""
No documentation extracted.
**Class variables**
num_terms : integer
number of terms
operator_id : integer, dimension(:), allocatable
reference to the operator via integer id
res : double precision, dimension(:, :), allocatable
result array
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
python_class_name = "TNObsLocal" : character(len=10)
name of the corresponding python class
"""
[docs]
def pobs_local_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_local_is_active(self):
"""
fortran-function - August 2021 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_local_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_local_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_local_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_local_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_local_write_hdf5(self):
"""
fortran-subroutine - Write the correlation observable to a hdf5 file.
**Arguments**
this : class(pobs_local_type), intent(in)
this : write measurement for this class instance to a file.
file_id : integer(hid_t), intent(inout)
file_id : id of the open hdf5 file
error : integer
error : instance for error handling
**Details**
The observables are in a group TNObsCorr (corresponds to
the python class name). Each observable is a group with datasets
re and imag for the real and imaginary part.
"""
return
[docs]
class pobs_corr_type():
"""
No documentation extracted.
**Class variables**
num_terms : integer
number of correlation measurements
operator_id : integer, dimension(:, :), allocatable
reference to the opterators via integer ids
is_complex : logical, dimension(:), allocatable
flag if correlation can be complex (non-hermitian correlations)
rc_ind : integer, dimension(:), allocatable
index in the real or complex array
res_r : double precision, dimension(:, :, :), allocatable
result array (selected based on flag,
real correlations like sx sx)
res_c : complex(kind=ZT_ELEM_KIND), dimension(:, :, :), allocatable
result array (selected based on flag, complex correlations
like b bdagger, contains both real and complex part)
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
python_class_name = "TNObsCorr" : character(len=10)
name of the corresponding python class
"""
[docs]
def pobs_corr_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_corr_is_active(self):
"""
fortran-function - August 2021 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_corr_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_corr_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_corr_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_corr_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_corr_write_hdf5(self):
"""
fortran-subroutine - Write the correlation observable to a hdf5 file.
The observables are in a group TNObsCorr (corresponds to the python class name).
Each observable is a group with datasets re and imag for the real and imaginary part.
**Arguments**
this : class(pobs_corr_type), intent(in)
this : write measurement for this class instance to a file.
file_id : integer(hid_t), intent(inout)
file_id : id of the open hdf5 file
error : integer
error : instance for error handling
"""
return
[docs]
class pobs_custom_corr_type():
"""
No documentation extracted.
**Class variables**
num_terms : integer
number of correlation measurements
term_size : integer, dimension(:), allocatable
number of sites in term for every measurement
num_sites_measured : integer, dimension(:), allocatable
number of terms (on specific sites) to measure for every
measurement
operator_id : integer, dimension(:, :, :), allocatable
reference to the operators via integer ids
the order of axes is: [which subterm, which site in
subterm, which measurement term]
site_indices : integer, dimension(:, :, :), allocatable
site indices for every measurement
the order of axes is: [which subterm, which site
in subterm, which measurement term]
is_complex : logical, dimension(:), allocatable
flag if correlation can be complex (non-hermitian correlations)
rc_ind : integer, dimension(:), allocatable
index in the real or complex array
res_c : complex(kind=ZT_ELEM_KIND), dimension(:, :), allocatable
result array (selected based on flag)
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_custom_corr_finalize(self):
"""
fortran-subroutine - November 2023 (nr)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_custom_corr_is_active(self):
"""
fortran-function - November 2023 (nr)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_custom_corr_read(self):
"""
fortran-subroutine - November 2023 (nr)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
"""
return
[docs]
def pobs_custom_corr_write(self):
"""
fortran-subroutine - November 2023 (nr)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_custom_corr_type), intent(in)
Write measurement for this class instance to a file
unit : integer, intent(in)
File unit to write to
error : class(error_type), allocatable, intent(out), optional
Instance for error handling
"""
return
[docs]
class pobs_corr4_type():
"""
No documentation extracted.
"""
[docs]
def pobs_corr4_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_corr4_is_active(self):
"""
fortran-function - August 2021 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_corr4_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_corr4_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_corr4_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_corr4_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_t0corr_type():
"""
No documentation extracted.
**Class variables**
num_terms : integer
number of correlation measurements
operator_id : integer, dimension(:, :), allocatable
reference to the opterators via integer ids
is_complex : logical, dimension(:), allocatable
flag if correlation can be complex (non-hermitian correlations)
rc_ind : integer, dimension(:), allocatable
index in the real or complex array
site_idx : integer, dimension(:), allocatable
one can only measure one site for t=0
norms : double precision, dimension(:), allocatable
storing the norm sqrt(<psi(t=0)|A Adagger|psi(t=0)>)
res_c : complex(kind=ZT_ELEM_KIND), dimension(:, :), allocatable
result array (selected based on flag)
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_t0corr_finalize(self):
"""
fortran-subroutine - September 2022 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_t0corr_is_active(self):
"""
fortran-function - September 2022 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_t0corr_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_t0corr_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_t0corr_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_t0corr_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_tpo_type():
"""
No documentation extracted.
**Class variables**
mpo_obs : type(pmodel_type)
definition of the model
params : type(parameterization_type)
parameterization (do we need that?)
res : complex(kind=ZT_ELEM_KIND)
result (store always complex for simplicity)
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_tpo_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_tpo_is_active(self):
"""
fortran-function - August 2021 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_tpo_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_tpo_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_tpo_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_tpo_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_bond_type():
"""
No documentation extracted.
**Class variables**
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_bond_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_bond_is_active(self):
"""
fortran-function - August 2021 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_bond_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_bond_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_bond_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_bond_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_rho1_type():
"""
No documentation extracted.
**Class variables**
active : logical
flag if single-site reduced density matrices are measured
measure_all : logical
flag if all are measured or if they are specified via indices
meas_idx : integer, dimension(:), allocatable
measure only the following, dimension(# sites)
is_complex : logical
flag for data type (depending on statics, dynamics etc.)
res_r : double precision, dimension(:, :, :), allocatable
results (never as symmetric tensor)
res_c : complex(kind=ZT_ELEM_KIND), dimension(:, :, :), allocatable
results (never as symmetric tensor)
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_rho1_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_rho1_is_active(self):
"""
fortran-function - August 2021 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_rho1_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_rho1_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_rho1_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_rho1_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_rho2_type():
"""
No documentation extracted.
**Class variables**
active : logical
flag if single-site reduced density matrices are measured
measure_all : logical
flag if all are measured or if they are specified via indices
meas_idx : integer, dimension(:, :), allocatable
measure only the following, dimension(# pairs, 2)
is_complex : logical
flag for data type (depending on statics, dynamics etc.)
res_r : double precision, dimension(:, :, :), allocatable
results (never as symmetric tensor)
res_c : complex(kind=ZT_ELEM_KIND), dimension(:, :, :), allocatable
results (never as symmetric tensor)
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_rho2_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_rho2_is_active(self):
"""
fortran-function - August 2021 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_rho2_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_rho2_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_rho2_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_rho2_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_distance2pure_type():
"""
No documentation extracted.
**Class variables**
num_terms : integer
number of overlaps to be measured
filenames : character(len=256), dimension(:), allocatable
store the filename
res : complex(kind=ZT_ELEM_KIND), dimension(:), allocatable
result of overlap (store always as complex for simplicity)
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_distance2pure_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_distance2pure_is_active(self):
"""
fortran-function - August 2021 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_distance2pure_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_distance2pure_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_distance2pure_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_distance2pure_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_psifile_type():
"""
No documentation extracted.
**Class variables**
num_terms : integer
number of files to write
formatting : character, dimension(:), allocatable
formatting via character flag
psifile : character(len=256), dimension(:), allocatable
base filename for storage (statics might append number of
sweep etc, dynamics might append total time etc.)
psifile_final : character(len=300), dimension(:), allocatable
actual filename during storage
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_psifile_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_psifile_is_active(self):
"""
fortran-function - August 2021 (dj)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_psifile_read(self):
"""
fortran-subroutine - August 2021 (dj)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_psifile_type), intent(out)
read information for this class instance.
ll : integer, intent(in)
number of sites in the system
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_psifile_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_psifile_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_tensor_product_type():
"""
No documentation extracted.
**Class variables**
num_terms : integer
number of terms
operator_id : type(int_arr_type), dimension(:), allocatable
reference to the operator via integer id
site1 : type(int_arr_type), dimension(:), allocatable
Sites where the operators are applied
site2 : type(int_arr_type), dimension(:), allocatable
Sites where the operators are applied
res : complex(kind=ZT_ELEM_KIND), dimension(:), allocatable
result array
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_tensor_product_finalize(self):
"""
fortran-subroutine - April 2022 (mb)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_tensor_product_is_active(self):
"""
fortran-function - April 2022 (mb)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_tensor_product_read(self):
"""
fortran-subroutine - April 2022 (mb)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_tensor_product_type), intent(out)
read information for this class instance.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_tensor_product_write(self):
"""
fortran-subroutine - April 2022 (mb)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_tensor_product_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_weighted_sum_type():
"""
No documentation extracted.
**Class variables**
num_terms : integer
number of terms
coefficients : type(dcmplx_arr_type), dimension(:), allocatable
reference to the operator via integer id
terms : type(pobs_tensor_product_type), dimension(:), allocatable
Array of tensor product operators for each term
res : complex(kind=ZT_ELEM_KIND), dimension(:), allocatable
result array
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_weighted_sum_finalize(self):
"""
fortran-subroutine - April 2022 (mb)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_weighted_sum_is_active(self):
"""
fortran-function - April 2022 (mb)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_weighted_sum_read(self):
"""
fortran-subroutine - April 2022 (mb)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
this : read information for this class instance.
unit : open file unit to read from
error : instance for error handling
"""
return
[docs]
def pobs_weighted_sum_write(self):
"""
fortran-subroutine - April 2022 (mb)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_weighted_sum_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_projective_type():
"""
No documentation extracted.
**Class variables**
num_shots : integer
number of terms
res : integer, dimension(:), allocatable
result array
res_string : type(str_arr_type)
Result as string representation
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_projective_finalize(self):
"""
fortran-subroutine - April 2022 (mb)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_projective_is_active(self):
"""
fortran-function - April 2022 (mb)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_projective_read(self):
"""
fortran-subroutine - April 2022 (mb)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_projective_type), intent(out)
read information for this class instance.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_projective_write(self):
"""
fortran-subroutine - April 2022 (mb)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
this : write measurement for this class instance to a file.
unit : open file unit to read from
error : instance for error handling
"""
return
[docs]
class pobs_probabilities_type():
"""
No documentation extracted.
**Class variables**
prob_type : character(len=1)
method to measure the probability
prob_param : double precision
parameter for the probability measure
res1 : double precision, dimension(:), allocatable
result array
res2 : double precision, dimension(:), allocatable
result array
res_string : type(str_arr_type)
Result as string
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_probabilities_finalize(self):
"""
fortran-subroutine - April 2022 (mb)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_probabilities_is_active(self):
"""
fortran-function - April 2022 (mb)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_probabilities_read(self):
"""
fortran-subroutine - April 2022 (mb)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_probabilities_type), intent(out)
read information for this class instance.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_probabilities_write(self):
"""
fortran-subroutine - April 2022 (mb)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_probabilities_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobs_bond_entropy_type():
"""
No documentation extracted.
**Class variables**
active : integer
number of terms
idxs : integer, dimension(:, :), allocatable
indices between which the bondentropy is computed
res : double precision, dimension(:), allocatable
result array
is_measured = .false. : logical
.true. if the backend can measure the observable.
Default to .false.
"""
[docs]
def pobs_bond_entropy_finalize(self):
"""
fortran-subroutine - April 2022 (mb)
Deallocate all memory and reset other variable if necessary.
"""
return
[docs]
def pobs_bond_entropy_is_active(self):
"""
fortran-function - April 2022 (mb)
Returns if any measurement of this observable type are requested.
"""
return
[docs]
def pobs_bond_entropy_read(self):
"""
fortran-subroutine - April 2022 (mb)
Reads the observable information from file. There is a one-to-one
mapping from the python function.
**Arguments**
this : class(pobs_bond_entropy_type), intent(out)
read information for this class instance.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
def pobs_bond_entropy_write(self):
"""
fortran-subroutine - April 2022 (mb)
Write the observable to a file; it is a formatted file. There
is a one-to-one mapping to a python function reading the
results.
**Arguments**
this : class(pobs_bond_entropy_type), intent(in)
write measurement for this class instance to a file.
unit : integer, intent(in)
open file unit to read from
error : class(error_type), allocatable, intent(out), optional
instance for error handling
"""
return
[docs]
class pobservables_type():
"""
No documentation extracted.
**Class variables**
to_write_hdf5 : logical
whether to write output to hdf5
ll : integer
number of sites (allows to parse results without original setup)
energy : double precision
energy (if available)
norm : double precision
norm (if available)
time : double precision
time (if available)
local : type(pobs_local_type)
local observables
corr : type(pobs_corr_type)
two-point correlations
tpo : type(pobs_tpo_type)
MPO measurements via TPO
bond : type(pobs_bond_type)
Bond / schmidt / entanglement measures
rho1 : type(pobs_rho1_type)
reduced density matrix (single-site)
rho2 : type(pobs_rho2_type)
reduced density matrix (two-site)
distance2pure : type(pobs_distance2pure_type)
distance measures to pure states
psifile : type(pobs_psifile_type)
saving state to file
tensor_product : type(pobs_tensor_product_type)
Tensor product observables
weighted_sum : type(pobs_weighted_sum_type)
Weighted sum observables
projective : type(pobs_projective_type)
Final projective measurement
probabilities : type(pobs_probabilities_type)
Probabilities
bondentropy : type(pobs_bond_entropy_type)
Bond entropy
t0corr : type(pobs_t0corr_type)
Unequal time correlators
corr4 : type(pobs_corr4_type)
Four-body correlator
custom_corr : type(pobs_custom_corr_type)
Custom correlations
"""
[docs]
def pobservables_finalize(self):
"""
fortran-subroutine - August 2021 (dj)
Finalize class, mainly deallocating the type included here.
**Arguments**
this : class(pobservables_type), intent(inout)
instance of pobservables_type
error : class(error_type), allocatable, intent(out), optional
instance for error tracking.
"""
return
[docs]
def pobservables_read(self):
"""
fortran-subroutine - August 2021 (dj)
Read the parameterized observables from file.
**Arguments**
this : class(pobservables_type), intent(inout)
instance of pobservables_type, set on exit with
content in the observable file.
filename : character(len=*), intent(in)
path to the file containing the observable
ll : integer, intent(in)
system size / number of sites
error : class(error_type), allocatable, intent(out), optional
Instance for error tracking.
"""
return
[docs]
def pobservables_write(self):
"""
fortran-subroutine - August 2021 (dj)
Write the parameterized observables to a formatted file.
**Arguments**
this : class(pobservables_type), intent(inout)
write measurement content in each observable type
filename : character(len=*), intent(in)
path to the file to be opened. It assumes a new file for now.
error : class(error_type), allocatable, intent(out), optional
Instance for error tracking.
"""
return
[docs]
def task_delete():
"""
fortran-subroutine - Deallocate all from a task instance.
"""
return
[docs]
def task_read():
"""
fortran-subroutine - June 2021 (dj)
Reading task type via fortran namelist.
"""
return
[docs]
def read_model_v3():
"""
fortran-subroutine - August 2021 (dj)
Read the model including parameters. This subroutine reads the
model according to the third generation of input files.
**Arguments**
filename : character(len=*), intent(in)
path to the input file of the model
input_folder : character(len=*), intent(in)
name of the input folder, where the
parameterization file is stored.
pmodels : type(pmodel_type), intent(out)
instance of pmodel_type, will be filled with
the model on exit.
params : type(parameterization_type), intent(out)
instance of parameterization_type, will be filled
with the parameterization on exit.
error : class(error_type), allocatable, intent(out), optional
Instance for error tracking.
"""
return
[docs]
def parameterization_d_get_parameters_statics():
"""
fortran-subroutine - August 2021 (dj)
Get the parameters for a static simulation where parameters do not
change. The 0-th entry of the parameters is accessed.
"""
return
[docs]
def parameterization_s_get_parameters_statics():
"""
fortran-subroutine - August 2021 (dj)
Get the parameters for a static simulation where parameters do not
change. The 0-th entry of the parameters is accessed.
"""
return
[docs]
def parameterization_c_get_parameters_statics():
"""
fortran-subroutine - August 2021 (dj)
Get the parameters for a static simulation where parameters do not
change. The 0-th entry of the parameters is accessed. Complex coupling
version.
"""
return
[docs]
def parameterization_z_get_parameters_statics():
"""
fortran-subroutine - August 2021 (dj)
Get the parameters for a static simulation where parameters do not
change. The 0-th entry of the parameters is accessed. Complex coupling
version.
"""
return
[docs]
def parameterization_d_get_parameters_and_dt():
"""
fortran-subroutine - August 2021 (dj)
Get the parameters for a dynamical simulation where parameters
are accessed via an index and the time step size is stored for
convenience.
"""
return
[docs]
def parameterization_s_get_parameters_and_dt():
"""
fortran-subroutine - August 2021 (dj)
Get the parameters for a dynamical simulation where parameters
are accessed via an index and the time step size is stored for
convenience.
"""
return
[docs]
def parameterization_c_get_parameters_and_dt():
"""
fortran-subroutine - August 2021 (dj)
Get the parameters for a dynamical simulation where parameters
are accessed via an index and the time step size is stored for
convenience.
"""
return
[docs]
def parameterization_z_get_parameters_and_dt():
"""
fortran-subroutine - August 2021 (dj)
Get the parameters for a dynamical simulation where parameters
are accessed via an index and the time step size is stored for
convenience.
"""
return
[docs]
def read_symmetries():
"""
fortran-function - Read the symmetry setup from file.
"""
return