25.07.2013 Views

Ph.D. Thesis - Physics

Ph.D. Thesis - Physics

Ph.D. Thesis - Physics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A.2 Simulation with a linear force gradient in space<br />

The following is a function that computes the average J value, as well as the simulation<br />

error for a given gradient of F.<br />

% File: ising_small_rs_fn.m<br />

% Author: Rob Clark<br />

% Simulates Ising model with and without micromotion,<br />

% beginning with a random two-qubit state.<br />

% A linear gradient in space is used.<br />

% This is a function that returns the average J value when the ion undergoes<br />

% micromotion and also the error, calculated as the deviation from the<br />

% micromotion-free simulation.<br />

% Basis generated by {spin space of ion 1} \otimes {spin space of ion 2}<br />

% STAGE 1: simple calculation, ising, no vibration<br />

function [Jm,err_result] = isrf(J0,Jav,A,grad)<br />

% J = -10000;<br />

% B = -J;<br />

% J = 1.0306e3;<br />

J = Jav;<br />

B = -J;<br />

% A = .1;<br />

Omega = 1.0e6;<br />

t = 0:1/(2*Omega):10/J;<br />

sx = [0 1; 1 0];<br />

sz = [1 0; 0 -1];<br />

sztot1 = kron(eye([2 2]),sz) + kron(sz,eye([2 2]));<br />

H1 = J*kron(sz,sz) + B*(kron(eye([2 2]), sx) + kron(sx,eye([2 2])));<br />

% Randomize initial state<br />

amps = [rand(1),rand(1),rand(1),rand(1)] + i*[rand(1),rand(1),rand(1),rand(1)];<br />

init1 = amps/norm(amps); init1 = init1’;<br />

expsz1 = [init1’*sztot1*init1];<br />

for k = 2:length(t)<br />

curr = expm(-i*H1*t(k))*init1;<br />

expsz1 = [expsz1 curr’*sztot1*curr];<br />

end<br />

expsz2 = [init1’*sztot1*init1];<br />

tstep=t(2)-t(1);<br />

curr = init1;<br />

232

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!