question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Floquet mesolve not working as expected

See original GitHub issue

Hi,

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.

image png 1200 x 1200 pixels - redimensionnee 79

But output.states[-1] is far from being a coherent state.

image png 1200 x 1200 pixels

I tried to debug it, without real success for now 😕

EDIT: Might be partially related to #624.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Phykscommented, Dec 15, 2017

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 😃

0reactions
jakelishmancommented, Mar 29, 2021

See #1248 that implements the correct A. I’m not certain about the comment about c_ops - I’ll need to look into it more before we merge #1248.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found