New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Measurement function fixes #182
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The wrappers provide a simple way to measure not only global functions but also methods of psi and the simulation class. Here, the fix of 2a5052a is not yet included, so the next commit is a cherry-pick merging only that.
…rameter This is necessary to avoid special-cases inside measurment functions for grouped sites, orthogonalExcitations and others. The model is guaranteed to be compatible with the state. This is a cherry-pick of a previous commit 2a5052a not yet merged in the main branch, but already existing other branches, in particular excitations_science and vumps.
E.g. tenpy.simulations.measurement.bond_dimension(...) is now tenpy.simulations.measurement.m_bond_dimension(...)
Further information can also be found in the new measurement user guide |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Again, this change is backwards incompatible, so I'm creating a pull request to make the change more visible and track it better.
The relevant incompatibility is in f580506 (cherry-picked from 2a5052a), namely that measurement functions need to accept models as additional arguments. This is necessary to ensure compatiblity of the
psi
to be measured with the model, e.g. when grouping sites.While you're changing those measurement functions, you might also want to follow the new TeNPy convention that they start with an
m_
, e.g. we renamedtenpy.simulations.measurement.bond_dimension
totenpy.simulations.measurement.m_bond_dimension
. For now, the old names still work in the config/yaml files, but they give a FutureWarning.You should update the config yaml files in projects where you want to update to a new TeNPy version:
connect_measurements
simulation parameter: all direct measurement functions (takingresults, psi, model, simulation
as arguments and saving toresults
) defined in TeNPy have been renamed to start withm_
.At this point, all those functions are defined in
tenpy.simulations.measurement.py
.psi_method
to measure e.g. correlation functions, you need to update the entry as follows:An old python entry for connect_measurements
can get replaced with new entry:
Similarly, an old yaml entry for connect_measurements
can get replaced with new yaml: