Fixes Lindblad evolution in propagation. Also, changed the batch propagation to make batches of time slices. This helps with large simulations to use less RAM while doing propagation.
Why
Previous propagation code was missing the lindblad evolution and used to return unitary matrices instead of superoperators.
Closes #215
How
Added a condition if model.lindbaldian is True then use tf_propagation_lind for calculating the superoperators for evolution.
Also changed signals[i * batch_size : i * batch_size + batch_size] to signals[:, i * batch_size : i * batch_size + batch_size] to make batches of time slices for propagation instead of batches of control lines.
Remarks
Changing the way batches are made means that one has to provide the batch size for the simulation by using exp.propagate_batch_size. The default is set to be the length of signal, so it creates only one batch.
Checklist
Please include and complete the following checklist. Your Pull Request is (in most cases) not ready for review until the following have been completed. You can create a draft PR while you are still completing the checklist. Check the Contribution Guidelines for more details. You can mark an item as complete with the - [x] prefix
[ ] Tests - Added unit tests for new code, regression tests for bugs and updated the integration tests if required
[x] Formatting & Linting - black and flake8 have been used to ensure styling guidelines are met
[x] Type Annotations - All new code has been type annotated in the function signatures using type hints
[ ] Docstrings - Docstrings have been provided for functions in the numpydoc style
[ ] Documentation - The tutorial style documentation has been updated to explain changes & new features
[ ] Notebooks - Example notebooks have been updated to incorporate changes and new features
[ ] Changelog - A short note on this PR has been added to the Upcoming Release section
What
Fixes Lindblad evolution in propagation. Also, changed the batch propagation to make batches of time slices. This helps with large simulations to use less RAM while doing propagation.
Why
Previous propagation code was missing the lindblad evolution and used to return unitary matrices instead of superoperators. Closes #215
How
Added a condition if
model.lindbaldian
isTrue
then usetf_propagation_lind
for calculating the superoperators for evolution. Also changedsignals[i * batch_size : i * batch_size + batch_size]
tosignals[:, i * batch_size : i * batch_size + batch_size]
to make batches of time slices for propagation instead of batches of control lines.Remarks
Changing the way batches are made means that one has to provide the batch size for the simulation by using
exp.propagate_batch_size
. The default is set to be the length of signal, so it creates only one batch.Checklist
Please include and complete the following checklist. Your Pull Request is (in most cases) not ready for review until the following have been completed. You can create a draft PR while you are still completing the checklist. Check the Contribution Guidelines for more details. You can mark an item as complete with the
- [x]
prefixblack
andflake8
have been used to ensure styling guidelines are metnumpydoc
style