2022년 10월 4일 화요일

양자역학, CHSH 부등식, Bell 부등식

고전 역학과 양자 역학중 어느 것이 옳은지를 확실히 구분할 수 있는 실험 방법으로 Bell 부등식 또는 CHSH 부등식 실험이 있다. 결론부터 말하면, 고전역학에 기반한 (realistic local  hidden variable theory) 어떠한 이론이건 부등식을 만족시켜야하지만, 양자역학의 경우에는 부등식을 만족시키지 않을 수 있다. 따라서, 어떤 실험을 통해 부등식이 만족되지 않는 경우를 관찰한다면, 고전 역학이 옳을 수 없다는 것이 증명된다. 

양자역학적으로 서로 entangle 되어 있는, 예를 들어 두 개의 전자가 total spin zero 인 상태 $|S=0>=1/sqrt(2)(|up,down>-|down,up>)$ 에서 두 입자를 서로 다른 방향으로 보내어 A와 B에서 관찰한다고 생각해보자. 이 때, 두 관찰의 시간 차이동안 빛의 속도로 정보를 보내도 영향을 미치지 못할 정도로 A와 B는 매우 멀리 떨어져 있다. 양자 역학적으로는 A와 B의 측정 결과는 아무리 멀리 떨어져 있더라도 서로 관련이 있어 한 입자의 측정 결과는 입자 자체의 성질이 아니고 다른 입자와 함께 떼어 놓고 생각할 수 없다. 반면, 고전 역학적으로는 A와 B의 측정 결과는 서로에게 영향을 미칠 수 없고, A에서 관측된 결과는 오직 그 입자가 원래 가지고 있던 성질에 의해 결정된다.  

좀 더 구체적으로, A에서 실험의 관측값이 오직 두가지만 가능한, A0와 A1 이라는 두가지 실험중 하나를 랜덤하게 한다고 하자. 입자에 대해 A0 실험을 하면 +1 이거나 -1 인 결과를 얻는다. 마찬가지로 A1 실험에 대해서도 +1 이거나 -1 인 결과를 얻는다. 
만약, 입자의 관측 결과가 입자 자체의 성질에 의한 것이라면, 입자는 
(1,1),(1,-1),(-1,1),(-1,-1) 의 4가지 성질을 가지고 있을 수 있다. 즉, 원래 입자가 (1,-1)이라는 성질을 가지고 있었다면 A0 실험을 할 경우 1 , A1 실험을 할 경우 -1 이라는 관찰을 하게 될 것이다. 따라서, A에서 입자가 가지는 성질을 (a0,a1) 이라고 나타낼 수 있다. 
이 때, 입자가 4가지 성질 중 어느 것을 가지더라도, a0+a1 이나 a0-a1 중 하나는 반드시 0이 되고, 다른 하나는 반드시 +/- 2 값을 가지게 된다.   
마찬가지로 B에 있는 입자의 성질도 (b0,b1)이라고 나타낼 수 있다. 

두 입자의 성질의 다음과 같은 조합을 생각해 보자.

S = b0(a0 +a1)+b1(a0-a1) = a0*b0 + a1*b0 + a0*b1 -a1*b1 

(a0+a1) 과 (a0-a1) 중 하나는 반드시 0 이 되고, 나머지 하나는 +/- 2가 되고, b0와 b1 은 +/-1의 값을 가지므로, S의 값은 +2 나 -2 가 될 수 밖에 없다. 
이것은 입자 한 쌍에 대한 결과이다. 실험을 반복하여 많은 수의 실험 결과에 대한 평균을 낸다고 하자.  
S의 평균 값을 <S >으로 나타내면, 
<S> = < A0*B0> + < A1*B0> +< A0*B1> - <A1*B1> 
으로 쓸 수 있다. 여기서, < A0*B0>는 A0와 B0의 실험을 했을 때의 평균값을 나타낸다.
예를 들어 두 입자가 A0와 B0 실험에 대해 a0,b0라는 성질을 가지고 있을 경우, 
A0*B0 의 값은 단순히 a0*b0 로 두 값의 곱이 된다.    
만약 많은 수의 입자 쌍에 대해 실험을 하여 평균을 내면, 
하나의 입자쌍에 대해 S 는 +/- 2를 가질 것이므로, 
S의 평균값은 -2 에서 +2 사이에 있게 될 것이다. 
이것이 CHSH  부등식( -2<= S <= 2 ) 이고, 고전역학이 맞다고 반드시 만족시켜야하는 조건이다. 
(실제로는 하나의 입자에 대해서는 한가지 종류의 실험만이 이루어 질 것이다. 
예를 들어 첫번째 입자 쌍에 대해 A0와 B1이라는 실험을 하면, a1과 b0값은 측정이 안된다.
하지만, 많은 수의 입자에 대해 실험을 반복할 경우, A0 실험의 평균값 < A0> 는 모든 입자에 대한 a0 의 평균값에 가깝게 될 것이다. 다른 실험의 평균값의 경우도 마찬가지.)      

한편, 양자역학적으로 얽힌 상태의 경우, 예를 들어 $|S=0>=1/sqrt(2)(|up,down>-|down,up>)$의 경우  A0*B0의 실험 값은 expectation value, $<S=0| A0*B0| S=0>$
에 의해 결정된다. 이것은 다음과 같이 계산할 수 있다. 

<S=0|A0*B0|S=0> = (1/2)*(up|A0|up)*(down|B0|down)
                          -(1/2)*(up|A0|down)*(down|B0|up)
                          -(1/2)*(down|A0|up)*(up|B0|down) 
                          +(1/2)*(down|A0|down)*(up|B0|up)

즉, 양자역학의 경우는 결과가 단순히 곱으로 분리되지 않는다. 

특별히, 다음과 같은 실험을  준비한다고 하자. 

A0 : z축. 즉 ( 0,0, 1) 방향으로의 spin 값 측정
A1 : x축, 즉 ( 1,0,0 ) 방향으로의 spin 값 측정
B0 : 45도 축, 즉 (-1,0,-1) 방향 으로의 spin값 측정
B1:  -45도 축 , 즉 (1,0,-1)방향 으로의 spin값 측정

양자역학적으로는 각 실험에 다음과 같은 operator를 정해주는 것에 해당한다. 
A0 = sigma_z, 
A1 = sigma_x 
B0 = -1/sqrt(2)( sigma_x+sigma_z) 
B1= 1/sqrt(2)( sigma_x-sigma_z)

이 경우에 계산을 해보면 
< S=0| A0*B0| S=0> =  < S=0| A0*B1| S=0> =< S=0| A1*B0| S=0>= 1/sqrt(2) 
< S=0| A1*A1 |S=1> = -1/sqrt(2) 
으로 
S의 평균값은  (1/sqrt(2)+1/sqrt(2)+1/sqrt(2)-(-1/sqrt(2)))= 2*sqrt(2) 가 예상되게 된다. 이것은 고전역학이 만족시켜야하는 CHSH 부등식( -2 <= S <= 2)을 분명히 만족시키지 않는다. 따라서, <S> 의 값을 측정한 결과가 양자역학의 예상과 일치한다면, 고전역학은 틀릴 수 밖에 없다. 

photon 을 이용한 실험결과 <S>의 값이 고전적인 CHSH 부등식을 만족시키지 않고 양자역학적인 예측값과 일치하는 것을 확인할 수 있다고 한다. 

2022년 5월 24일 화요일

mingw-w64 install

 At some point, the install program of mingw-w64 does not work properly with error message " The file is not downloaded properly." 


The solution to this problem is to directly download the compiled files. 

(1) Go to the link

https://sourceforge.net/projects/mingw-w64/files/

(2) Select the chosen version of files (I choose x86_64-posix-seh )

(3) download and unzip. copy the file to c:\mingw-w64 (or to any path of choice)

(4) include the path (/bin and /include) to the Windows. 

   (For example c:\mingw-w64\bin and c:\mingw-w64\include) 

    ("system property"->"advanced"->"environment variables"-> "Path"->"add") 

 (5) Now one can use mingw in the command prompt. 

 

2022년 4월 19일 화요일

compile of the code for Eigenvector Continuation for elastic scattering

 Original Reference 

https://github.com/buqeye/eigenvector-continuation

which is the code for  arXiv:2007.03635,

To use the code in Windows, some modification is necessary.

Environment: Mingw64, gfortran, python, no lapack

(1) change the code of fortran file to use internal subroutine instead of lapack library. 

    this can be done simple commenting. 

(2) compile all fortran source code with f2py 

    python -m numpy.f2py -c  -m rmatrix_f2py   rmatrix_f2py.f

    python -m numpy.f2py -c  -m rmatrix_f2py_complex_potential rmatrix_f2py_complex_potential.f

    python -m numpy.f2py -c  -m coulomb_Barnett coulomb_Barnett.f 

(3) copy created dll files(in each sub-directories) to the source directory.

(4) Now we can use the fortran subroutines in python. 

(5) The jupyter notebook works now. 


2022년 1월 11일 화요일

2021년 10월 7일 목요일

interpolation with multi-dimensional grid data

Suppose we want to interpolate a multi-dimensional function

y = f(x1, x2, x3...) 

and we have numerical table of values at grid points of each axis. 

This interpolation can be done by using scipy.interpolate.interpn 

However, the data have to be prepared in specific forms. 


scipy.interpolate.interpn(pointsvaluesximethod='linear'bounds_error=Truefill_value=nan)


(1) "points" are tuple of grid points in each axis. 
     points = ( [array of possible grid points in 1st axis], [array of possible grid points in 2nd axis],...) 
     in other words, points=(x1,x2,...xn) such that  xn[i] gives i-th grid value in n-th axis. 

(2) "values" are n-dimensional array such that 

     value[ i1][i2][i3]...[in] = f( x1[i1],  x2[i2],..., xn[in] ) 

(3) "xi" is a coordinate to sample the value 



2021년 7월 8일 목요일

Physics journals

Let us list impact factors of related with my research.  (may be not so recent.) 

I am surprised that the rank of Physical Review C is not so high. 


1 REVIEWS OF MODERN PHYSICS 45.037

7 PHYSICS REPORTS-REVIEW SECTION OF PHYSICS LETTERS 25.798

9 Nature Physics 19.256

11 REPORTS ON PROGRESS IN PHYSICS 17.032

14 ADVANCES IN PHYSICS 16.375

17 PROGRESS IN PARTICLE AND NUCLEAR PHYSICS 13.421

18 Physical Review X 12.577

28 Annual Review of Nuclear and Particle Science 8.778

29 PHYSICAL REVIEW LETTERS 8.385

47 NUCLEAR DATA SHEETS 5.944

59 PHYSICAL REVIEW D 4.833

64 PHYSICS LETTERS B 4.384 

72 PHYSICS TODAY 3.875

79 COMPUTER PHYSICS COMMUNICATIONS 3.627

82 PHYSICAL REVIEW B 3.575

115 PHYSICAL REVIEW C 2.988

129 NUCLEAR PHYSICS B 2.817 

130 PHYSICAL REVIEW A 2.777

135 Frontiers in Physics 2.638

353 FEW-BODY SYSTEMS 0.823

396 JOURNAL OF THE KOREAN PHYSICAL SOCIETY 0.535

2021년 6월 11일 금요일

Creating personal library in Linux : 1. Fortran library to be used in Fortran (working)

 The purpose of this post is to summarize the procedure to make personal library of routines so that re-use previous works. 

(1) Fortran library to be used in Fortran 

(2) C/C++ library to be used in C/C++

(3) Fortran library to be used in C/C++

(4) C/C++ library to be used in Fortran

(5) Fortran library to be used in Python 

(6) C/C++ library to be used in Python 


Let us start from the first/second case. 

(1) to make a static library use "ar  crvs" 

ar rc liball.a dog.o cat.o bird.o #rc=replace/create

ranlib liball.a # make symbol indexing or use "s" for ar

to use

gcc main.c -L -l<filename>

(2) to make dynamic/shared library use linker like "gcc" ,"gfortran"

gcc -g -fPIC -Wall -Werror -Wextra -pedantic *.c -shared -o liball.so

to use dynamic library

gcc -g -wall -o app app.c liball.so

* if source file *.f use .mod file, one have to keep them to make shared library.
But once the shared library is created, .mod files are no more necessary. 

-------------------To be continued---------------------------------------------