← Quantum Store · Guides · Lessons · Glossary · Packages · About · Türkçe

The QuTiP community

QuTiP: simulating open quantum systems

SoftwareSimulationLicence: BSD-3-ClauseVersion: 5.3.15.6 KB

Official source: qutip/qutip

Download ZIP (free)

QuTiP for simulating quantum dynamics and noise (decoherence): a tested example that solves damped Rabi oscillations with the Lindblad master equation.

What is QuTiP?

QuTiP (Quantum Toolbox in Python) is an open-source library that simulates how quantum systems evolve over time. It is the standard tool for "open" quantum systems in particular, those that interact with their surroundings, losing energy and phase information (decoherence). Its first version was developed at RIKEN by J. R. Johansson, P. D. Nation and F. Nori (Comput. Phys. Commun. 183, 1760, 2012); today it is maintained by an international community.

When to use it

The example in this package

rabi_salinimi.py follows a qubit driven on resonance for 3 seconds. At the first π pulse (t = 0.5 s) the qubit reaches the excited state with 96% probability; damping (γ = 0.2) reduces the amplitude of the oscillation over time.

Next steps

  1. Add a collapse operator np.sqrt(gamma_phi) * qt.sigmaz() for dephasing.
  2. Try an off-resonant (detuned) drive: H += 0.5 * delta * qt.sigmaz().

Installation and running

pip install qutip
python rabi_salinimi.py

Tested with: qutip 5.3.1, Python 3.12.

Official source

Links

Package contents

Licence

The example code and the guide in this package were written by the Quantum Store editors and are MIT licensed. The project it uses is subject to its own licence (BSD-3-Clause).


Quantum Store — https://hakanerdogan.com/en

Example code

The example shipped in the package, run and checked. Comments and printed messages are in Turkish; the code is the same in any language. Everything is in the ZIP.

rabi_salinimi.py

"""QuTiP ile sönümlü Rabi salınımı (açık kuantum sistemi).

Rezonanstaki sürücü, kübiti |0> durumundan |1> durumuna döndürür; enerji
sönümü (T1) salınımın genliğini zamanla azaltır. Lindblad ana denklemi
mesolve ile çözülür.

Çalıştırma:
    pip install qutip
    python rabi_salinimi.py
"""

import numpy as np
import qutip as qt

rabi_hz = 1.0
gamma = 0.2  # sönüm hızı (1/T1)

H = 0.5 * 2 * np.pi * rabi_hz * qt.sigmax()
psi0 = qt.basis(2, 0)
tlist = np.linspace(0, 3, 301)

result = qt.mesolve(
    H,
    psi0,
    tlist,
    c_ops=[np.sqrt(gamma) * qt.destroy(2)],
    e_ops=[qt.num(2)],
)
excited = np.asarray(result.expect[0])

for t in (0.0, 0.5, 1.0, 1.5, 2.5):
    i = int(round(t * 100))
    print(f"t = {t:3.1f} s   P(|1>) = {excited[i]:.3f}")

first_peak = excited[50]
later_peak = excited[250]
assert first_peak > 0.9 and later_peak < first_peak, (first_peak, later_peak)
print("Tamam: ilk π-darbesinde neredeyse tam geçiş, sönümle azalan genlik.")

Related concepts

← All packages

Share: X · LinkedIn