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

State transfer not working with GRAPE and CRAB, and with open systems #34

Open
pmenczel opened this issue Feb 7, 2025 · 3 comments · May be fixed by #36
Open

State transfer not working with GRAPE and CRAB, and with open systems #34

pmenczel opened this issue Feb 7, 2025 · 3 comments · May be fixed by #36

Comments

@pmenczel
Copy link
Member

pmenczel commented Feb 7, 2025

I am attaching a jupyter notebook containing state transfer examples where QOC does not optimize correctly. I can't attach ipynb files here, so you can find the notebook in jupytext markdown format and as pdf. I will briefly summarize the problems here:

  • Example 1 is a qubit with one control Hamiltonian. Using GOAT, the problem can be solved with great fidelity.
    Using GRAPE, the optimized fidelity is ~70k, and the optimized control pulse is just zero. By enabling logging in qtrl, we see that the evolution computed by qtrl involves states such as [[21772.86281624+0.j], [21766.27675364+0.j]]. I guess there is a bug in how qtrl is called from qoc.
    Using CRAB, the optimized fidelity is again ~70k. The optimized control pulse is not zero, but seems designed to be as bad as possible. I guess this is the same bug.
    Due to an unrelated bug in qtrl, it is not possible with CRAB to enable logging detailed enough to see the states in the internally computed evolution.

  • Example 2 is the same example, but with three control Hamiltonians. The results are mostly the same, except that GRAPE and CRAB now claim that they produce a reasonably good fidelity. The control protocols that they return, however, do not actually do anything useful.

  • Example 3 is again the same, except that the drift and control Hamiltonian are supplied as Liouvillians (since QOC should also be able to handle state transfer in open systems). Whether initial and target state are supplied as vectors or as density matrices, I have not been able to get even GOAT to do anything.

@pmenczel
Copy link
Member Author

Examples 1 and 2 with unitary dynamics can be fixed by passing the option "dyn_type": "UNIT" (thanks @nwlambert). This option should always automatically be passed to qtrl. I am attaching the fixed notebook.

qoc-state-transfer-issue-fix.md

@rochisha0
Copy link
Collaborator

Right now it's set to "GEN_MAT". I dont know if it will break other things if we set to "UNIT". @pmenczel

@nwlambert
Copy link
Member

@rochisha0 probably we need to add some checks and make sure the right option is chosen depending on the input (e.g., in addition i think example 3 above breaks because here

if any(qt.issuper(H_i) for H_i in (H if isinstance(H, list) else [H])):
it attempts to turn the target into a super if the Hamiltonian is a super, which fails if the target is a state). we need a bit of a matrix of checks here, to make sure the right options and qobj data types are used given the nature of H , target and initial.

@rochisha0 rochisha0 linked a pull request Feb 26, 2025 that will close this issue
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 a pull request may close this issue.

3 participants