TruncationError
full name: tenpy.linalg.truncation.TruncationError
parent module:
tenpy.linalg.truncation
type: class
Inheritance Diagram
Methods
|
|
Return a copy of self. |
|
|
Construct TruncationError from discarded singular values. |
|
Load instance from a HDF5 file. |
|
Construct TruncationError from norm after and before the truncation. |
|
Export self into a HDF5 file. |
Class Attributes and Properties
Error |
- class tenpy.linalg.truncation.TruncationError(eps=0.0, ov=1.0)[source]
Bases:
Hdf5Exportable
Class representing a truncation error.
The default initialization represents “no truncation”.
Warning
For imaginary time evolution, this is not the error you are interested in!
- eps
The total sum of all discarded Schmidt values squared. Note that if you keep singular values up to 1.e-14 (= a bit more than machine precision for 64bit floats), eps is on the order of 1.e-28 (due to the square)!
- Type:
- ov
A lower bound for the overlap \(|\langle \psi_{trunc} | \psi_{correct} \rangle|^2\) (assuming normalization of both states). This is probably the quantity you are actually interested in. Takes into account the factor 2 explained in the section on Errors in the TEBD Wikipedia article <https://en.wikipedia.org/wiki/Time-evolving_block_decimation>.
- Type:
- classmethod from_norm(norm_new, norm_old=1.0)[source]
Construct TruncationError from norm after and before the truncation.
- classmethod from_S(S_discarded, norm_old=None)[source]
Construct TruncationError from discarded singular values.
- Parameters:
S_discarded (1D numpy array) – The singular values discarded.
norm_old (float) – Norm of all Schmidt values before truncation, \(\sqrt{\sum_{a} \lambda_a^2}\). Default (
None
) is 1.
- property ov_err
Error
1.-ov
of the overlap with the correct state.
- classmethod from_hdf5(hdf5_loader, h5gr, subpath)[source]
Load instance from a HDF5 file.
This method reconstructs a class instance from the data saved with
save_hdf5()
.- Parameters:
hdf5_loader (
Hdf5Loader
) – Instance of the loading engine.h5gr (
Group
) – HDF5 group which is represent the object to be constructed.subpath (str) – The name of h5gr with a
'/'
in the end.
- Returns:
obj – Newly generated class instance containing the required data.
- Return type:
cls
- save_hdf5(hdf5_saver, h5gr, subpath)[source]
Export self into a HDF5 file.
This method saves all the data it needs to reconstruct self with
from_hdf5()
.This implementation saves the content of
__dict__
withsave_dict_content()
, storing the format under the attribute'format'
.