q-optimize / c3

Toolset for control, calibration and characterization of physical systems
https://c3-toolset.readthedocs.io/
Apache License 2.0
66 stars 36 forks source link

Fix lindbladian #219

Closed Ashutosh-Mishra2 closed 2 years ago

Ashutosh-Mishra2 commented 2 years ago

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 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

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.