Skip to content
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

Migrate and fix Optimal control tutorials from qutip-notebooks to qutip-tutorials #122

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

rochisha0
Copy link
Contributor

@rochisha0 rochisha0 commented Jan 17, 2025

Migrate and update the Optimal Control tutorials from the qutip-notebooks repository to the qutip-tutorials repository. Ensure all tutorials are compatible with qutip-qtrl instead of the older qutip.control module. This involves revising code, validating outputs, and updating instructions to reflect changes functionality. It also removes the logging to make the tutorials more compact.

To do:

  1. Change the notebooks title

@ajgpitch
Copy link
Member

I checked the tutorials-v5/optimal-control/control-pulseoptim-Hadamard.ipynb and it imports qutip.control. This is not going work in v5. Needs to use qutip_qtrl.

@rochisha0
Copy link
Contributor Author

@ajgpitch I have fixed this and added overview. I think we should figure out, which order we want these notebooks to appear. I can name them in that particular order to show in the website index.

@ajgpitch
Copy link
Member

Definitely looking better now. Still focusing on the Hadamard example...

  1. I thought at some point we planned to move (copy) the Hadamard gate function into the main package. It would be nice not to have to depend on qutip_qip - can we check if this is done?
  2. It seems that this does not work with the current pip version of qutip-qtrl, do I need to install qutip_qtrl from Github?

@rochisha0
Copy link
Contributor Author

rochisha0 commented Jan 30, 2025

I have removed the dependence on qutip_qip. It works for me using the current pip version of qutip_qtrl. @ajgpitch
Software Version
QuTiP 5.1.0.dev0+0b4260e
Numpy 1.26.4
SciPy 1.13.0
matplotlib 3.9.0
Number of CPUs 8
BLAS Info Generic
IPython 8.25.0
Python 3.12.3 | packaged by Anaconda, Inc. | (main, May 6 2024, 19:46:43) [GCC 11.2.0]
OS posix [linux]
Cython 3.0.10
Wed Jan 01 22:48:30 2025 IST

These are the versions I am using.

@rochisha0
Copy link
Contributor Author

@ajgpitch I am not able to understand this error

E402 module level import not at top of file

Rest I think everything is fixed

@ajgpitch
Copy link
Member

ajgpitch commented Feb 6, 2025

Maybe it is the empty lines in cell 1 and also perhaps %matplotlib inline can be moved after the imports.

@ajgpitch
Copy link
Member

Suggest renames:

01-optimal-control-overview
02-cpo-GRAPE-Hadamard
03-cpo-GRAPE-QFT
04-cpo-GRAPE-Lindbladian
05-cpo-cpo-symplectic
06-CRAB-2qubit-state_to_state
07-CRAB-QFT

btw, it would be nice add state_to_state to the Hadamard example, perhaps first, showing transfer from |1> to |+> (or |0> to |+> , whichever one is the Hadamard, I can never remember), then show that Hadamard does the same.

@rochisha0
Copy link
Contributor Author

rochisha0 commented Feb 13, 2025

@ajgpitch I have updated the names. I am thinking for making changes to the content, I can open other PR to integrate this nice idea and maybe more.

@ajgpitch
Copy link
Member

Tests failing because links need updating in optimal-control-overview.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants