Git Product home page Git Product logo

Comments (2)

petermao avatar petermao commented on September 24, 2024

Here is a figure and code that generates it. Something is wrong with the time_dependence implementation. I would expect the orange and green lines to be identical. (note: the legend for the orange line should be turn on at 11 us

image

(please excuse the unorthodox importation of numpy and matplot... too many years of matlab make me averse to the littering of code with np. and plt.!)

from numpy import *
from matplotlib.pyplot import *
import rydiqule as rq


## straight from Intro to Rydiqule section 3
def turn_on_field(t):
    if t < 1:
        return 0.0
    else:
        return 1.0

basis_size = 4
sensor_time = rq.Sensor(basis_size)

probe    = {"states":(0,1), "detuning": 2, "rabi_frequency": 3, "label":"probe"}
coupling = {"states":(1,2), "detuning": 2, "rabi_frequency": 5, "label": "coupling"}
rf       = {"states":(2,3), "detuning": 0, "rabi_frequency": 7, "label": "rf",
            "time_dependence":turn_on_field}

sensor_time.add_couplings(probe, coupling, rf)

gamma = np.zeros((basis_size, basis_size))
gamma[1:,0] = 0.1
sensor_time.set_gamma_matrix(gamma)

end_time = 10 #microseconds
num_pts = 100

solution_time = rq.solve_time(sensor_time, end_time, num_pts)
absorption_time = rq.get_rho_ij(solution_time.rho,0,1).imag


## variation 1: late turn on

def turn_on_field_late(t):
    if t < 11:
        return 0.0
    else:
        return 1.0

sensor_time1 = rq.Sensor(basis_size)

rf1 = {"states":(2,3), "detuning": 0, "rabi_frequency": 7, "label": "rf",
       "time_dependence":turn_on_field_late}

sensor_time1.add_couplings(probe, coupling, rf1)
sensor_time1.set_gamma_matrix(gamma)
solution_time1 = rq.solve_time(sensor_time1, end_time, num_pts)
absorption_time1 = rq.get_rho_ij(solution_time1.rho,0,1).imag

## variation 2: \Omega_{RF} = 0

sensor_time2 = rq.Sensor(basis_size)

rf2 = {"states":(2,3), "detuning": 0, "rabi_frequency": 0, "label": "rf",
       "time_dependence":turn_on_field}

sensor_time2.add_couplings(probe, coupling, rf2)
sensor_time2.set_gamma_matrix(gamma)
solution_time2 = rq.solve_time(sensor_time2, end_time, num_pts)
absorption_time2 = rq.get_rho_ij(solution_time2.rho,0,1).imag

## generate comparison figure

clf()
plot(solution_time.t, absorption_time , label='turn on at 1 µs')
plot(solution_time.t, absorption_time1, label='turn on at 11 µs')
plot(solution_time.t, absorption_time2, label='$\Omega_{RF} = 0$')
title ("Comparison of time dependent calcs")
xlabel("time [µs]")
ylabel("signal")
grid('on')
legend()
show()

from rydiqule.

petermao avatar petermao commented on September 24, 2024

This is an initial condition issue. I'm not sure that the default initial condition makes sense. I got concurrence on the figures after calculating a steady-state solution for the probe and coupler alone:

sensor_ss   = rq.Sensor(basis_size)
sensor_ss.add_couplings(probe, coupling)
sensor_ss.set_gamma_matrix(gamma)
solution_ss = rq.solve_steady_state(sensor_ss)

and then using solution_ss.rho as the initial condition for all computations.

Now the no-rf, 1 sec delay and 5 sec delay cases make sense:
image

from rydiqule.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.