Floquet mesolve not working as expected
See original GitHub issueHi,
It seems there are some errors in the Floquet mesolve
-equivalent function, which are not seen when considering a simple qubit.
Consider for instance an harmonic oscillator with a drive, which should converge towards a coherent state:
%matplotlib notebook
import numpy as np
from qutip import (basis, destroy, expect, fsesolve, sigmax, sigmaz, rand_ket, num,
mesolve)
from qutip.floquet import (floquet_modes, floquet_modes_table,
floquet_modes_t_lookup, fmmesolve)
# Parameters
wc = 1.0 * 2 * np.pi
wp = 1.5 * 2 * np.pi
T = 2 * np.pi / wp
N = 20
epsilon_p = np.sqrt(2) * np.sqrt(8) * (wp - wc)
psi0 = basis(N,0)
a = destroy(N)
H = [
wc * a.dag() * a,
[1.0j * epsilon_p * (a.dag() - a), 'cos(wp * t)']
]
args = {
'wp': wp
}
# noise power spectrum
gamma1 = 0.05
def noise_spectrum(omega):
return 0.5 * gamma1 * omega / (2 * np.pi)
tlist = np.linspace(0, 5 / gamma1, 100)
# find the floquet modes for the time-dependent hamiltonian
f_modes_0, f_energies = floquet_modes(H, T, args)
# precalculate mode table
f_modes_table_t = floquet_modes_table(f_modes_0, f_energies,
np.linspace(0, T, 500 + 1),
H, T, args)
# solve the floquet-markov master equation
output = fmmesolve(H, psi0, tlist,
[a], [], [noise_spectrum], T, args)
# For reference: calculate the same thing with mesolve
output_ref = mesolve(H, psi0, tlist, [np.sqrt(gamma1) * a],
[], args)
output_ref.states[-1]
is a coherent state as expected.
But output.states[-1]
is far from being a coherent state.
I tried to debug it, without real success for now 😕
EDIT: Might be partially related to #624.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Floquet Formalism — QuTiP 4.7 Documentation
Many time-dependent problems of interest are periodic. ... The Floquet-Markov Master equation is one such a formalism, with important applications for ...
Read more >Floquet Formalism — QuTiP 3.1.0 Documentation
Here we give an overview of how the Floquet and Floquet-Markov formalisms can be used for solving time-dependent problems in QuTiP. To introduce ......
Read more >Solving Problems with Time-dependent Hamiltonians - QuTiP
There are, in general, three different ways to implement time-dependent problems in QuTiP: Function based: Hamiltonian / collapse operators expressed using ...
Read more >Solving Problems with Time-dependent Hamiltonians - QuTiP
With this format, the form of the Hamiltonian for both mesolve and mcsolve is: >>> H = [H0, [H1 ...
Read more >Functions — QuTiP 4.7 Documentation
For operators, the result's expect will be computed by qutip.expect when the ... This allows for using mesolve for solving master equations that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, I’ll try to keep my PR up to date with my latest checks.
For anyone who might be using qutip for Floquet simulations, would be cool to have some reviews on my PR 😃
See #1248 that implements the correct
A
. I’m not certain about the comment aboutc_ops
- I’ll need to look into it more before we merge #1248.