Windows에서 QuTIP 사용

9731 단어 WindowsPythonQuTiP

Windows에서 QuTip Tips 사용


이른바 Qutip

  • python의 봉인
  • 에 사용되며, 양자 상태, 양적 계층 분석 영상 시뮬레이션 등에 사용된다.
  • Python2.7+를 눌러 이동합니다.
  • qutip.참조
    QuTiP is open-source software for simulating the dynamics of open quantum systems. The QuTiP library depends on the excellent Numpy, Scipy, and Cython numerical packages. In addition, graphical output is provided by Matplotlib. QuTiP aims to provide user-friendly and efficient numerical simulations of a wide variety of Hamiltonians, including those with arbitrary time-dependence, commonly found in a wide range of physics applications such as quantum optics, trapped ions, superconducting circuits, and quantum nanomechanical resonators. QuTiP is freely available for use and/or modification on all major platforms such as Linux, Mac OSX, and Windows*. Being free of any licensing fees, QuTiP is ideal for exploring quantum mechanics and dynamics in the classroom.
    QuTIP는 개방된 양자 시스템의 동태를 시뮬레이션하는 오픈 소스 소프트웨어입니다.QuTIP 라이브러리는 우수한 수치 계산 라이브러리 Numpy, Scipy, Cython에 의존합니다.드로잉 출력은 Matplotlib에서 제공합니다.QuTIP의 목적은 양자광학, 이온함정, 초전도회로, 양자명공진기 등 물리적 응용의 광범위한 범위에서 흔히 볼 수 있는 다양한 시간 의존성의 하미턴 양을 쉽게 사용하고 효과적인 수치 시뮬레이션을 제공하는 것이다.QuTIP는 Linux, Mac OS X, Windows* 등 모든 주요 플랫폼에서 사용 및/또는 변경할 수 있습니다.QuTIP는 어떠한 허가비도 받지 않고 교실에서 양자 역학과 동태를 탐색하는 것이 이상적이다.

    Anaconda 설치

  • python 3을 사용하려고 하지만 잘 되지 않아 pythn2
  • 를 사용해야 합니다
  • 이유: conda에서 지원하는 QUTIP의 버전은pytht2
  • 뿐입니다.

    QuTip 설치

  • Anaconda Proompt를 열고 다음 명령으로 QuTIP를 설치하는 데 사용할 정보를 얻습니다
  • $ anaconda search -t conda qutip
    $ conda install -c https://conda.anaconda.org/ajgpitch qutip
    

    mayavi 설치

  • Bloch3d() 사용에 필요
  • $ conda install -c https://conda.anaconda.org/menpo mayavi
    

    PyCharm 설치

  • IPython을 사용하면 알림에서도 계산할 수 있지만 매번 함수를 정의하는 것은 번거롭다.
  • script를 쓰고 실행하는 IDE의 PyCharm을 추천합니다.
  • 학생은 무료로 사용할 수 있고 학생에게도 추천한다.
  • 최후

  • 샘플 코드
  • from mayavi import mlab
    import numpy as np
    from qutip import *
    import matplotlib.pyplot as plt
    
    mlab.test_contour3d()
    b = Bloch()
    b3d = Bloch3d()
    vec = [0, 1, 0]
    pnt = [1/np.sqrt(3), 1/np.sqrt(3), 1/np.sqrt(3)]
    up = basis(2, 0)
    b.add_vectors(vec)
    b.add_points(pnt)
    b.add_states(up)
    b.show()
    
    # state generation
    N = 20
    rho_coherent = coherent_dm(N, np.sqrt(2))
    rho_thermal = thermal_dm(N, 2)
    rho_fock = fock_dm(N, 2)
    xvec = np.linspace(-5,5,200)
    W_coherent = wigner(rho_coherent, xvec, xvec)
    W_thermal = wigner(rho_thermal, xvec, xvec)
    W_fock = wigner(rho_fock, xvec, xvec)
    
    # fig config
    fig, axes = plt.subplots(1, 3, figsize=(12, 3))
    cont0 = axes[0].contourf(xvec, xvec, W_coherent, 100)
    lbl0 = axes[0].set_title("Coherent state")
    cont1 = axes[1].contourf(xvec, xvec, W_thermal, 100)
    lbl1 = axes[1].set_title("Thermal state")
    cont2 = axes[2].contourf(xvec, xvec, W_fock, 100)
    lbl2 = axes[2].set_title("Fock state")
    plt.show()
    
    순조롭게 그리기 완료

    좋은 웹페이지 즐겨찾기