2017년 5월 16일 화요일

Tikz-Feynman package for Feynman diagram

There have been several packages to draw Feynman diagrams in tex environment.
But I have used two:

Axodraw ( Jaxodraw)
Feynmf (Feynmp)

However, one is rather old and non-standard and the other is not easy to use.

New package "Tikz-Feynman" seems to be good in look and easy in usage.
However, when I try to use the package the diagrams are weird and different shapes
from examples.
The problem was that I compiled them with 'pdflatex'.
It looks like the "Tikz-Feynman" is only compatible with 'lualatex'.
Since it is not written in the manual or webpage, it was difficult to know.

On the other hand, I found each package have advantage and disadvantage.
It is mostly how the vertices are positioned by the command.
For me, Feynmf seems to be better than others. But, because it use metafont,
it is rather slow and I have problem with TexStudio using Feynmf.
(I had to delete metafont whenever I modify them).

2017년 4월 13일 목요일

Shell model code NUSHELL tips

1. In old version of NUSHELL, be careful for the 'psd' model space.
   The single particle levels defined in the 'psd.sp' and interactions like 'psdmk.int'
   may be not consistent.
   The level ordering in original 'psd.sp' file is

   1 1 1 3  (p3/2)
   2 1 1 1  (p1/2)

   But, it have to be changed as follows to be consistent with the definitions in 'psdmk.int' interaction file.

   1 1 1 1  (p1/2)
   2 1 1 3  (p3/2)


---UNDER CONSTRUCTION

2017년 3월 29일 수요일

Python referencing( copying variables, objects)

In many language (at least, in Fortran), '=' makes a copy of a variable, so

a=1; b=a;  b=2

makes a=1 and b=2. Thus any change of the copy does not change the original.
This is the same for python, if the variable is a simple object.

However, in python, 'list1= list2' does not make two lists. Instead it refers the same reference object. Since, if a new value is assigned to the list, it may be okay.

a=[1,2,3]; b=a; b=[4,5,6]

makes a as [1,2,3] and b as [4,5,6] since the last  assignment 'b=[4,5,6]'
can be considered as a new assignment.

However, if we modify its elements,

a=[1,2,3]; b=a ; b[1]=7

makes both a and b as [1,7,3] (instead of a as [1,2,3], b as [1,7,3] )
since a and b were both refer the same object.

To obtain the originally desired effect, one can use

(1) b=a[:]  or b[:]=a[:]
(2) b=list(a)
(3) b=copy.copy(a)






2016년 9월 20일 화요일

범죄수학( 리스 하스아우트)

범죄 수학


리스 하스아우트 지음 | 오혜정 옮김 | 남호영 감수 | GBRAIN | 2010년 07월 23일 출간

추리 소설과 수학을 이상적으로 결합한 책이다. 마치 encyclopedia Brown 처럼, 검사인 아버지의 사건을 아들인 라비가 수학적 지식으로 도움을 주는 형식이다. 사건에 대한 짧은 글과 중요한 내용을 수학문제로 다시 짧게 간추려준 다음, 수학 문제의 답과 사건의 해결방법을 알려준다. 그리고, 나온 수학적 내용을 좀 더 깊이 있게 설명하기도 한다. 
전체적인 문제의 수준은 고등학생이상 (경우에 따라서는  대학생 이상) 이지만, 간단한 대수나 논리 문제는 중학생도 가능할 것으로 보인다. 이전의 짧은 콩트 형식의 추리 퀴즈나 퍼즐들에 비해 난이도가 높은 편이지만, 상당히 재미있게 읽을 수 있었다. 어떤 문제는 문제에 주어진 정보가 너무 부족한 것 같은데도, 답을 알수 있다는 것이 놀랍고, 어떤 경우는 문제의 답들이 상식적인 예상을 벗어나는 놀라운 경우가 많았다. 

목차

추천의 글
서문
감사의 말

시커모어가에서의 살인 사건
수박을 거래하면서 생긴 일
그랜드캐니언의 흰머리 독수리 가족
농구 선수들의 조편성 속임수
월석 절도 미수 사건
듀보브 연구소의 보안 시스템
카지노에서 일어난 살인 사건
경주마 순위 매기기
볼링 평균 점수
필름 속 두 쇠공
샨카 화학약품회사에서 생긴 불운
퇴학당할 뻔하다
도심 속 숲
폭설이 내린 오크가의 아침

결론
찾아보기 - 문제와 관련하여
역자의 글

2016년 9월 15일 목요일

Brain teaser: Hand shakes

Q: Suppose you and your wife meet two other couples.  While greeting,  they shake hands with each other. (So, there are 6 people). But, a husband does not shake hands with his own wife.  After greeting, suppose you asks other people how many times did they hand shake. Surprisingly, all of them (5 people including your wife)  answers differently. In that case, what is the number of hand shakes of your wife?

    당신과 당신의 아내가 다른 2쌍의  부부를 만났다고 하자. (즉, 6명이 만났다.) 인사를 하면서 각자 악수를 한다음, 당신이 모두에게( 당신의 부인을 포함한 5명에게) 몇번이나 악수를 했는지 물었다고 하자.  단, 부부 끼리는 서로 악수를 하지 않는다. 놀랍게도 모두들 다른 숫자를 말했다고 한다면, 이 때 당신의 부인은 몇번 악수를 했을까?  (문제에 주어진 조건은 충분하다. )


2016년 9월 9일 금요일

Brain teaser: '50' game, 50 게임.

Q: 두명이 번갈아가며 숫자를 부르는 게임을 하는데, '50'을 부르는 사람이 이긴다.
    단, 규칙은 처음 시작할 때는 1-10 까지의 숫자만 부를 수 있고, 그 이후에는 상대방이
    부른 숫자보다 1에서 10이 더 큰 숫자만 부를 수 있다는 것이다.
    예를 들어 상대방이 '9' 를 부른 경우 , '10-19' 까지의 숫자만 부를 수 있다.
    이 게임에서 먼저 시작하는 것이 유리할까, 나중에 시작하는 것이 유리할까?
    반드시 게임에 이길 수 있는 전략이 있을까?


2016년 9월 8일 목요일

Brain Teaser: 남자아이의 비율

Q: 어떤 도시에 아이가 없는 10만쌍의 부부가 있다.
    이 도시 사람들은 남자 아이를 선호하여, 적어도 한명의 남자 아이를 원한다.
    그래서, 매년 모든 남자 아이가 없는 부부는 한명씩의 아이를 낳는데, 남자 아이가
    태어날 때 까지 계속 낳다가 남자 아이가 생기면, 더이상 아이를 낳지 않는다.
    예를 들어 어떤 가족의 아이가 5명 이라면,
    4명의 딸과 1명의 아들이 있거나, 5명의 딸이 있고
    앞으로 아이를 더 낳을 계획이 있는 것이다.
    남자 아이와 여자 아이가 태어날 확률은 같다고 하자.
    어떤 연도(t)의 마지막에, 아이들 중 남자 아이의 비율을 p(t) 라고 할 때
     시간이 지남에 따라 이 비율은 어떻게 변해 가는가?