Cavity QED and spin-boson simulations
This tutorial builds a spin-boson simulation from nothing: a spin coupled to an electromagnetic cavity mode, then the same cavity made lossy and given a temperature, and finally a pulse sequence run through the device context. The reference material is the bosonic modes section of the spin system specification and the device.m page; the shipped examples live in the examples/quantum_tech folder of the Spinach distribution.
Declaring a cavity mode
Spinach would refuse to run in script mode, so the calculation starts with a function declaration:
function cavity_tutorial()
Bosonic modes are declared in sys.isotopes alongside spins. The label carries the number of Fock states to keep: 'C5' is a cavity mode truncated at five population levels. Here it is accompanied by an electron in a 0.33 Tesla magnet:
% Magnet field
sys.magnet=0.33;
% An electron and a five-level cavity mode
sys.isotopes={'E','C5'};
The number of levels is a convergence parameter. Five is generous for a calculation that never puts more than one photon into the cavity, and far too few for a coherent state of amplitude three; the safe procedure is to repeat the calculation with more levels and watch the answer stop moving.
The mode frequency goes into inter.modes.frqs, in Hz, with an empty cell for every particle that is not a mode. Making the cavity resonant with the electron Larmor frequency is the standard starting point:
% Cavity resonant with the electron Larmor frequency
inter.modes.frqs={[] -sys.magnet*spin('E')/(2*pi)};
The coupling between the spin and the mode is an exchange coupling, declared in the upper triangle of a cell array with one row and column per particle:
% Jaynes-Cummings coupling of 2.828 MHz
inter.modes.exchange=cell(2,2);
inter.modes.exchange{1,2}=2.828e6;
Formalism and basis set
A two-particle system of this size is comfortable in complete Hilbert space:
% Basis set
bas.formalism='zeeman-hilb';
bas.approximation='none';
% Spinach housekeeping
spin_system=create(sys,inter);
spin_system=basis(spin_system,bas);
At this point Spinach prints three console tables that are worth reading: mode parameters, mode couplings by channel, and, when they are present, the modulation blocks. If a number is not where it was intended to be, it will be visible there.
Choosing a frame
Spin-boson systems accept three assumption sets. The 'cavity' set places spins and modes in a common rotating frame and applies the rotating wave approximation, which is what cavity QED usually means:
% Rotating frame Hamiltonian
spin_system=assume(spin_system,'cavity');
H_JC=hamiltonian(spin_system);
In this frame the mode energy becomes a detuning from the carrier, and the exchange coupling keeps only its flip-flop part. The 'labframe' set retains everything, including the counter-rotating terms, and is the reference against which the approximation should be checked. The 'spin-phonon' set keeps the spins in their usual rotating frames and the modes in the laboratory frame; it is the one to use when longitudinal or modulation couplings are present, because those average to zero in the cavity frame and are refused there.
The avoided crossing
The physics of the Jaynes-Cummings model is visible in the one-excitation manifold: the spin excitation and the photon are degenerate at zero detuning, and the coupling splits them. Sweeping the spin detuning and diagonalising that manifold produces the familiar hyperbolae:
% Electron detuning operator
Ez=operator(spin_system,{'Lz'},{1});
% Locate the one-excitation manifold
spin_exc=state(spin_system,{'ZL2','BL1'},{1,2});
cav_exc=state(spin_system,{'ZL1','BL2'},{1,2});
one_quant=speye(size(H_JC,1));
one_quant=one_quant(:,[find(diag(spin_exc)>0.5)...
find(diag(cav_exc)>0.5)]);
% Detuning range and eigenvalue array
delta=2*pi*linspace(-15e6,15e6,100);
eig_array=zeros(2,100);
% Loop over detunings
for n=1:numel(delta)
H=delta(n)*Ez+H_JC; H=(H+H')/2;
eig_array(:,n)=eig(full(one_quant'*H*one_quant));
end
% Plot the one-photon case
kfigure(); plot(1e-6*delta/(2*pi),1e-6*eig_array/(2*pi));
axis tight; kxlabel('detuning, MHz');
kylabel('energy levels, MHz'); kgrid;
Bosonic states use their own labels: 'BL#' is the projector onto the #-th Fock level, counted from 1, so 'BL1' is the vacuum and 'BL2' is the one-photon state. Spin energy levels use the parallel 'ZL#' notation. The minimum splitting at zero detuning is twice the declared coupling.
A lossy cavity at finite temperature
Real resonators leak. Damping is declared with the mode, as a lifetime, a linewidth, or a quality factor, and a temperature must be supplied because the thermal occupation of the mode bath is part of the physics:
% Microwave resonator with five Fock levels
sys.magnet=0; sys.isotopes={'C5'};
inter.modes.frqs={6.02e9};
inter.modes.lifetimes={10e-9};
inter.modes.t2_times={9.9e-9};
inter.temperature=0.050;
% Dissipation needs Liouville space
bas.formalism='zeeman-liouv';
bas.approximation='none';
Dissipators cannot be represented in Hilbert space, so a Liouville space formalism is mandatory here; Spinach warns and omits the mode dissipation if this is forgotten. The evolution generator is assembled in the usual way:
% Dissipative evolution generator
H=hamiltonian(assume(spin_system,'labframe'));
R=relaxation(spin_system);
G=-1i*H+R;
A Fock state and a coherent state make instructive initial conditions: the Fock state cascades down the ladder, and the coherent state decays with its Poisson structure largely intact. Both settle into the thermal state of the mode.
% Fock state and coherent state
rho_fock=state(spin_system,'BL5',1);
rho_coh=coherent(spin_system,1,1.5);
coherent.m reports the norm that the Fock space truncation removed from the Poisson tail. If that number is not small, the mode needs more levels - this is the truncation convergence check in its most convenient form.
Running a pulse sequence: the device context
Spin-boson systems are devices rather than molecules in magnets: the spin subsystem has an orientation, the cavity does not. They are therefore run through device.m rather than liquid.m or powder.m. The example below is a spin coupled longitudinally to a phonon mode, which produces both spin coherence modulation and a spin-conditioned displacement of the oscillator:
% An electron and a seven-level phonon mode
sys.magnet=0; sys.isotopes={'E','V7'};
inter.modes.frqs={[] 20e6};
% Longitudinal coupling: row 1 carries the spin
% projection, column 2 carries the quadrature
inter.modes.longitudinal=cell(2,2);
inter.modes.longitudinal{1,2}=4e6*sqrt(2);
% Sequence parameters
parameters.sweep=5e8; parameters.npoints=501;
parameters.rho0=state(spin_system,{'Lx','BL1'},{1,2});
% Trajectory through the device context
traj=device(spin_system,@traject,parameters,'spin-phonon');
The context builds the Hamiltonian at the requested orientation of the spin subsystem, adds relaxation and kinetics, applies transmitter offsets to the spin channels and parameters.mode_offset detunings to the modes, and hands the generators to the sequence. Drives on a mode are not a context matter: the sequence builds them from the creation and annihilation operators of the mode it drives.
Exercises
- Repeat the avoided crossing calculation with 'labframe' instead of 'cavity' and compare the splitting. How large does the coupling have to become before the counter-rotating terms matter?
- Increase the Fock truncation of the resonator from five levels to ten and watch the coherent state decay again. At which amplitude does the truncation start to distort the answer?
- Replace the electron in the first calculation with a proton, adjust the cavity frequency accordingly, and confirm that the vacuum Rabi oscillation still transfers the excitation completely.
- Declare a transmon instead of a cavity mode, obtain its frequency and anharmonicity from Josephson and charging energies with ejec2duffing.m, and look at the anharmonic ladder.
- Add a dispersive coupling between a spin and a cavity and watch the cavity frequency shift with the spin state - the mechanism behind circuit QED readout.
See also
Spin system specification, Relaxation theory parameters, Basis set specification, device.m, coherent.m, rlx_modes.m, assume.m, create.m, Kernel contexts
Version 2.12, authors: Ilya Kuprov