File:One dimensional quantum random walk.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this PNG preview of this SVG file: 576 × 432 pixels. Other resolutions: 320 × 240 pixels | 640 × 480 pixels | 1,024 × 768 pixels | 1,280 × 960 pixels | 2,560 × 1,920 pixels.
Original file (SVG file, nominally 576 × 432 pixels, file size: 29 KB)
File information
Structured data
Captions
Summary[edit]
DescriptionOne dimensional quantum random walk.svg |
English: Probability distribution resulting from one dimensional discrete time random walks. The quantum walk created using the Hadamard coin is plotted (orange) vs a classical walk (blue) after 50 time steps. The average is marked with a vertical line in the same color. Starting conditions were (1*|↑⟩+0*|↓⟩)*|0⟩. |
Date | |
Source | File:One_dimensional_quantum_random_walk.png |
Author | shoyer |
- Code, python3.7:
import numpy as np import math import matplotlib.pyplot as plt import time import colorsys import cmath size=1000 def run_classical_randwalk(itersteps,initsim_mat): simmat=initsim_mat for iterstep in range(itersteps): newsimmat=np.zeros((2*size+1,2), dtype=complex) for matindex in range(2*size+1): to_right=0.5*simmat[matindex][0] to_left=0.5*simmat[matindex][0] if(matindex-1>=0): newsimmat[matindex-1][0]+=to_left if(matindex+1<=2*size): newsimmat[matindex+1][0]+=to_right simmat=newsimmat psisquared=np.zeros(2*size+1) for matindex in range(2*size+1): psisquared[matindex]+=abs(newsimmat[matindex][0]) average_x=0 min_x=0 max_x=0 datastartflag=0 for matindex in range(2*size+1): if(datastartflag==0): min_x=matindex if(psisquared[matindex]>0): datastartflag=1 max_x=matindex average_x+=psisquared[matindex]*(matindex-(size+1)) print(f"validdatarange {max_x-min_x}") return(range(min_x-(size+1),max_x-size,2),psisquared[min_x:max_x+1:2],average_x) def run_quantum_randwalk(itersteps,initsim_mat): simmat=initsim_mat for iterstep in range(itersteps): newsimmat=np.zeros((2*size+1,2), dtype=complex) for matindex in range(2*size+1): hadamard_spinup=1/math.sqrt(2)*(simmat[matindex][0]+simmat[matindex][1]) hadamard_spindown=1/math.sqrt(2)*(simmat[matindex][0]-simmat[matindex][1]) if(matindex-1>=0): newsimmat[matindex-1][1]+=hadamard_spindown if(matindex+1<=2*size): newsimmat[matindex+1][0]+=hadamard_spinup simmat=newsimmat psisquared=np.zeros(2*size+1) for matindex in range(2*size+1): psisquared[matindex]+=abs(newsimmat[matindex][0])**2+abs(newsimmat[matindex][1])**2 average_x=0 min_x=0 max_x=0 datastartflag=0 for matindex in range(2*size+1): if(datastartflag==0): min_x=matindex if(psisquared[matindex]>0): datastartflag=1 max_x=matindex average_x+=psisquared[matindex]*(matindex-(size+1)) print(f"validdatarange {max_x-min_x}") return(range(min_x-(size+1),max_x-size,2),psisquared[min_x:max_x+1:2],average_x) simmat=np.zeros((2*size+1,2), dtype=complex) #(-size, ....,-1,0,1, size) #first index spin up, second index spin down simmat[size+1][0]=1.0 simmat[size+1][1]=0.0#1.0#1.0j fig=plt.figure() plt.xlabel("position") plt.ylabel("probability of occurence") q_list_return_50=run_quantum_randwalk(50,simmat) c_list_return_50=run_classical_randwalk(50,simmat) plt.plot(q_list_return_50[0],q_list_return_50[1],color="#e67300") plt.plot(c_list_return_50[0],c_list_return_50[1],color="#0000a0") xlim=plt.gca().get_xlim() ylim=plt.gca().get_ylim() plt.vlines(q_list_return_50[2],*ylim,color="#e67300",alpha=.7) plt.vlines(c_list_return_50[2],*ylim,color="#0000a0",alpha=.7) print(fig.axes) plt.gca().spines['top'].set_visible(False) plt.gca().spines['right'].set_visible(False) plt.gca().grid(color='grey', linestyle='-', linewidth=0.25, alpha=0.5) plt.show() fig.savefig("One_dimensional_quantum_random_walk.svg")
Licensing[edit]
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 18:23, 12 September 2020 | 576 × 432 (29 KB) | Benjamin Renz (talk | contribs) | Uploaded a work by shoyer from https://commons.wikimedia.org/wiki/File:One_dimensional_quantum_random_walk.png with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on ca.wikipedia.org
- Usage on de.wikipedia.org
- Usage on en.wikipedia.org
- Usage on pt.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 460.8pt |
---|---|
Height | 345.6pt |
Hidden category: