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

The function krotov.functionals.gate is broken for Density matrices #123

Open
adriankoehlerfu opened this issue Oct 22, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@adriankoehlerfu
Copy link

adriankoehlerfu commented Oct 22, 2024

  • Krotov version: 1.3.0
  • QuTiP version: 4.7.6
  • Python version: 3.12
  • Operating System: Windows

Description

The krotov.functionals.gate is supposed to find the unitary gate that maps input states onto "final" states:

|psi(t=T)> = U(t=T) |psi(0)> where the inputs of the function are typically N basis states (Hilbert space dimension = N) and then N final states.

The example code is here.. You can ignore everything but the last cell essentially.

  1. The found gate using krotov.functionals.gate for a Schrödinger equation evolution is unitary (see last cell, first output), which should be case for a evolution that stems from a purely hermitian Hamiltonian. The function for kets in this case works.
  2. If one does not use a Schrödinger equation evolution but employs a Liouvillian master equation without dissipation, the results are the same. This is proven by the trace distance (see output third to last cell) for every time step that is effectively zero. Intuitively the time evolution using both methods is equivalent as long as there is no dissipation. However, the resulting gate that is being calculated from the basis |00><00|,|01><01|,... is all of a sudden non-unitary (see last cell, third output). This does not make sense.
  3. An even stronger example to show that something must be wrong is that taking the dyadic product of the initial and final kets from (1.) also results in a non-unitary gate (see last cell, second output).

Even if there is a bug in (2.), which is nearly impossible since the trace distance is zero, there is no way that in (3.) the same gate can become non-unitary by going into Liouville space. The check_unitary routine might be broken (it isnt) but even then you dont get the identity matrix, clearly showing non-unitary behavior.

@adriankoehlerfu adriankoehlerfu added the bug Something isn't working label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant