HW5 computer problem: modelling a dye molecule Objectives By the end of this lab you should: Know how to manipulate complex numbers and matrices. Prog

Similar documents
Lectures about Python, useful both for beginners and experts, can be found at (

Sample Problems on Quantum Dynamics for PHYS301

Physics 342 Lecture 17. Midterm I Recap. Lecture 17. Physics 342 Quantum Mechanics I

Lecture 6. Four postulates of quantum mechanics. The eigenvalue equation. Momentum and energy operators. Dirac delta function. Expectation values

NUMERICAL ANALYSIS WEEKLY OVERVIEW

2. As we shall see, we choose to write in terms of σ x because ( X ) 2 = σ 2 x.

Harmonic Oscillator I

Physics 137A Quantum Mechanics Fall 2012 Midterm II - Solutions

The Particle in a Box

Chem 3502/4502 Physical Chemistry II (Quantum Mechanics) 3 Credits Fall Semester 2006 Christopher J. Cramer. Lecture 5, January 27, 2006

C/CS/Phys 191 Quantum Gates and Universality 9/22/05 Fall 2005 Lecture 8. a b b d. w. Therefore, U preserves norms and angles (up to sign).

1 Fundamental physical postulates. C/CS/Phys C191 Quantum Mechanics in a Nutshell I 10/04/07 Fall 2007 Lecture 12

Lab 6: Linear Algebra

Eigenvalue and Eigenvector Homework

Write a simple 1D DFT code in Python

Quantum operator methods QM (quantum mouse) version p. 1

Physics 215 Quantum Mechanics 1 Assignment 1

05. Multiparticle Systems

04. Five Principles of Quantum Mechanics

Numerical Methods Lecture 2 Simultaneous Equations

2. Introduction to quantum mechanics

Numerical Methods Lecture 2 Simultaneous Equations

0.1 Schrödinger Equation in 2-dimensional system

Quantum operator methods QM (quantum mouse) version (ALR mods) p. 1

Lyapunov-based control of quantum systems

Designing Information Devices and Systems I Spring 2017 Babak Ayazifar, Vladimir Stojanovic Homework 4

Summary of Last Time Barrier Potential/Tunneling Case I: E<V 0 Describes alpha-decay (Details are in the lecture note; go over it yourself!!) Case II:

MATLAB BASICS. Instructor: Prof. Shahrouk Ahmadi. TA: Kartik Bulusu

1 Notes and Directions on Dirac Notation

Lecture 9: Eigenvalues and Eigenvectors in Classical Mechanics (See Section 3.12 in Boas)

QUANTUM CHEMISTRY PROJECT 2: THE FRANCK CONDON PRINCIPLE

1 Readings. 2 Unitary Operators. C/CS/Phys C191 Unitaries and Quantum Gates 9/22/09 Fall 2009 Lecture 8

Lecture 6 Quantum Mechanical Systems and Measurements

PHYS 7411 Spring 2015 Computational Physics Homework 4

Assignment 2: Conformation Searching (50 points)

C/CS/Phys C191 Quantum Mechanics in a Nutshell 10/06/07 Fall 2009 Lecture 12

Lecture 4: Postulates of quantum mechanics

Under evolution for a small time δt the area A(t) = q p evolves into an area

4.3 Lecture 18: Quantum Mechanics

General Exam Part II, Fall 1998 Quantum Mechanics Solutions

Numerical solution of the time-independent 1-D Schrödinger equation. Matthias E. Möbius. September 24, 2010

Quantum Mechanics C (130C) Winter 2014 Final exam

Quantum Mechanics I Physics 5701

Quantum Physics 2: Homework #6

Linear Algebra in Hilbert Space

Statistical Interpretation

Lab 5: Calculating an equilibrium constant

Chem 3502/4502 Physical Chemistry II (Quantum Mechanics) 3 Credits Spring Semester 2006 Christopher J. Cramer. Lecture 20, March 8, 2006

3.024 Electrical, Optical, and Magnetic Properties of Materials Spring 2012 Recitation 1. Office Hours: MWF 9am-10am or by appointment

A short and personal introduction to the formalism of Quantum Mechanics

1. Quantum Mechanics, Cohen Tannoudji, Chapters Linear Algebra, Schaum Series 3. Quantum Chemistry Ch. 6

Problems and Multiple Choice Questions

NANOSCALE SCIENCE & TECHNOLOGY

dt r r r V(x,t) = F(x,t)dx

Math 331 Homework Assignment Chapter 7 Page 1 of 9

ECE 501b Homework #4 Due: 10/22/2012

Python & Numpy A tutorial

Quantum Mechanics Solutions. λ i λ j v j v j v i v i.

Project: Vibration of Diatomic Molecules

Summary of free theory: one particle state: vacuum state is annihilated by all a s: then, one particle state has normalization:

We start with some important background material in classical and quantum mechanics.

3.024 Electrical, Optical, and Magnetic Properties of Materials Spring 2012 Recitation 3 Notes

4 A Measurement is a Projection or a dot product (or inner product)!!

A Glimpse at Scipy FOSSEE. June Abstract This document shows a glimpse of the features of Scipy that will be explored during this course.

PHYS 7411 Spring 2015 Computational Physics Homework 3

Page 684. Lecture 40: Coordinate Transformations: Time Transformations Date Revised: 2009/02/02 Date Given: 2009/02/02

Quantum Mechanics crash course (For the scholar with an higher education in mathematics) Fabio Grazioso :48

8.04: Quantum Mechanics Professor Allan Adams Massachusetts Institute of Technology Tuesday March 19. Problem Set 6. Due Wednesday April 3 at 10.

1. For the case of the harmonic oscillator, the potential energy is quadratic and hence the total Hamiltonian looks like: d 2 H = h2

1-D Convection-Diffusion Lab

Topic 2: The mathematical formalism and the standard way of thin

Postulates of Quantum Mechanics

If electrons moved in simple orbits, p and x could be determined, but this violates the Heisenberg Uncertainty Principle.

Time-Independent Perturbation Theory

09a. Collapse. Recall: There are two ways a quantum state can change: 1. In absence of measurement, states change via Schrödinger dynamics:

On the convergence of a feedback control strategy for multilevel quantum systems

Lecture 11 Spin, orbital, and total angular momentum Mechanics. 1 Very brief background. 2 General properties of angular momentum operators

Lecture 4: Equations of motion and canonical quantization Read Sakurai Chapter 1.6 and 1.7

Physics 411: Homework 3

Read through A Graphing Checklist for Physics Graduate Students before submitting any plots in this module. See the course website for the link.

PLEASE LET ME KNOW IF YOU FIND TYPOS (send to

1 Mathematical preliminaries

Examples of common quantum mechanical procedures and calculations carried out in Mathcad.

2.0 Basic Elements of a Quantum Information Processor. 2.1 Classical information processing The carrier of information

Second quantization: where quantization and particles come from?

Homework assignment 3: due Thursday, 10/26/2017

Math 307 Learning Goals. March 23, 2010

C/CS/Phys 191 Quantum Mechanics in a Nutshell I 10/04/05 Fall 2005 Lecture 11

Lecture 10: The Schrödinger Equation. Lecture 10, p 2

Physics 342 Lecture 27. Spin. Lecture 27. Physics 342 Quantum Mechanics I

E = φ 1 A The dynamics of a particle with mass m and charge q is determined by the Hamiltonian

Quantum Mechanics: Postulates

Lecture 10: The Schrödinger Equation. Lecture 10, p 2

Lecture 5b: Starting Matlab

The Hamiltonian and the Schrödinger equation Consider time evolution from t to t + ɛ. As before, we expand in powers of ɛ; we have. H(t) + O(ɛ 2 ).

(a) [15] Use perturbation theory to compute the eigenvalues and eigenvectors of H. Compute all terms up to fourth-order in Ω. The bare eigenstates are

E = hν light = hc λ = ( J s)( m/s) m = ev J = ev

Image Registration Lecture 2: Vectors and Matrices

The Schrodinger Equation and Postulates Common operators in QM: Potential Energy. Often depends on position operator: Kinetic Energy 1-D case:

MP463 QUANTUM MECHANICS

Transcription:

HW5 computer problem: modelling a dye molecule Objectives By the end of this lab you should: Know how to manipulate complex numbers and matrices. Programming environment: Spyder. To implement this, do the following: Go to the start menu icon and click it. Select All Programs Select Anaconda 64-bit Select Spyder (or whatever else you like, but this is what is on the computer in HA317) Background: The a dye magenta has two molecular states as shown in the figure below, taken from Feynmann Lectures in Physics, Vol. 3, p. 10-12. In quantum physics, states can be represented as matrices, as shown. Molecular state Representation 1 0 0 1 Suppose the molecule is initially in state : 1 ψ initial = 0 Suppose the Hamiltonian matrix (which determines how the molecular states change with time) is: 1 1 H = 1 1 It has eigenvectors we will designate: v 1 v 2 and eigenvalues: E 1 E 2. The postulates of quantum physics state that the wavefunction at any time t for this system is: ψ(t) = * * ( v1 ψinitalexp( je1t) ) v1 + ( v 2 ψ inital exp( je 2 t) ) v 2..(1) * Note that ( v1 ψ inital exp( je 1 t) ) v 1 means: the dot product of the complex conjugate of v and 1 ψ times the exponential function inital of je 1 t. This will be a complex scalar, which then multiplies v 1. Here j = -1 and has been set to one for simplicity. The postulates further say that if you observe the system at time t, the probability of the wavefunction collapsing into the final state ψ is: final P = ψ.(2) * 2 final ψ(t) We will determine the probability that collapsing the wavefunction after time t gives the same state as the intial state: ψ final = ψ initial Part1: creating normalized wavefunctions If it has been a while since you worked with Python, a quick refresher on complex numbers is here. In quantum physics, states are vectors of complex numbers that are normalized to have unit length. You will write a function definition that: Normalizes a vector x using x x * x Some commands you may need: 1

from numpy import dot, conjugate from numpy.linalg import eigh from cmath import exp,sqrt def Normalize(x): your code here return dot allows matrix multiplication and the dot product. conjugate takes the complex conjugate of a vector. The command eigh determines eigenvectors and eigen values for NxN arrays that are Hermitian. cmath is package that has functions that can take complex numbers as arguments. This is a function you will write to normalize the vector. It takes a vector x and passes back the normalized vector. Write the normalization routine and 1 check it with the vector x =. The j function definition should compute 1 1 x = 2 j def Psi(valH,vectH,PsiInitial,t): your code return your code valh[0] 1j H=? vecth[:,0] This will calculate ψ (t) using Eq.(1). Eigenvalue with index 0 Eigenvector corresponding to eigenvalue valh[0] This is how you indicate - 1. If you forget the 1 python will complain. Create a function Psi(valH,vectH,PsiInitial,t) that takes the eigenvector array vecth, the eigenvalue array valh, the normalized initial wavefunction PsiInitial, and the time t. This should calculate ψ (t) based on Eq.(1), and return its value. val,vect=eigh(h) PsiInitial=? abs(z) You figure out how to enter the H matrix. This does not change with time. This returns the eigenvalues and eigenvectors of H. You figure out how to specify it. This is how you calculate the modulus of a complex number z Part2: determining the probability as a function of time A quick refresher on eigenvectors and eigenvalues in Python is here. You will now calculate probability as a function of time. Here are some commands: 2

Create a loop that creates time values from times t=0. to 10. for N=100. Here are some other commands you may need. Calculate the probability from Eq.(2) for each time value. for t in arange(t0,tf,dt): PsiFinal=? x.append(t) This for loop changes the value of variable t from t0 to tf in steps of dt You figure this out. This calls the function you defined earlier and calculates state at each time t. Inside the for loop, this command builds an array called x by adding the new t value each iteration. Note: before the loop you will need to declare x=[ ] to create an empty array x. Plot the probability as a function of time. You should find a probability that oscillates in time, suggesting that the dye molecule swaps back and forth between states periodically. The frequency corresponds to the color of light that magenta absorbs. plot(x,y) show() Here x and y represent one dimensional arrays. These commands will generate a plot of y versus x o If you start in one eigenstate, make measurements of H, you never get the other eigenstate. Thus the probability of starting and ending in different eigenstates of H is zero. Change the code and check this. Discuss your checks in the comments of your code. What to turn in: Hardcopy of program with your homework in class. Submit the python programs in dropbox on D2L by 11:50am Wednesday. Make sure: o The filename is HW04YourName.py o You save a copy on a flash drive or email the program to yourself. o Inside your program, the top line is: #HW04 Your name o You place comments in your code indicating what you are doing. Checks: o If the initial state is an eigenvector of H, every H measurement will always give the same state. Thus the probability will always be 100%. Change the code and check this. 3

''' This program plots the probability amplitude of finding the system in state psi1>, the first energy eigenstate of the Hamiltonian, after a measurment at time t. This is for a 2x2 Hamiltonian ''' from numpy import array,zeros,dot,conjugate,arange from numpy.linalg import eigh from cmath import exp,sqrt from pylab import show, plot def Normalize(x): CSquared=dot(conjugate(x),x) return x/sqrt(csquared) #This calculates psi(t)> at any time #by adding all the eigenstates of H #and their corresponding exponentials of time def Psi(valH,vectH,NormPsi,t): psi=exp(-1.j*valh[0]*t)*dot(conjugate(vecth[:,0]),normpsi)*vecth[:,0]+\ exp(-1.j*valh[1]*t)*dot(conjugate(vecth[:,1]),normpsi)*vecth[:,1] return psi #This is the psi(t)> t0=0. tf=10. N=100 dt=(tf-t0)/n #This is the Hamiltonian H=array([[1,1],[1,1]],complex) #This calculates the eigenvalues and vectors valh,vecth=eigh(h) #This normalizes the initial state PsiInitial=array([1,0],complex) #This is the initial state PsiFinal=array([1,0],complex) #This is the final state PsiInitial=Normalize(PsiInitial) PsiFinal=Normalize(PsiFinal) #This will be the time array. Start it empty. x=[] #This will be the probability array. Start it empty. y=[] for t in arange(t0,tf,dt): PsiOfT=Psi(valH,vectH,PsiInitial,t) probability=abs(dot(conjugate(psifinal),psioft))**2 x.append(t) y.append(probability) plot(x,y) #This plots probability versus time show()