25.07.2013 Views

Ph.D. Thesis - Physics

Ph.D. Thesis - Physics

Ph.D. Thesis - Physics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix A<br />

Matlab code for Ising model<br />

simulations<br />

This appendix contains the Matlab code for simulating the Ising model for two ions including<br />

the effects of micromotion.<br />

A.1 Simulation with constant force in space and time<br />

% File: ising_small_randomstate.m<br />

% Author: Rob Clark<br />

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

% random two-qubit state.<br />

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

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

clear;<br />

close all;<br />

J = 1.0306e3;<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 />

229

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

Saved successfully!

Ooh no, something went wrong!