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.

Time dependent hamiltonian in a rotating frame approximation

See original GitHub issue

I’ve got this code which uses a rotating frame approximation. I got it to work when the Hamiltonian was time independent, but now I’m trying to implement a time dependent Hamiltonian and nothing happens to the graph. I understand how to do this, but I’m not sure how it differs when using a rotating frame approximation.

h = 6.62607015e-34
b = 0.1786195317554453  #magnetic field
b_AC = 3.572390635108906e-05  #oscillating magnetic field
g = 2 #g-factor
u = 9.274E-24 #bohr magneton
w = g*u*b/h #omega 
w0 = 5e9  # omega0 is the rotating frame frequency

gamma_phi = 999000
gamma_minus = 1000

epsilon = g*u*b/h*(2*cmath.pi)
Delta = g*u*b_AC/h*(2*cmath.pi)

H0 = (w-w0)*epsilon/2 * sz #+ Delta/2*sy

def pulse(t0,t):
    return np.heaviside(t0,2e-9)

def H1_coeff(t,args):
    t0=args['t0']
    phi=args['phi']
    return Delta*pulse(t0,t)*np.sin((w-w0)*t+phi)

H = [H0,[sx,H1_coeff]]

times=np.linspace(0, 0.0001, 1000)

#our initial qubit state 
state0=(state_z_plus)/(np.sqrt(1))

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
atmalik123commented, Apr 3, 2021

Thank you for your feedback. I was able to get the results I wanted. Just to provide some closure, I’m sending a photo

Image from iOS

0reactions
BoxiLicommented, Mar 31, 2021

No, I’m using w-w0 just to show that the code works fine with my suggested changes in pulse(t0,t). It is just the numbers that are wrong.

First, please check the equation you are using again because (I guess) H0 should be (w-w0)/2 * sz and not the one you give in the code above. In your definition, w-w0 and epsilon is the same thing. The drive frequency (in sinus function) should match with H0.

Second, it not clear to me what you want to achieve with this. If the drive frequency matches the system frequency (both w-w0 here), H0 is exactly 0 in the rotating frame.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exact rotating wave approximation - ScienceDirect.com
From Eq. (2) it is clear that Heff has only a slow time dependence compared to the rotating-frame Hamiltonian, which, as noted above, ......
Read more >
Rotating-frame transformations - Light Group Web Page
Rotating-frame transformations: A new approximation for multiphoton absorption ... of the time-dependent Hamiltonian, N+P(t)+P′(t). It is.
Read more >
Problem in time dependent hamiltonian - Google Groups
Simulations are easier to do with time independent Hamiltonians. Are you familiar with this trick called Rotating Wave Approximation (RWA)?
Read more >
Canceling the remaining time-dependence in a "cyclic ...
Canceling the remaining time-dependence in a "cyclic" Hamiltonian for which rotating frame transformation (RFT) fails?
Read more >
Rotating-wave approximation - Wikipedia
The rotating-wave approximation is an approximation used in atom optics and magnetic resonance. In this approximation, terms in a Hamiltonian that oscillate ...
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